Lineitemarray not working with arrayselectedbuild

The statement arrayselectedbuild doesn’t work properly if lineitemarray() is used in the formula, like this:

arrayselectedbuild lvArrayParts,cr(),"",lineitemarray("PartΩ",cr())

Instead of getting an array of PartΩ line items for each selected record, I get an array of the PartΩ for the first selected record only, over and over again. It seems that lineitemarray somehow prevents arrayselectedbuild to move and scan the next record.

However, the following confirms that all selected records are scanned:

arrayselectedbuild lvArrayParts,cr(),"",«PurchOrder»+"-"+lineitemarray("PartΩ",cr())

as I do get the correct purchase order for every selected record, but lineitemarray still returns data from the first record only.

Well, you finally gave me a question that I can answer quickly. Unfortunately, it’s quick because the answer is that the lineitemarray( function isn’t implemented yet in Panorama X.

I’m thinking that I may not ever implement this. The Relational panel now allows two databases to be linked where one has line items and the other doesn’t. My current plan is to implement a new variation of the importdatabase statement that converts line items in one database into separate records in another database using the specification in the Relational panel. I think this would be both easier to implement and easier to use.

So I can answer your question quickly, but not solve your problem quickly. Sorry about that.

1 Like

And of course, leave it to me to be thinking of using this very function, because I have files of schedules where each record is a team, and line items for the time, court, and opponent that the team is playing each week. I occasionally make mistakes and have a team playing itself, which actually arose last week with my own team. I was thinking of checking it by searching the lineitemarray of the opponents for the team’s number. Oh, well, as the song goes, I Guess I’ll Have To Change My Plan.

I’m a bit confused, do you mean it is not yet implemented to work with arrayselectedbuild?

I have been successfully using lineitemarray in other situations. In this case, I replaced the arrayselectedbuild with the following and it works as expected:

for i,1,info("selected")
  lvArrayParts=lvArrayParts+cr()+lineitemarray("PartΩ",cr())
  downrecord
endloop

I’m sorry, I’m the one that was a bit confused. You are correct – what is not implented is the way the connection between arrayselectebuild and lineitemarray(. They both work fine on their own.

I think that will work. Sorry to mislead you.