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 ...
随机推荐
- Java xml object 互转
public class ClassRoom { private int id; private String name; private int grade; public int getId() ...
- 在文章没有缩略图的时候,如何去掉织梦官方的 DEDECMS无缩略图 图片
1.打开 list_article.htm.2.替换代码 将 [field:array runphp='yes']@me = (empty(@me['litpic']) ? “<a href=’ ...
- JQuery源码解析(十)
默认回调对象设计 不传入任何参数,调用add的时候将函数add到内部的list中,调用fire的时候顺序触发list中的回调函数: function fn1(val) { console.log('f ...
- Insert Interval
在已经排好序的区间中,插入一个新的区间,与merge的做法类似 Given a set of non-overlapping intervals, insert a new interval into ...
- (实用篇)PHP中单引号与双引号的区别分析
在PHP中,我们可以使用单引号或者双引号来表示字符串.不过我们作为开发者,应该了解其中的区别.单引号与双引号对于定义字符一个是可以解析变量一个是会把变量直接输出来,同时单引号与双引号在字符处理上单引号 ...
- oracle不能删除,查看引用的外键
例如我在删除scorm_course_info表中的某条数据时,会报已经找到子目录的错误,说明有另外的表B的某列b1外键引用了它,找到表B的b1列,可以通过如下的sql: select b.table ...
- GCC中文手册
GCC 1 NAME gcc,g++-GNU工程的C和C++编译器(egcs-1.1.2) 总览(SYNOPSIS) gcc[option|filename ]... g++[option|filen ...
- bk.
http://ol.tgbus.com/zt2013/gzsnew/ 巴士盘点 十大游戏工作室 http://bbs.3dmgame.com/forum.php?mod=viewthread& ...
- 转-利用Oracle审计功能来监测试环境的变化
http://blog.csdn.net/luowangjun/article/details/5627102利用Oracle审计功能来监测试环境的变化 做过测试的人都应该会碰到这样的情况:测试发现的 ...
- Linux安装gcc编译器详解
本人使用的是CentOS 6.5 64位系统,由于在安装系统的时候并没有勾选安装gcc编译器,因此需要自行安装gcc编译器. 使用yum安装gcc 对于配备了yum的Linux发行版而言,安装gcc编 ...