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 ...
随机推荐
- Nginx反向代理关于端口的问题
Nginx反向代理关于端口的问题 http://www.cnblogs.com/likehua/p/4056625.html Nginx默认反向后的端口为80,因此存在被代理后的端口为80的问 ...
- 关于ASP.NET或VS2005 搭建三层架构的理解
最近想学习ASP.NET建网站,关于ASP.NET或VS2005 搭建三层架构的理解,网上摘录了一些资料,对于第(2)点的讲解让我理解印象深刻,如下: (1)为何使用N层架构? 因为每一层都可以在仅仅 ...
- Ubuntu操作系统安装使用教程 (转)
随着微软的步步紧逼,包括早先的Windows黑屏计划.实施,逮捕番茄花园作者并判刑,种种迹象表明,中国用户免费使用盗版Windows的日子将不会太长久了,那么这个世界上有没有即免费又易用的操作系统呢? ...
- IIS 工作原理之非托管代码旅程(一)
IIS6改变 IIS6可以为每个不同的虚拟目录创建不同的程序池,这样缩小了IIS的Application Pool的颗粒度,不同的虚拟目录之间是互不影响的. IIS6(和IIS7经典模式)与IIS7集 ...
- Unparsed aapt error(s)! Check the console for output解决方法
在Eclipse平台进行Android 应用开发时,编辑,修改或增删 res/下资源文件时有时会遇到如下错误提示:“Unparsed aapt error(s)! Check the console ...
- RF Analyzer for Android 安卓平台连接HackRF的App
Over the last week I've been working on a new project, trying to build a spectrum analyzer for Andro ...
- ios学习之UISwipeGestureRecognizer手势识别
ios学习之UISwipeGestureRecognizer手势识别 本文部分转自俺是一个瓜娃!!!的博客UISwipeGestureRecognizer ---手指动作,转载过来仅是为了自己查询 ...
- html table动态合并单元格 js方法
<script> $(document).ready(function(){ function mc(tableId, startRow, endRow, col) { var tb = ...
- jsp打印页面 js代码
function doPrint() { bdhtml=window.document.body.innerHTML; sprnstr=""; //开始打印标识字符串有17个字符 ...
- JavaSE配置文件java.util.Properties【单例模式Singleton】
如果不是放在src文件夹里面,则: p.load(new BufferedInputStream(new FileInputStream("tank.properties"))); ...

