on 05-22-2018 5:19 PM
Hi,
I am building an SDK solution for the Service Order BO. The solution is responsible for adding a line item to the Service Order w/ the following properties/values:
Line ID: 10 ProductID: REPAIRS Quantity: 1 Quantity UOM: EA Non-Billable: true Coverage: 100% Warranty
Here is my "AfterModify" script for the root node:
//Create 'REPAIRS' item when new service order is being created if (this.Item.Count() == 0 && this.HasRepairItemCreated == false) { // define ServiceOrder item node var elServiceOrder_Item: elementsof ServiceOrder.Item; var elSalesOrderItemPricingTerms : elementsof ServiceOrder.Item.ItemPricingTerms;
var instServiceOrder_Item;
// ServiceOrder: maintain item with product // ServiceOrder: set item ID or any other attribute of the node Item in order // to be able to enter a product later on elServiceOrder_Item.ID = "10"; // ServiceOrder: create item instance instServiceOrder_Item = this.Item.Create(elServiceOrder_Item); // set product identifier - mandatory instServiceOrder_Item.ItemProduct.ProductKey.ProductID.content = "REPAIRS";
// change quantity - optional if ( instServiceOrder_Item.FirstRequestedItemScheduleLine.IsSet()) { // set product quantity and UOM (will be defaulted by the system if not set) instServiceOrder_Item.FirstRequestedItemScheduleLine.Quantity.content = 1; instServiceOrder_Item.FirstRequestedItemScheduleLine.Quantity.unitCode = "EA"; }
// set Non-Billable if ( instServiceOrder_Item.ItemInvoiceTerms.IsSet()) { instServiceOrder_Item.ItemInvoiceTerms.InvoicingIrrelevant = true; } else { var zItemInvoiceTerms : elementsof ServiceOrder.Item.ItemInvoiceTerms; zItemInvoiceTerms.InvoicingIrrelevant = true; instServiceOrder_Item.ItemInvoiceTerms.Create(zItemInvoiceTerms); }
//Coverage if (instServiceOrder_Item.ItemPricingTerms.IsSet()) { instServiceOrder_Item.ItemPricingTerms.WarrantyGoodwillCode.content = "W1"; } else { elSalesOrderItemPricingTerms.WarrantyGoodwillCode.content = "W1"; instServiceOrder_Item.ItemPricingTerms.Create(elSalesOrderItemPricingTerms); } }
The following properties/values never set: Quantity Quantity UOM Non-Billable Coverage
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.