Tuesday, 24 January 2017

Enable or Disable Secuirty Policies in ax 2012 R2

Enable or Disable Secuirty Policies in ax 2012 R2

For my issues Security policies is working fine for all forms but particular transfer order form no need to work.

When i am getting the error while transfer items from one warehouse to another warehouse getting error.

I find the issues is InventSite table --> exist method.

So, i added below code for that.

static public boolean exist(InventSiteId  _inventSiteId)
{
    InventSite  inventSite;
    #define.InvalidContext('DisplayBrachData')
    boolean isFound;
    XDSServices xds = new XDSServices();
    // Disable the address book XDS by passing an invalid context string
    xds.setXDSState(0);
     select RecId from inventSite
                                 index SiteIdx
                                 where inventSite.SiteId == _inventSiteId;//.RecId != 0;
    isFound = _inventSiteId && (inventSite.RecId != 0);
    xds.setXDSState(1);
    return isFound;
}

No comments:

Post a Comment