My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).

09 August 2011

Intercompany with direct delivery and WMS setup

by Patrik Luca 3 comments

Tag



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



Comments 3 comments
Anonymous said...

Thanks, saved my and my customers time.

Unknown said...

Any chance that you have a rendition of this code fixed up for AX 2012?

Patrik Luca said...

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();
...

Patrik Luca, Ieper, BELGIUM
Feel free to use or spread all of the content on my blog. In return, linking back to my blog would be greatly appreciated. All my posts and articles are provided "AS IS" with no warranties.

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Most Read Entries

Subscribe feeds rss Recent Entries

Categories

Recommended Books


Subscribe feeds rss Recent Comments

This Blog is part of the U Comment I Follow movement in blogosphere. Means the comment field of this blog is made DOFOLLOW. Spam wont be tolerated.

Blog Archive

My Blog List

Followers

Links