//客户地址信息
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'
*/
}



AX2012 常用表关系(客户地址,联系信息)的更多相关文章

  1. Django入门--模型系统(二):常用查询及表关系的实现

    1.常用查询 模型类上的管理器: ** 模型类.objects ** (1)常用一般查询 rs = Student.objects.all() # 查询所有记录,返回Queryset print(rs ...

  2. 八.django模型系统(二)之常用查询及表关系的实现

    Ⅰ.常用查询  1.几个概念 每一个django模型类,都有一个默认的管理器,objects,查询就是依赖于objects管理器进行的(在创建时就被添加了). QuerySet表示数据库中对象的列表( ...

  3. Django——7 常用的查询 常用的模型字段类型 Field的常用参数 表关系的实现

    Django 常用的查询 常用的查询方法 常用的查询条件 常用字段映射关系 Field常用参数 表关系的实现 查用的查询方法 这是需要用到的数据 from django.http import Htt ...

  4. EBS常用表_Dictionary

    EBS常用表:转载于 https://blog.csdn.net/xiariqingcao/article/details/8775827 . OU.库存组织 SELECT hou.organizat ...

  5. (转载整理)SAP ERP常用表

    abap 常用表 GL部分:FAGLFLEXT(FMGLFLEXT)   新总账汇总表 GLT0        旧总帐汇总表           SKA1        总账科目主记录 (科目表)   ...

  6. 获得Unix/Linux系统中的IP、MAC地址等信息

    获得Unix/Linux系统中的IP.MAC地址等信息 中高级  |  2010-07-13 16:03  |  分类:①C语言. Unix/Linux. 网络编程 ②手册  |  4,471 次阅读 ...

  7. ORACLE EBS常用表及查询语句(最终整理版)

    建议去看参考二 参考一:                                                              call fnd_global.APPS_INITI ...

  8. Oracle EBS BOM模块常用表结构

    表名: bom.bom_bill_of_materials  说明: BOM清单父项目  BILL_SEQUENCE_ID NUMBER 清单序号(关键字)ASSEMBLY_ITEM_ID NUMBE ...

  9. ORACLE中dba,user,v$等开头的常用表和视图

    一.Oracle表明细及说明1.dba_开头表    dba_users           数据库用户信息    dba_segments    表段信息    dba_extents        ...

随机推荐

  1. fifo write

    #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types. ...

  2. A web crawler design for data mining

    Abstract The content of the web has increasingly become a focus for academic research. Computer prog ...

  3. Python开发入门与实战12-业务逻辑层

    12. Biz业务层 前面的章节我们把大量的业务函数都放在了views.py里,按照目前这一的写法,当我们编写的系统复杂较高时,我们的views.py将会越来越复杂,大量的业务函数包含其中使其成为一个 ...

  4. ubuntu频繁掉线 转

    好长好长时间没来百度空间了,最近闲来无事,正好弥补之前的空缺了!跟Ubuntu打交道已有很长一段时间了,期间遇到了很多问题,我把遇到的一些问题及找到的解决方案记录下来,我想这可能会对那些跟我有同样境遇 ...

  5. 利用ClouderaManager启动HBase时,出现 master.TableNamespaceManager: Namespace table not found. Creating...

    1.错误描述: 出现上述这个错误的原因是我之前已经安装了Cloudera Manager中的CDH,其中添加了所有的服务,当然也包含HBase.然后重新安装的时候,就会出现如下错误: Failed t ...

  6. Jdk内置性能测试工具的介绍

    (一) JConsole JConsole使用JVM的可扩展性Java管理扩展(JMX)工具来提供关于运行于Java平台的应用程序的性能和资源消耗的信息. 在J2SE 5.0软件中,你需要启动使用-D ...

  7. SVN 文件解锁

    之前一直一个人用svn,后来团队扩编,同事使用svn下载项目后.我却无法提交了,出现以下错误: locked in another working copy No lock on path (Stat ...

  8. cut - 小巧的文本截取工具

    简介 cut命令是Unix下的一个命令行程序.cut命令是以行为单位来处理的.cut命令处理的是标准输入,所以可以结合管道来进行文本的处理. 命令格式 cut option… [file]… cut命 ...

  9. Charles初体验

      背景: 谈起HTTP调试代理工具, 很多人第一反应就会提到Fiddler. 可惜Fiddler由C#编写, 对Mac电脑的支持并不友好(存在Mac版Fiddler--mono fiddler, 不 ...

  10. 2015GitWebRTC编译实录16

    新问题,看应该是视频编解码那里出问题了.找找看.WebRtc VoiceEngine codecs:ISAC/16000/1 (103)ISAC/32000/1 (104)Unexpected cod ...