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

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

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