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' */ }

分类:
AX 2012
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂