web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Modify headerTemplate comment in AX2012

Chaitanya Golla Profile Picture Chaitanya Golla 17,225

Hi,

If we want to modify the comment provided by headerTemplate (Path :Rt Click > Scripts > Documentation > HeaderTemplate) to any class/table method then we need to modify method documentation_HeaderTemplate of class EditorScripts.

In this example, I tried to add information to the remarks node like current user company, default project name, current user who developed/modified the code and time stamp when the change is made. User company and Project name are taken from User Options form(on Development tab page).

Path: \Classes\EditorScripts\documentation_HeaderTemplate.

        //
        // Insert remarks
        //

        //text += '/// <remarks>\n/// \n/// </remarks>\n'; // Comment default content
        select Name from userInfo
         where userInfo.Id == curUserId();
        
        codeRemarks = strFmt('    Created as part of project: %1 \n', userInfo.StartupProject);
        codeRemarks += strFmt('///     By %1 - %3 - %2', userInfo.Name, DateTimeUtil::getSystemDateTime(), userInfo.networkDomain);

        text += strFmt('/// <remarks>\n/// %1 \n/// </remarks>\n', codeRemarks);


Output:
EditorScripts.png
 

Comments

*This post is locked for comments