on 2016 Aug 02 10:57 AM
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
Hi Thi,
Can you use Retrieve method? Something like:
import ABSL;
import AP.Purchasing.Global;
var purchaseOrder = PurchaseOrder.Retrieve("1234");
if (purchaseOrder.IsSet() && purchaseOrder.DelivetyTerms.IsSet())
{
purchaseOrder.DeliveryTerms.Incoterms.ClassificationCode = "FOB";
purchaseOrder.DeliveryTerms.Incoterms.TransferLocationName = "Hamburg";
purchaseOrder.SubmitForOrder();
}
Regards,
Alexandre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alexandre,
I apologize for my incomplete testing. Now, I tested again. It is OK with both ways 【Retrieve() and Execute()】.
The problem is that it cannot fill the data when the "Incoterms" and "Incoterms" Location is empty.
It can only update the values of those fields when the initial values have been set.
Thanks and Regards,
Thiri
User | Count |
---|---|
72 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.