Skip to Content
0
Former Member
Aug 02, 2016 at 09:57 AM

How to update the data "Incoterms" and "Incoterms Location" of Purchase Order in ABSL?

435 Views

Hi Experts,

I would like to update the data "Incoterms" and "Incoterms Location" of existing Purchase Order ID in ABSL. I worte some codes in ABSL of custom BO. But the following error is shown and cannot update correctly. Error → "Location for Incoterms missing; enter an Incoterms location"

Here is my code. I also traced the code and the data is correctly filled to the fields respectively during debug time. But the error is shown and save failed at the end. Please kindly help.

import ABSL;

import AP.Purchasing.Global;

var query = PurchaseOrder.QueryByElements;

var param = query.CreateSelectionParams();

param.Add(query.ID.content, "I", "EQ", "1234");

var result = query.Execute(param);

foreach (var header in result) {

if (header.DeliveryTerms.IsSet()) {

header.DeliveryTerms.Incoterms.ClassificationCode = "FOB";

header.DeliveryTerms.Incoterms.TransferLocationName = "Hamburg";

}

header.SubmitForOrder();

}

Thanks and Regards,

Thiri