How can i perform subtraction in a volatile entity and persistent entity

01 Apr '18, 11:27 PM
2,081 Views
No Forum Badges

Please, in my domain model I have a Volatile entity and a persistent entity which means there is no relationship between the two but I want to subtract the number of quantity(volatile entity) from  Product (Persistent entity) so that when I sell a product it will deduct from the product table.

Secondly, I have applied custom location user profile but when I generate and run after login I don't see user login name, please what might be causing that error?

Thank you.

 
x 0
Follow
Answer Answer at this question and get points!
Forum Expert - Level 5

Hi Tanko,

you can use the "Math" component available from the Utility Components section of the toolbar, to do the subtraction operation. You need to bind to the component the quantity from the "Product" persistent entity and the quantity from the "Product" volatile entity of the product that you want to update the quantity. Then the result returned from the "Math" component, will send to an Update Operation to change the value saved in the "Product" persistent entity.
Refer to this article https://my.webratio.com/learn/learningobject/how-to-use-math-unit-v-72 to lean how to use the "Math" component.

For the usage of the custom location, you can refer to the "How to Use Custom Locations" section of the "Reusable Models: Master Page" online lesson to learn the management of the related settings, at this link https://my.webratio.com/learn/learningobject/reusable-models-master-page-v-72.

Best regards.

   
x 0
Answer at this question and get points!