Business requirement: creation of Intercompany Purchase order for a project item requirement
Upon creating an Intercompany Purchase Order based on a project item requirement, the Purchase Order is of type Journal and is uneditable. Hence the Intercompany Sales Order isn’t created neither in the vendor company account and it can’t be created neither as the Intercompany Purchase Order is uneditable.
This behaviour can be easily simulated on the demo data:
- Create an item requirement on a project.
- Click Functions > Create purchase order.
- Select the Include check box in the line for the project item requirement and verify that vendor 9100 is selected in the Vendor field.
Solution: Adapt class SalesTableType
A small X++ code fix can solve this problem in class SalesTableType, method syncPurchTable.
if (_salesTable.fieldChanged(fieldnum(SalesTable, SalesType)))
{
switch(salesTable.SalesType)
{
case SalesType::Subscription :
axPurchTable.parmPurchaseType(
PurchaseType::Subscription);
break;
case SalesType::Sales :
axPurchTable.parmPurchaseType(
PurchaseType::Purch);
break;
case SalesType::ReturnItem :
axPurchTable.parmPurchaseType(
PurchaseType::ReturnItem);
break;
case SalesType::Blanket :
axPurchTable.parmPurchaseType(
PurchaseType::Blanket);
break;
// BEGIN: intercompany chain for item requirements
case SalesType::ItemReq :
axPurchTable.parmPurchaseType(
PurchaseType::Purch);
break;
// END: intercompany chain for item requirements
default :
axPurchTable.parmPurchaseType(
PurchaseType::Journal);
}
}
Upon creating an Intercompany Purchase Order, it won’t be of type Journal anymore and the Intercompany Sales Order in the vendor company account will be created automatically too.
Patrik,
Do you know if this defect was fixed in subsequent releases of AX? i am struggling to make this work in R3 CU8.
Thanks in advance,
Mike K
IBM
Post a Comment