Hello,
First of all, for those who remember my questing about something opposite to the method objectMatchingKeyAndValue, well I decided to do the following: 1. since what the user is registering are products into the stock, if a product already exist, it will update the quantity in stock with the one that it's being register,.
2. inform the user if it was right, and give the option to confirm, in which case will continue the execution normally, or if its a mistake, it can undo (I read something about undo in the EOF programming guide)
So now, in case all was fine, I wanna update the quantity of the object, I got the Object with the following. Product p = (Product)EOUtilities.objectMatchingKeyAndValue(session().defaultEditingContext(), "Product", Product.CODE_KEY, code); so Product has a attribute, numberItemsinStock, how can I update that info with the new one? should I take the old vale add the new one, and save the product in the EC, and then save changes? or...
what you think, suggestions. ?
Thanks
Gustavo |