My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).
Hi!
Welcome on my blog.
I am Patrik Luca.
I am living in Ieper (Belgium) with my wife and lovely daughters.
I try to provide you with some tech information through my blog posts here.
Thanks for reading.


02 April 2013

Links List March 2013

I decided to share all my interesting reads and resources month by month with my blog readers. You can find these posts by searching on the label Links. I'll try to order the resources in logical categories. If you would like to see some interesting stuff added in the next month, don't hesitate to post a comment.

So this is my Links post for March 2013.

Dynamics AX

Supply Chain Management


Continue reading......

by Patrik Luca 0 comments

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 0 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

28 February 2013

About setting up case e-mail templates

Introduction

To set up a case e-mail template, first you create a template and then you open the e-mail editor to set up the predefined contents of e-mail messages that are based on the template.

The predefined contents consist of merge data and links that can be inserted in the template.

The merge data is a set of data that provides details on the case in the e-mail message.

Merge-data overview

The following merge-data elements can be added in the e-mail template. The merge-data elements can be used to inform the user about various aspects of the case.

HTML merge-data element Information displayed in e-mail message
%CaseId% The identification number assigned to the case
%CaseDescription% A description of the case
%CaseSourceName% The name of the party record that the case is created for
%CaseMemo% Additional notes about the selected  case

 

Link the e-mail template to the case category

 

Start sending mails from your Cases, some data of the case will be merged into the generated e-mail message.


Continue reading......

by Patrik Luca 0 comments

30 January 2013

Wrong email displayed for alert rules in Dynamics AX 2009

Problem description

When creating or modifying alert rules, the e-mail shows always the email
of the current user, in stead of the email of the user for whom the alert rule
is valid. This problem is fixed in Dynamics AX 2012.

Solution

Some X++ modifications are needed in two Forms.

Form EventCreateRule, method modified on Field EventRule.UserId:

public void modified()
{
super();

// BEGIN
eventRule_SendEmailAddress.text(
SysUserInfo::find(EventRule.UserId).Email);
// END
}


Form EventRule, method setControlsActive on DataSource EventRule:



...
else if (!canShowPopUpCheckBox)
{
alertMeBy.visible(true);
eventRule_ShowPopUp.visible(false);
eventRule_SendEmail.visible(true);
eventRule_SendEmailAddress.visible(true);
// BEGIN
//eventRule_SendEmailAddress.text(userInfo.Email);
eventRule_SendEmailAddress.text(
SysUserInfo::find(EventRule.UserId).Email);
// END
}
else
{
alertMeBy.visible(true);
eventRule_ShowPopUp.visible(true);
eventRule_SendEmail.visible(true);
eventRule_SendEmailAddress.visible(true);
// BEGIN
//eventRule_SendEmailAddress.text(userInfo.Email);
eventRule_SendEmailAddress.text(
SysUserInfo::find(EventRule.UserId).Email);
// END
}

if (eventRule.UserId == curuserid())
eventInboxSingleton.enabled(true);
...


Continue reading......

by Patrik Luca 0 comments

23 January 2013

Find method on Temporary tables

Problem: find method not returning rows on a temporary table

Temporary table variables are always newly created, so a static find table method should be written differently compared to regular tables.

Solution

To make your find method work, you need to pass through the reference to the temporary table.

public static TmpAvgCubicMeterPrices find(
ProjId _projId,
InventDimCombinationName _inventDimCombinationName,
TmpAvgCubicMeterPrices _tmpAvgCubicMeterPrices,
boolean _forUpdate = false)
{
TmpAvgCubicMeterPrices tmpAvgCubicMeterPrices;
;

tmpAvgCubicMeterPrices.setTmpData(
_tmpAvgCubicMeterPrices);

tmpAvgCubicMeterPrices.selectForUpdate(_forUpdate);

select firstonly tmpAvgCubicMeterPrices
where tmpAvgCubicMeterPrices.ProjId
== _projId
&& tmpAvgCubicMeterPrices.InventDimCombinationName
== _inventDimCombinationName;


return tmpAvgCubicMeterPrices;
}


Continue reading......

by Patrik Luca 0 comments

11 October 2012

Unwanted changecompany due to refresh SysOperationProgress class

Problem: unexpected changecompany

I was faced with a problem in Dynamics AX 2012, where sometimes an unexpected changecompany happened in a process. Sometimes it occurred, sometimes it didn’t, making it difficult to simulate it.

Solution

The cause of the problem was the SysOperationProgress class. This class can be used to inform the user about status, operation and progress of the system. It was initiated before my changecompany call and closed after it. When the progress bar created by the SysOperationProgress class was refreshed during code execution within my changecompany class, a call is done by X++ to the Docu class. This triggers also a changecompany due my original legal entity. Hence some of my code within my changecompany call was executed in the company to which I did the change, some was done in the company I originated from. And this not all of the time, as it only happened if a refresh happened of my progress bar within the changecompany call. I removed the SysOperationProgress and my problem was solved.


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.

Live Traffic Feed

Recent Visitors

Blog Archive

My Blog List

Followers

Guest Links