• AX2012 常用表关系(客户地址,联系信息)



    //
    客户地址信息 static void CustAddressInformation(Args _args) { CustTable custTable; DirPartyTable dirPartyTable; DirPartyLocation dirPartyLocation; LogisticsLocation logisticsLocation; LogisticsPostalAddress logisticsPostalAddress; TransDate dateFrom,dateTo; ; dateFrom = dateNull(); dateTo = dateMax(); while select validTimeState(dateFrom,dateTo) custTable where custTable.AccountNum == 'US-027' join dirPartyTable where dirPartyTable.RecId == custTable.Party join dirPartyLocation where dirPartyLocation.Party == dirPartyTable.RecId join logisticsLocation where logisticsLocation.RecId == dirPartyLocation.Location join logisticsPostalAddress where logisticsPostalAddress.Location == logisticsLocation.RecId { print strFmt("ACC:%1,ADD:%2,DES:%3",custTable.AccountNum,logisticsPostalAddress.Address,logisticsLocation.Description); } pause; /* SELECT C.ACCOUNTNUM,LP.ADDRESS AS 'Address',L.DESCRIPTION,lp.RECID,c.RECID FROM CUSTTABLE C JOIN DIRPARTYTABLE D ON D.RECID = C.PARTY JOIN DIRPARTYLOCATION DL ON DL.PARTY = D.RECID JOIN LOGISTICSLOCATION L ON L.RECID = DL.LOCATION JOIN LOGISTICSPOSTALADDRESS LP ON LP.LOCATION = L.RECID WHERE C.DATAAREAID ='LYDI' AND C.ACCOUNTNUM ='US-027' AND LP.VALIDFROM > '2013/4/1' */ }

    客户联系信息
    //客户联系信息
    static void CustContuctInformation(Args _args)
    {
        CustTable                   custTable;
        DirPartyTable               dirPartyTable;
        ContactPerson               contactPerson;
        DirPerson                   dirPerson;
        DirPersonName               dirPersonName;
        LogisticsElectronicAddress  logisticsElectronicAddress;  
        DirPartyLocation            dirPartyLocation;
        LogisticsLocation           logisticsLocation;
        LogisticsPostalAddress      logisticsPostalAddress;
        TransDate                   dateFrom,dateTo;
        ;
        //Email
        select * from custTable
            join dirPartyTable
                where dirPartyTable.RecId == custTable.Party
                join logisticsElectronicAddress
                    where logisticsElectronicAddress.RecId == dirPartyTable.PrimaryContactEmail;
        //Email
        select * from custTable
            join dirPartyTable
                where dirPartyTable.RecId == custTable.Party
                join logisticsElectronicAddress
                    where logisticsElectronicAddress.RecId == dirPartyTable.PrimaryContactEmail;
        //Phone
        select * from custTable
            join dirPartyTable
                where dirPartyTable.RecId == custTable.Party
                join logisticsElectronicAddress
                    where logisticsElectronicAddress.RecId == dirPartyTable.PrimaryContactPhone;
        //URL
        select * from custTable
            join dirPartyTable
                where dirPartyTable.RecId == custTable.Party
                join logisticsElectronicAddress
                    where logisticsElectronicAddress.RecId == dirPartyTable.PrimaryContactURL;
        //Telex
        select * from custTable
            join dirPartyTable
                where dirPartyTable.RecId == custTable.Party
                join logisticsElectronicAddress
                    where logisticsElectronicAddress.RecId == dirPartyTable.PrimaryContactTelex;
        //Fax
        select * from custTable
            join dirPartyTable
                where dirPartyTable.RecId == custTable.Party
                join logisticsElectronicAddress
                    where logisticsElectronicAddress.RecId == dirPartyTable.PrimaryContactFax;
        
        //ContactPerson information
        select validTimeState(dateFrom,dateTo) custTable
            where custTable.AccountNum == 'US-027'
            join contactPerson
                where contactPerson.CustAccount == custTable.AccountNum
                join dirPartyTable 
                    where dirPartyTable.RecId == contactPerson.Party
                    join dirPerson
                        where dirPerson.RecId == dirPartyTable.RecId
                        join dirPersonName
                            where dirPersonName.Person == dirPerson.RecId
                    join dirPartyLocation
                        where dirPartyLocation.Party == dirPartyTable.RecId
                        join logisticsLocation
                            where logisticsLocation.RecId == dirPartyLocation.Location
                            join logisticsPostalAddress
                                where logisticsPostalAddress.Location == logisticsLocation.RecId;
        /*
        SELECT C.ACCOUNTNUM,C.DATAAREAID,L.LOCATOR,L.DESCRIPTION FROM CUSTTABLE C
        JOIN DIRPARTYTABLE D ON D.RECID = C.PARTY
        JOIN LOGISTICSELECTRONICADDRESS L ON (L.RECID = D.PRIMARYCONTACTPHONE OR L.RECID = D.PRIMARYCONTACTFAX)
        WHERE C.DATAAREAID ='LYDI' AND C.ACCOUNTNUM ='US-027'
        */
    }
    
    
    
    
  • 相关阅读:
    吴裕雄--天生自然JAVA开发JSP-SERVLET学习笔记:解决启动TOMCAT服务器乱码问题
    吴裕雄--天生自然JAVA开发JSP-SERVLET学习笔记:配置TOMCAT服务器
    吴裕雄--天生自然JAVA开发JSP-SERVLET学习笔记:修改服务器端口
    吴裕雄--天生自然JAVA开发JSP-SERVLET学习笔记:解决服务端口8080被占用的问题
    css 背景色渐变---和背景色透明
    nodePPT 这可能是迄今为止最好的网页版PPT
    正则表达式匹配
    WdatePicker.js 日历点击时,触发自定义方法 ,可以调用自己的函数。
    html 实时监控发送数据
    [转]使用onclick跳转到其他页面/跳转到指定url
  • 原文地址:https://www.cnblogs.com/dingkui/p/4446978.html
Copyright © 2020-2023  润新知