Form上建立过滤器
this.queryBuildDataSource().addRange(fieldNum(IWS_CopperScrapSwapTable,RecId)).value(SysQuery::value(Table.RecId));
DetailTb_ds.executeQuery();//执行。
this.queryBuildDataSource().addRange(fieldNum(IWS_CopperScrapSwapTable,RecId)).value(SysQuery::value(Table.RecId));
DetailTb_ds.executeQuery();//执行。
加入数据源默认:
应将 InsertAtEnd 与 InsertIfEmpty 设No;
Dynamic 365中创建编码规则与Dynamic Ax 2012 基本一致。以下几个步骤,就当温习一下吧。
1.创建扩展类型,将此字段添加到需要创建编码的表中。
2.在对应添加编码模块下的编码类中添加LoadModel,以下以库存管理模块为例:
[ExtensionOf(classstr(NumberSeqModuleInventory))]//扩展库存管理编码类
final class NumberSeqModuleInventory_Extension
{
protected void loadModule()
{
NumberSeqDatatype datatype = NumberSeqDatatype::construct();
next loadModule();
datatype.parmDatatypeId(extendedTypeNum(TestAccount));//要加编码字段对应的扩展类型
datatype.parmReferenceHelp(literalStr("测试账号"));//扩张类型标签
datatype.parmWizardIsContinuous(false);
datatype.parmWizardIsManual(NoYes::No);
datatype.parmWizardFetchAheadQty(10);
datatype.parmWizardIsChangeDownAllowed(NoYes::No);
datatype.parmWizardIsChangeUpAllowed(NoYes::No);
datatype.parmWizardHighest(99999999);
datatype.parmSortField(2006);
datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
this.create(datatype);
}
}
3.生成编号逻辑(在对应模块下的参数表中新建静态方法)
[ExtensionOf(tableStr(InventParameters))]//扩展库存表
final class InventParameters_Extension
{
public server static NumberSequenceReference numTestAcount()
{
return NumberSeqReference::findReference(extendedTypeNum(TestAccount));
}
}
4.在字段所在表调用生成编号规则(在需要生成的时候直接调用此方法即可,一般在表新建初始化时就调用了)
表中调用方法:
public void initValue()
{
NumberSeq numberseq;
super();
//第三步可省略,将这句直接替换成:numberseq = NumberSeq::newGetNum(NumberSeqReference::findReference(extendedTypeNum(TestAccount)));
numberseq = NumberSeq::newGetNum(InventParameters::numTestAcount());
numberseq.used();
this.SubtenancyAccount = numberseq.num();
}
class LodNumberSeq
{
public static void main(Args _args)
{
NumberSeqApplicationModule::loadAll();
info("Finished");
}
}
6.在前台界面配置生成规则:
路径:组织管理-编号规则,新建,选到对应模块和自己调价的名称进行自定义设置
这样,就可以测试啦!嘿嘿哈哈,good luck.
Date endDate;
FormDataSource fds;
MultiSelectionHelper MultiSelectionHelper;
AssetTable assetTable;
AssetBookId bookId;
AssetBook assetBook;
IWS_FixedAssetCardContract contract;
Args argsLocal;
;
argsLocal= this.parmArgs();
contract =this.parmReportContract().parmRdpContract() as IWS_FixedAssetCardContract;
if( argsLocal.callerName() == "AssetTable") //is AssetTable)
{
fds = args.record().dataSource();
multiSelectionHelper = MultiSelectionHelper::construct();
multiSelectionHelper.parmDatasource(fds);
assetTable = multiSelectionHelper.getFirst();
select firstonly assetBook where assetBook.assetId == assetTable.assetId;
bookId = assetBook.BookId;
List list = new List(Types::String);
while (assetTable)
{
list.addEnd(assetTable.assetId);
assetTable = multiSelectionHelper.getNext();
}
contract.parmAssetList(list);
contract.parmBookId(bookId);
应开发如下几项:
1. 若有新实体则需要开发新实体类及生产类;
2. 获取审批列表方法中while循坏添加对应表的判断;
3. 获取审批列表方法中while循环case到对应表创建实体(多种状态都要);