cancel
Showing results for 
Search instead for 
Did you mean: 

When create purchase order from purchase request using script, how can create PriceCalculationItem?

former_member200995
Contributor

Hi experts,
In Bydesign System, the business: create a sales order, the purchase request and purchase order will auto create.
The purchase request is created by system(system configuration), and the purchase order must be created by the program.
And the purchase Order's price copy from sales order's price.

About the program, now I create a purchase Order using CreateFromPurchaseRequest() script, but the purchase Order can't create the PriceCalculationItem.

var po_item = PurchaseOrder.CreateFromPurchaseRequest();

var po_item_price = po_item.PriceCalculationItem.Create();

var po_item_price_Price = po_item_price.ItemMainPrice.Create();
var po_item_price_Surcharge = po_item_price.ItemMainSurcharge.Create();
var po_item_price_Discount = po_item_price.ItemMainDiscount.Create();

the po_item_price and po_item_price_Price return null.
Any idea to create the PriceCalculationItem of the PurchaseOrder?

Thanks in advance.
Best Regards,
Benny Huang

kostadin_terziev
Participant
0 Kudos

Hello, Benny!

Don't you have to pass the Purchase Request object instance to the action PO.CreateFromPurchaseRequest(instanceHere)?

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Dear Benny,

I checked some information and I recommend to you to open an incident to check it further.

With this action, we'll be able to help you with this process.

Any doubt, please, let me know.