Computational Field by Code in Dynamics Ax

hi

some Field in Dynamic Ax are Computational and Calculation

for example net amount in Sales Order ( Accounts receivable)

when i change SalesQty Value by code in Dynamics Ax , Computational Field not work Properly

i write this code in a button :

SalesLine.SalesQty= 100;

I expect dynamics ax automatically computed other field like "net amount " , price , …

when i enter value in SalesQty As normal and Without code its work Properly.

What instructions or Syntax should I add to this?

Thanks All

If user changes quantity in a form, AX executes modifiedField() method which then recalculates the price (through SalesLine::modifySalesQty()). You can use the debugger to see what exactly happens there.

But if set change a field in code, no such method gets called code automatically - you’ll have to explicitly call methods you want to execute.

thanks martin

its work properly

i use this code :

SalesLine.modifiedField( Field ID );