Business Requirement: go to other form
The Infolog System can be easily customized in Dynamics AX. You can attach actions to the displayed messages in the infolog. Upon double clicking the message you could for example go to another form, related to the displayed message. On MSDN, you can find some information about Using the Infolog System.
Solution: using the SysInfoAction_TableField class
Using the SysInfoAction_TableField class, you can easily add this functionality in your displayed messages. The job beneath shows first a normal information message. The second information message however can be double clicked by the end-user. Double cliking it will open the Customer form on the Customer determined in the X++ code. (in stead of double clicking, the end-user could aswell click the Show button in the Infolog).
static void customizeInfolog(Args _args)
{
CustTable custTable;
;
select firstOnly custTable
where custTable.AccountNum == "1301";
info(strFmt("Normal info message about customer %1"
,custTable.Name));
info(strFmt("Information message opening the CustTable "
+ "Form on customer %1 upon double clicking "
+ "the information message"
,custTable.Name)
,""
,SysInfoAction_TableField::newBuffer(custTable));
}
Great post.
thanks
Post a Comment