My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).
Showing posts with label Intercompany. Show all posts
Showing posts with label Intercompany. Show all posts

25 March 2013

Add fields for intercompany synchronization

Business requirement: add fields for intercompany synchronization

If you need to synch additional sales line fields upon activation of the intercompany chain, some code modifications have to been executed. In this example the Customer Reference on the salesline needed to be synchronized.(field CustomerRef). End users had to be able to input a different customer reference line by line, not one general customer reference for the sales order as a whole.

Solution: X++ modifications

First of all the field CustomerRef should be set to visible on the salesline, so end users can modify it. The field is already available in the AOT on the SalesLine table, it is only not visible in the form.

Next, modify the method interCompanyUpdateNow on the PurchLine table: add some code for the new field to be synchronized.

...
|| this.orig().ReturnDispositionCodeId
!= this.ReturnDispositionCodeId
|| this.orig().ReturnStatus
!= this.ReturnStatus
|| this.orig().MatchingAgreementLine
!= this.MatchingAgreementLine
// BEGIN
|| this.orig().CustomerRef
!= this.CustomerRef
// END
)
{
ok = true;
}
...

Add a new parm method to the class AxPurchLine for the new field to be synchronized.


public CustRefLine parmCustRefLine(CustRefLine
_custRefLine = '')
{
if (!prmisDefault(_custRefLine))
{
this.setField(fieldNum(PurchLine, CustomerRef),
_custRefLine);
}

return purchLine.CustomerRef;
}

Add a new parm method to the class AxSalesLine for the new field to be synchronized.


public CustRefLine parmCustRefLine(CustRefLine
_custRefLine = '')
{
if (!prmisDefault(_custRefLine))
{
this.setField(fieldNum(SalesLine, CustomerRef),
_custRefLine);
}

return salesLine.CustomerRef;
}

Modify the interCompanyMirror method of class PurchLineType so the new field gets synchronized upon creation of changing the purchline.

...
// BEGIN
if (create || purchLine.fieldChanged(fieldNum(PurchLine,
CustomerRef)))
axSalesLine.aduParmCustRefLine(purchLine.CustomerRef);
// END
...

Modify the syncPurchLine method of class SalesLineType so the new field gets synchronized upon creation of changing the salesline.

...
// BEGIN
if (create
|| _salesLine.fieldChanged(fieldNum(SalesLine,
CustomerRef)))
axPurchLine.aduParmCustRefLine(_salesLine.CustomerRef);
// END
...


Continue reading......

by Patrik Luca 3 comments

13 January 2012

Intercompany timesheets

Finally, entering  hours on a project in another legal entity will become possible in Dynamics AX 2012, according to a Technet article.

I haven’t tried it yet, but it sounds great:

The intercompany timesheet feature in Microsoft Dynamics AX makes it possible for a worker who is employed by one legal entity to enter timesheet hours for work performed on projects in a different legal entity, without having to be employed by the legal entity that is managing the project.

The legal entity that employs the worker is called the loaning legal entity. The legal entity that manages the project for which the worker contributes hours is called the borrowing legal entity.

In addition to a cost price, which the loaning legal entity incurs by using the worker, and the sales price, which the customer pays the borrowing legal entity, the intercompany timesheet feature includes a transfer price, which is the amount that the borrowing legal entity pays to the loaning legal entity for the use of its worker.


Continue reading......

by Patrik Luca 3 comments

09 August 2011

Intercompany with direct delivery and WMS setup

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




Continue reading......

by Patrik Luca 3 comments

02 November 2010

Creation of Intercompany Purchase order for a project item requirement

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:

  1. Create an item requirement on a project.
  2. Click Functions > Create purchase order.
  3. 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.



Continue reading......

by Patrik Luca 1 comments

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

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