Skip to main content

Record level Security Ax 2012


RECORD LEVEL SECURITY IN AX 2012

In this blog we will discuss record level security in Ax 2012. Record level security includes Query, Constrained table, Security policy, Temp table (Optional).  


  1. Create a query That will be used to restrict data access from the Constraint table.

  2. Right-click Data Sources, and the select New Data Source.

  3. In the Table field, enter the primary table name CustGroup.

  4. Right-click Ranges, and then select New Range.

  5. Set the Enabled field to Yes.

  6. In the Data Source field, enter the primary table name, in this case, ‘CustGroup’.

  7. In the Value field, enter 10 to restrict access to data where CustGroup has value of 10, by defining the Range for the CustGroup field.

    In the Value field, enter 10.

Add a new security policy

  1. Add a new security policy. 

  2. Set Constrained Table to Yes. This will also secure access to the primary table. In this example this is the CustGroup table.

  3. Set the Context Type field to RoleName.

  4. Set the Enabled field to Yes.

  5. Set the Operation field to AllOperations. Other available values for Operation include SelectInsertUpdateDelete, and InsertUpdateDelete.

  6. Set Primary Table field to CustGroup.

  7. Set the Query field to the name of the query created above, for example ‘XDSQCustGroup10’.

  8. Set the Role Name field to ‘TradeSalesClerk’. Because Context Type is set to RoleName for this policy, it is required to enter the AOT name for a user role.

    In the Role Name field, enter TradeSalesClerk.

  9. Next, add constrained tables. In this simple example add one table.

    Add constrained tables.

    a. Right-click Constrained tables, and then select New > Constrained Table.

    b. Set Constrained to Yes.

    c. In the Name field, enter the Constrained table, for example ‘CustTable’.

    d. In the Table Relation field, enter the relationship to the primary table, in this case ‘CustGroup’.

  10. As a final step, it is required that you build and synchronize the solution to activate the policy.






  HEY HEY HEY!!!! HACK OF THE DAY
TEMP TABLE USAGE IS OPTIONAL DEPENDING UPON REQUIREMENT AND MAKE SURE TO ALLOCATE CORRECT USER. MOREOVER CONTEXT STRING CAN ALSO BE USED 

Comments

Popular posts from this blog

Edit Method on Form

Edit Method D365 for a form Data Source 1. To create an edit method first create a controller class. with following properties  public static edit MainAccountNum LedgerJournalTransLedger(LedgerJournalTrans _ledgerjournal, boolean _set, MainAccountNum _id) { MainAccountNum accountId = _id; MainAccount mainAccount = MainAccount::findByMainAccountId(_id); if(_set) { if(_ledgerjournal.AccountType== LedgerJournalACType::Ledger) { mainAccount = MainAccount::findByMainAccountId(accountId); if(_ledgerjournal.LedgerDimension) { DimensionDefault defaultDim = LedgerDimensionFacade::getDefaultDimensionFromLedgerDimension(_ledgerjournal.LedgerDimension); _ledgerjournal.LedgerDimension = LedgerDimensionDefaultingEngine::getLedgerDimensionFromAccountAndDim(mainAccount.RecId, DimensionHierarchy::getAccountStructure(mainAccount.RecId), defaultDim); } else { _ledgerjournal.LedgerDimension = LedgerDimensionDefaultingEngine::getLedgerDimensionFromAccountAndDim(mainAccount.RecId, DimensionHierarchy::ge...

Lookup and Mandatory fields on Form using Form event Handlers D365

Lookup and Mandatory fields on Form using Form event Handlers D365 [FormControlEventHandler(formControlStr(VendBankAccounts, VendBankAccount_SLD_BankCode), FormControlEventType::Lookup)] public static void VendBankAccount_SLD_BankCode_OnLookup(FormControl sender, FormControlEventArgs e)     {         Query query = new Query();         QueryBuildDataSource queryBuildDataSource;         FormControlCancelableSuperEventArgs event = e as FormControlCancelableSuperEventArgs;         QueryBuildRange queryBuildRange;         SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(SLD_BankCodes), sender);         sysTableLookup.addSelectionField(fieldNum(SLD_BankCodes, BankCodes));         sysTableLookup.addLookupField(fieldNum(SLD_BankCodes, BankCodes));         sysTableLookup.addLookupField(fieldNum(SLD_BankCode...

Field Level Security In Ax 2012

FIELD LEVEL SECURITY IN AX 2012 In this blog we will discuss field level security applied in  Ax 2012. 1. Field level security is added on form level as well in Ax 2012 its bit different then field level security in D365 2. This also requires privileges to be applied on form specific fields only. Step #1 :  Change datasource property of the field which need to be added in security. Step #2 : Now add these 2 fields in form --- > permissions --- > Read Step #3 : Now finally create privilege and add these fields explicitly in it.       HEY HEY HEY !!!! HACK OF THE DAY  Add Fields in Entry point privilege section of form  Explicitly.