how to multiply qty & UnitPrice of item in PurchLine


I will create a new form same as PurchTable. So Please tell me how to multiply qty & UnitPrice of item & display the line Amount automatically on PurchTable form.

Refer - “modifiedfield” method in purchLine ( case fieldnum(PurchLIne, PurchPrice))…

Are you creating the exact purchTable form with PurchLine grid?

In that case, you can go with Kranthi’s suggestion.

I’m just giving you a sample code that you can try in jobs.

static void Job1()

PurchLine purchLine;

purchLine.PurchPrice = 100;
purchLine.LineAmount = purchline.calcLineAmountForced(10); // 10 s the quantity.

print purchLine.LineAmount;


or else, you can have a look at this also…

public PurchLineAmount purchLineAmount(InventQty _qty, PriceUnit _unitPrice)

Practice practice;


practice.QtyOrdered = _qty;
practice.PriceUnit = _unitPrice;

practice.LineAmount = practice.QtyOrdered*practice.PriceUnit;


return practice.LineAmount;


It is not a question of purely multiplying quantity with price. As I pointed in the other thread, standard functionality encapsulates various functionalities like trade agreements, unit conversion etc.

However in your case, I am not sure what the requirement is. If your requirement is to mimic standard, then you have to do as per standard. If this is the case, try to call standard methods as far as possible.

If your requirement is not to mimic standard, then you can do something in lines with what earlier posted said.