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;
;
select * from custTable
join dirPartyTable
where dirPartyTable.RecId == custTable.Party
join logisticsElectronicAddress
where logisticsElectronicAddress.RecId == dirPartyTable.PrimaryContactEmail;
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 常用表关系(客户地址,联系信息)的更多相关文章
- Django入门--模型系统(二):常用查询及表关系的实现
1.常用查询 模型类上的管理器: ** 模型类.objects ** (1)常用一般查询 rs = Student.objects.all() # 查询所有记录,返回Queryset print(rs ...
- 八.django模型系统(二)之常用查询及表关系的实现
Ⅰ.常用查询 1.几个概念 每一个django模型类,都有一个默认的管理器,objects,查询就是依赖于objects管理器进行的(在创建时就被添加了). QuerySet表示数据库中对象的列表( ...
- Django——7 常用的查询 常用的模型字段类型 Field的常用参数 表关系的实现
Django 常用的查询 常用的查询方法 常用的查询条件 常用字段映射关系 Field常用参数 表关系的实现 查用的查询方法 这是需要用到的数据 from django.http import Htt ...
- EBS常用表_Dictionary
EBS常用表:转载于 https://blog.csdn.net/xiariqingcao/article/details/8775827 . OU.库存组织 SELECT hou.organizat ...
- (转载整理)SAP ERP常用表
abap 常用表 GL部分:FAGLFLEXT(FMGLFLEXT) 新总账汇总表 GLT0 旧总帐汇总表 SKA1 总账科目主记录 (科目表) ...
- 获得Unix/Linux系统中的IP、MAC地址等信息
获得Unix/Linux系统中的IP.MAC地址等信息 中高级 | 2010-07-13 16:03 | 分类:①C语言. Unix/Linux. 网络编程 ②手册 | 4,471 次阅读 ...
- ORACLE EBS常用表及查询语句(最终整理版)
建议去看参考二 参考一: call fnd_global.APPS_INITI ...
- Oracle EBS BOM模块常用表结构
表名: bom.bom_bill_of_materials 说明: BOM清单父项目 BILL_SEQUENCE_ID NUMBER 清单序号(关键字)ASSEMBLY_ITEM_ID NUMBE ...
- ORACLE中dba,user,v$等开头的常用表和视图
一.Oracle表明细及说明1.dba_开头表 dba_users 数据库用户信息 dba_segments 表段信息 dba_extents ...
随机推荐
- jquery替换URL参数值
由于经常会用到替换URL参数值,而网上写的方法代码都太长了,所以在这里写了一个简单的方法,供大家使用. 说明: reLoad(参数名,参数值) function reLoad(p, v) { var ...
- JVM-程序编译与代码晚期(运行期)优化
晚期(运行期)优化 1.为了提高热点代码的执行效率,在运行时,虚拟机将会把这些代码编译成与本地平台相关的机器码,并进行各种层次的优化,完成这个任务的编译器称为即时编译器(Just In Time,JI ...
- Android 布局优化
转载自stormzhang的博客:http://stormzhang.com/android/2014/04/10/android-optimize-layout/ < include /> ...
- windows下安装RabbitMq-Service
一.RaibbitMQ服务器配置 1. 准备工作.如果之前安装过RabbitMQ软件,若想重新安装,必须先把之前的RabbitMQ相关软件卸载. 2. 安装ERLANG语言包.首先到http://ww ...
- F - To the Max
Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous s ...
- ajax-1:基本实现原理
一.什么是Ajax? Asynchronous JavaScript and XML(异步JavaScript和XML) 二.实现步骤 3.Open方法 三个参数的含义 1.提交方式 Form-met ...
- ipython
ipython 是一个 python 的交互式 shell,比默认的python shell 好用得多,支持变量自动补全,自动缩进,支持 bash shell 命令,内置了许多很有用的功能和函数. T ...
- [poj 1502]昂贵的聘礼
一道不算太难的最短路喵~ 容我吐槽一下,酋长的地位居然不是最高的额——那你特么的居然还算是酋长?! 枚举一个地位区间 [i..i+M-1] 只要所有的交易者的地位都在该区间中,那么就不会引起冲突 而这 ...
- Jocket
https://docs.oracle.com/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/diagnosTOC.html https://blo ...
- ECShop函数列表大全
lib_time.php gmtime() P: 获得当前格林威治时间的时间戳 /$0 server_timezone() P: 获得服务器的时区 /$0 local_mktime(hour=NULL ...

