Saturday, October 31, 2015

AX 2012:Record level security (RLS)

Record level security in Dynamics AX


As user group permissions are responsible for setting up the security and information access in AX,
Record level security is another nice feature in AX system that restrict the records you can see in a table depending on record data.

As an example, there might be a situation where you would like to limit users in sales team to see their customers only,
or Purchase Orders created in one site should be accessed to some users and not to the other users.

RLS - Record level security can be used to restrict information shown on forms and reports. I've put together some steps to implement it.

1. Make sure you have the user group already created, to set RLS on.

2. Open up the RLS wizard from Administration - Setup- Security - Record Level Security

3. Select the User group you want to set RLS on.

4. Select the table and hit finish.

Now that you have the RLS enforced on the table, you can click Query option and specify list of fields on the Range tab
that you want to show on forms and repors for the selected user group.

AX 2012:info Log

The method setPrefix() will help you to group info(), warning() and error() messages with a header. using setPrefix() will make a indentation for your current block of code (everything between { and }). Leaving the code-block will automatically result in going one indentation back.

int i;
int j;
;
setPrefix("custom setPrefix");

for (i=1 ; i<=2 ; i++)
{
setPrefix(strfmt("Prefix %1", i));

for (j=1 ; j<=3 ; j++)
{
info(strfmt("Info %1", j));
}
}

try this on a job

Table browser URL in D365FO

Critical Thinking icon icon by Icons8