Hi Harish,
I have created below code and right now getting error on financial dimension setup and it’s throwing error on “Document could not be created. Error Details: Update has been canceled”. Could you guide me where to look to solve this error?
static
void
prodOrder(Args _args)
{
ProductionOrderService prodService;
// Production Order Service class
ProductionOrder prodOrd;
// Production document object
ProductionOrder_ProdTable prodTable;
// prodTable data object
ProductionOrder_InventDim inventDim;
// InventDim data object
AifEntityKeyList entityKeyList;
// Entity key list
;
// Create the service instance
prodService = ProductionOrderService::construct();
// Create the Production Order document object
prodOrd =
new
ProductionOrder();
prodOrd.createProdTable();
// Create the ProdTable list
prodTable = prodOrd.parmProdTable().addNew();
// Add ProdTable instance to ProdTable list
// Initialize the ProdTable instance
prodTable.parmItemId(
‘D0005’
);
prodTable.parmProdId(
‘P000175’
);
prodTable.parmQtySched(
1
);
//Start Setting up financial dimention
DimensionAttributeValue dimBu =
new
DimensionAttributeValue();
dimBu.parmName =
“BusinessUnit”
;
dimBu.parmValue =
‘022’
;
DimensionAttributeValueSet valueSet =
new
DimensionAttributeValueSet();
valueSet.Values = DimensionAttributeValue[
1
] {dimBu};
prodTable.parmDefaultDimension = valueSet;
// End Setting up Financial dimension
// Create the InventDim
inventDim =
new
ProductionOrder_InventDim();
// Initialize the InventDim instance
inventDim.parmInventSiteId(
‘1’
);
prodTable.createInventDim().add(inventDim);
// Create Production Order
entityKeyList = prodService.create(prodOrd);
}