Restrict User roles to view only few status from the drop down box

Hi,

Happy New Year!!

I am working on security change for my client to view few status from drop down box.

Let me explain my request in detail. Need to restrict/hide statuses like Approved, Rejected, Revoked and Terminated from Certification status drop down box for specific role in AX2012 R3 Human resources module.

It would be great if some one can help me out with the resolution steps. Thanks in advance.

Thanks,

Maru

Use lookup for Certification status field. Modify below code as per your requirement.

Hope this will help you.

public void lookup()
{
CustTable CuatTable;
SysTableLookup SysTableLookup = SysTableLookup::newParameters(tablenum(CustTable),this);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource = query.addDataSource(tablenum(CustTable));
;

//super();
sysTableLookup.addLookupfield(fieldnum(CustTable,AccountNum));
sysTableLookup.addLookupfield(fieldnum(CustTable,Name));
queryBuildDataSource.addRange(fieldnum(CustTable,AccountNum)).value(“F000000011,F000000013”);

sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}

Where exactly is the value you want to restrict? “In Human resources module” isn’t very specific and I don’t know the module well enough to be able to iterate all places with “certification status”.

Hi Martin,

I want to restrict this in Certifications form in Human resource module. This restriction is only for specific role. Please let me know if you need more information. Thanks!

-Maruthi

Hi Amol,

Thanks a lot for your response. I wanted to restrict certification status drop down list for specific role. If I write a lookup method will effect to everyone right or correct me if I am wrong. Thanks!!

-Maruthi

Hi ,

Can you try defining XDS policy for the role. You can specify the values in the range in the query.

Hi Anitha,

Thanks for your response. My client not interested in using XDS policy. Is there something we can restrict it using code, please do let me know.

Hi Maruthi,

You can restrict it at user group level.

Below piece of code is helpful for you. Write it in my above post i.e. in lookup method.

UserGroupList _UserGroupList
;

while select _UserGroupList where _UserGroupList.userId == CurUserId()
{
if(_UserGroupList.groupId like “UserGroupName”)
{
//add above post’s code here
break;
}
}

Post is from AX 2009.