分类 Dynamics 365 下的文章

For paging in X++ Query. There are three steps required. Rest of Query Code is same.

We have to set following things in Query data source

Set Sort field in Query data Source.
Paging position property of QueryRun is set to true.
Add page range with starting position and number of records in QueryRun
Here is code snippet

QueryBuildRange qbr,qbrStartDate,qbrEndDate; QueryBuildDataSource qbd; IAPageSize EnumPageSize; QueryRun qr; Query query = new Query(); Int pageSize = 2; qbd = query.addDataSource(TableNum(ProjPlanVersion)); qbd.addOrderByField(fieldNum(ProjPlanVersion,HierarchyId)); qr = new QueryRun(query); qr.enablePositionPaging(true); CurrentPageNumber =1; startingposition = CurrentPageNumber * pagesize; qr.addPageRange(startingposition, totalRows); while(qr.next()) { Info (“”); }

http://axhelper.com/?p=33322

SecurityUserRole securityUserRole;
SecurityRolePrivilegeExplodedGraph securityRolePrivilegeExplodedGraph;
SecurityPrivilege securityPrivilege;
select firstonly securityUserRole

join securityRolePrivilegeExplodedGraph
    where securityRolePrivilegeExplodedGraph.SecurityRole == securityUserRole.SecurityRole
join securityPrivilege
    where securityPrivilege.RecID == securityRolePrivilegeExplodedGraph.SecurityPrivilege
    && securityUserRole.User == curUserId()
    && securityPrivilege.Identifier == “”

修改 C:\AOSService\webroot 以下文件节点(如域不变仅更改1),然后重启IIS,不要编译/同步数据库,
记得备份原配置文件!!!!.

  1. web.config

    • DataAccess.Database
    • DataAccess.DbServer
    • DataAccess.SqlUser
    • DataAccess.SqlPwd
  2. wif.config

    • audienceUris.add ,值修改为 spn:环境ID;
  3. wif.serveices.config

    wsFederation节点属性

    catch(Exception::CLRError)
    {
        System.Exception    interopException = CLRInterop::getLastException();

        obj.Add("Code", 1);
        obj.Add("Message", interopException.Message.ToString());

    }
    catch
    {
        SysInfoLogEnumerator    infoLogEnum;
        str                     Message;

        infoLogEnum = SysInfoLogEnumerator::newData(infolog.copy(1, infologLine()));

        while(infoLogEnum.moveNext())
        {
            Message += infoLogEnum.currentMessage();
        }

        obj.Add("Code", 1);
        obj.Add("Message", Message);
    }