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 ...
随机推荐
- CBC和CTR解密模式——C++实现
利用已经封装好的AES加密算法,实现CBC模式加密和CTR模式加密. (1)CBC解密 如图,CBC模式的解密,步骤主要有三个,首先是拿密文段逐一放到AES解密盒子里面得到一个结果temp(事先要把密 ...
- Roman to Integer -- LeetCode 13
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...
- 1、JS的数据类型
一.分类:JS有6种数据类型: 1.string 2.undefined 3.number 4.null 5.boolean 6.object(包含函数.数组.日期等) 二.隐式转换 1.+和- va ...
- Win10/UWP新特性系列—Launcher实现应用间的通信
UWP中,微软为Windows.System.Launcher启动器新增了很多的功能,以前只能启动App,打开指定扩展名文件,对uri协议的解析,以及当启动的应用没有安装时则会提示前往商店下载等. 如 ...
- iOS-UILabel自适应高、宽
UILabel自适应高 UILabel自适应宽
- Swift基础语法 、 元组(Tuple)
字符串的使用 1.1 问题 Swift的String和Character类型提供了一个快速的,兼容Unicode的方式来处理代码中的文本信息.创建和操作字符串的语法与C语言中字符串类似.本案例将学习如 ...
- php-访问数据库
建一个连接,造一个连接对象 $db = new MySQLi("host","username","passwd","databa ...
- UIApplication的使用
//// UIApplication的使用// IOS笔记//// Created by **** on ****.// Copyright © 2013年 ***. All rights re ...
- Ant——ant的使用
---------------------------------------------------------------------------------------------------- ...
- vue.js使用详解
1.什么是vue.jsvue.js是一款数据驱动型的js框架.何为数据驱动型?html视图层定义模板,vue定义数据.html和vue数据,通过标签id关联. 2.vue.js引入<script ...