This is in Mobile.
I have a 'List' with an Operation to Display ItemDetail lines.
On this list of ItemDetail Lines there is a Pick List option. This Pick list Displays 'Items', not 'ItemDetails' which is correct.
When the Pick List comes up, and I Select the Items, I Create ItemDetail Lines for the List. This works fine. However, if I go and select the Items again, I don't want to add it to the ItemDetails for the list again.
Basically, if selecting and Item and it exists in the ItemDetail, don't add it.
This is the code but see problem below.
PICK ONE OR MORE FROM 'Items Pick List'
If NOT(EXISTS ItemDetail WHERE (ItemDetail.List=List AND ItemDetail.Item=Item)) Then
CREATE ItemDetail WITH ItemDetail.ListOnwer=LoggedInListOwner,ItemDetail.Item=Item,ItemDetail.ItemName=Item.ItemName,ItemDetail.Note=Item.Note,ItemDetail.List=List
So the way this seems to work is as soon as it hits one which Exists, it stops adding others. I'm not sure how the cycling works with a Pick List. Another words is there a way to check each Item from the Pick list and then do the expression to add or skip the item. I thought about the 'In' statement but think the issue would be the same.
Maybe a different approach is needed. Any suggestions appreciated. Thank you.
Mark