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

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

04 March 2013

Word file generation fails from within Dynamics AX

Problem description: Word file generation fails

Upon generating a MS Word file from within Dynamics AX some cryptic error message is thrown like Method add in COM-object of class Documents returns error code 0x800A1436.

Solution

In MS Word go to Options > Trust Center > Trust Center Settings > Protected View and uncheck Enable Protected View for files originating from the Internet.


Continue reading......

by Patrik Luca 0 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