Calcuation

Hi,

If i am Having column operation like this ((A-B)+C+D),

i have tried in source expression property of that column,but is is not giving desired result…

Thanq in advance…

Rather than typing in an example of what you’re doing, maybe you could copy/paste the actual value of the SourceExp property that you’re having trouble with? It’s really hard to debug pseudo-code.

Hi,

(“Sales Line”.“Unit Price” - “Sales Line”.“Unit Cost (LCY)”) + “Sales Line”.“Inv. Discount Amount” +“Sales Line”.“Special Price”

The above code i have pasted in source expression of Margin Text box property,but it is not giving correct values,when i run report…plz help me…

Hi Varimulla,

Maybe you should use calcfields function on the code.

follow below link for details :

http://msdn.microsoft.com/en-us/library/dd338975.aspx

Try to take this value in one variable and out that variable in Source expression

To possible issues: 1) scope and persistence, and 2) flowfields.

I’m not sure about your “Special Price” field, but if it’s a flowfield, you’ll need to use the CALCFIELDS command before this control will populate correctly.

On the scope and persistence question, you’re source record is “Sales Line” (btw, standard practice is the call this variable SalesLine, no spaces). The question is whether, at the time your control is getting calculated and resolved to a single value, is the “Sales Line” variable on the record you expect it to be on?

When I’m trying to resolve issues like this, I usually just build a quick codeunit function or form object based on, in this case, the t_37 record, and then I’ll just make a single control to display the result of the equation I’m having problems with. You might also make individual controls for each of the variables in the expression to make sure that they’re returning the values you’re expecting.