Thursday, September 3, 2015

How to assign read only access to user in AX 2012

Recently in our project there is a requirement - need to assign the read only access to one of the AX User.
So searching in the AX community for this if any one has implemented similar functionality,finally found the article.
Below is the link.

Followed the step by step mentioned in the above article and achieved the read only access for the AX user.
Here wanted to add one more point, i.e. in the above article it filters all the *Inquire, *Review for the 'SysModelElement' and SecurityDuty for the 'SysModelElementType'.

In customization, if created new forms/classes/reports and added those new forms/classes/reports in new 'Duties', so in this case these also needs to be included in the 'Role' which created by using the steps mentioned from the above articles. So those objects also will have the 'View' permissions for the AX user.

Tuesday, August 11, 2015

DAX to the Future: Filtering Data using Dynamic Ranges

DAX to the Future: Filtering Data using Dynamic Ranges: DAX contains some powerful features for filtering data on forms and reports that are easily accessible to end-users, however it’s more power...

Sunday, March 22, 2015

Outbound file generation using File system adapater in AX 2012

Hi All,

Here is example to generate the outbound Xml file using X++ code. This is not the new thing but just posting the info

1. Generating the outbound xml file for selected record or single record - using document service(file system adapter).
2. Generating the outbound xml file for all records( i.e. specified criteria on the query) - using document service(file system adapter).

Example: Generating the outbound xml file for selected record or single record.
Below is the code to generate the outbound xml file for the selected record.
static void GenerateXmlSelectedRecord(Args _args)
    AxdSendContext      axdSendContext  = AxdSendContext::construct();
    AifEntityKey        aifEntityKey    = AifEntityKey::construct();
    AifEntityKeyList    aifEntityKeyList = AifEntityKeyList::construct();
    Map                 keyData;
    AifConstraintList   aifConstraintList   = new AifConstraintList();
    AifConstraint       aifConstraint       = new AifConstraint();
    CustTable           custTable;
    int i,j;
    CustCustomerService CustCustomerService = CustCustomerService::construct();
    custTable = CustTable::find('Cust001');

    keyData = SysDictTable::getKeyData(custTable);



    aifConstraint.parmType(AifConstraintType::NoConstraint) ;
    aifConstraintList.addConstraint(aifConstraint) ;

    AifSendService::SubmitDefault(  classnum(CustCustomerService),

Example: Generating the outbound xml file for all records( i.e. specified criteria on the query).
Below is the code to generate the outbound xml for all the records or specified criteria.

static void GenerateMutiplerecords(Args _args)
    CustTable           custTable;
    AxdSendContext      axdSendContext      = AxdSendContext::construct();
    AifEntityKey        aifEntityKey        = AifEntityKey::construct();
    AifConstraintList   aifConstraintList   = new AifConstraintList();
    AifConstraint       aifConstraint       = new AifConstraint();
    AifEndpointList     endpointList;
    AifActionId         actionId;
    Query               query;
    QueryBuildDataSource    qbds;

    query               = new Query(queryStr(AxdCustomer));

    actionId            = AifSendService::getDefaultSendAction(classnum(CustCustomerService), AifSendActionType::SendByQuery);
    aifConstraintList.addConstraint(aifConstraint) ;
    endpointList        = AifSendService::getEligibleEndpoints(actionId, aifConstraintList);


Wednesday, February 18, 2015

How to find the nth record using the query(qr.addPageRange(postion,postion))

Hi All,

Below is the example of how to find the nth record position using query

static void nthrecordPos(Args _args)
    Query                   q;
    QueryBuildDataSource    qbds;
    QueryRun                qr;
    PurchTable              purchTable;
    q = new Query();
    qbds= q.addDataSource(tableNum(PurchTable));
    qbds.addOrderByField(fieldNum(PurchTable, PurchId));
    qr = new QueryRun(q);
    while ( )
        purchTable = qr.get(tablenum(PurchTable));
        info(strfmt("%1", purchTable.RecId));

Let say in the purchTable having 100 records, wanted to find the 10 to12 th record, by using the "qr.addPageRange(10,12)", it fetches on the 10th, 11th and 12th records.