Calclation Issue

Calclation Issue

I am trying to make a record with one record that gets it value from taking an amount, adding a markup, and then show the value. I right now have it set up as:
Value A: 25
Value B: 0.07
Value C Comes To: 25.00
Value C Should Be: 26.75

The expression I have is:
ItemsTotal2 (which is what value "C" equeles to)=
ItemTotal2 + (WorkOrderItemTable.List.Current.WorkOrderItems.UnitPrice * (1.00 * WorkOrderItemTable.List.Current.WorkOrderItems.Markup))

I have the OML attached that might give you a better look at what is happening. Everything I am working in is under the New Work Order page, under the Work Order Items Table, Action UpdateItemPrice.
Hi Michael.

Here's my ideia:

You should replace the GetWorkOrderItemsByWorkOrderId query to an AdvanceQuery, you should calculate the Total Item Price there. When you achive that, you can replace the ItemTotal2 variable, and you should have the correct value for all the lines (done in the preparation), then, the UpdateItemPrice screen action it will be more easy to change and debug.

Attached you can find the e-space with that sugestions,  I haven't tested it in runtime but it should work.

I hope this reflects your thoughts and is helpful for you.


Daniel Martins.

Hi Michael

Your problem is simple, the WorkOrderItems.Markup is a Integer, should be Decimal.
So if you fill 0.07 it won't be parsed correctly. (actually with the current version of the oml it gives 0 as a result not 25 because of that "ItemTotal2 Redo" assign)

João Rosado
That´s right, João Rosado!  I didn't notice that, good point.

Besides that, i think you should change your preparation.


I didn't even think of that, but it worked. Thanks.