Problem description: Intercompany orders with direct delivery cannot be created because of the WMS setup
Creation of a direct delivery purchase order for an intercompany vendor may fail with following error message: Intercompany orders with direct delivery cannot be created because of the WMS setup on dimension group for item ….
This error occurs because the item being traded has one (or both) storage dimensions Location or Pallet ID active on its Dimension group and Blank receipt allowed and Blank issue allowed aren’t checked.
Solutions
You can easily solve this problem by allowing blank receipt and issue on the items Dimension group.
However, in some cases this isn’t possible, for example, you cannot allow blank receipt/issue on a storage dimension which is part of the financial inventory.
If it is a storage dimension with only Location active, then you can tweak the code a bit like this in the class PurchCreateFromSalesOrder, method run:
...
if (salesTableLocal.InterCompanyDirectDelivery
&& SalesTableType::construct(
salesTableLocal).canCreatePurchOrder()
&& VendTable::find(
tmpPurchLinePrice.AccountNum).interCompanyAccountExist())
{
select firstonly RecId from inventTable
where inventTable.ItemId == salesLineLocal.ItemId
join inventDimGroup
where inventDimGroup.DimGroupId ==
inventTable.DimGroupId
join inventDimSetup
where inventDimSetup.DimGroupId ==
inventDimGroup.DimGroupId
// no check for location: if the warehouse has a
// default issue and receipt location or the
// items have a default issue and receipt
// location, then check isn't needed
//&& (inventDimSetup.DimFieldId ==
// fieldNumWMSLocationId
// || inventDimSetup.DimFieldId ==
// fieldNumWMSPalletId)
&& (inventDimSetup.dimFieldId ==
fieldNumWMSPalletId)
&& inventDimSetup.Active == true
&& (inventDimSetup.AllowBlankIssue == false
|| inventDimSetup.AllowBlankReceipt == false);
if (inventTable.RecId)
{
throw error(strfmt("@SYS99182",
salesLineLocal.ItemId));
}
}
...
Just make sure that your setup for your warehouse always has a default receipt and issue location: as such it isn’t a problem that there is no check anymore on the location field, as it will be filled up always.
Or make sure each such item has a default receipt and issue location
Thanks, saved my and my customers time.
Any chance that you have a rendition of this code fixed up for AX 2012?
Yes I have:
...
if (salesTableLocal.InterCompanyDirectDelivery
&& SalesTableType::construct(salesTableLocal).canCreatePurchOrder()
&& VendTable::find(tmpPurchLinePrice.AccountNum).interCompanyTradingRelationActive())
{
inventDimGroupSetup = InventDimGroupSetup::newItemId(salesLineLocal.ItemId);
// BEGIN
// inventDimGroupFieldSetup = inventDimGroupSetup.getFieldSetup(fieldnum(InventDim, wmsLocationId));
// if (inventDimGroupFieldSetup.isActive() && (!inventDimGroupFieldSetup.isAllowBlankIssueEnabled() || !inventDimGroupFieldSetup.isAllowBlankReceiptEnabled()))
// {
// throw error(strfmt("@SYS99182",salesLineLocal.ItemId));
// }
// END
inventDimGroupFieldSetup = inventDimGroupSetup.getFieldSetup(fieldnum(InventDim, wmsPalletId));
if (inventDimGroupFieldSetup.isActive() && (!inventDimGroupFieldSetup.isAllowBlankIssueEnabled() || !inventDimGroupFieldSetup.isAllowBlankReceiptEnabled()))
{
throw error(strfmt("@SYS99182",salesLineLocal.ItemId));
}
}
tplP.clear();
...
Post a Comment