是否可以通过自定义流程从已配置的AUTemplate
创建文档?
我有一个自定义流程,除其他外,可能需要创建客户记录。我希望能够使这些客户最初基于模板,然后根据需要通过自定义流程进行修改。
public static void ImportRecordsProcess(List<ImportRecord> importRecords)
{
CustomerMaint customerGraph = PXGraph.CreateInstance<CustomerMaint>();
AUTemplate template = PXSelect<AUTemplate,
Where<AUTemplate.screenID, Equal<Required<AUTemplate.screenID>>,
And<AUTemplate.templateID, Equal<Required<AUTemplate.templateID>>>>>
.Select(customerGraph, "AR303000", {configuredTemplateID});
foreach(ImportRecord importRecord in importRecords)
{
customerGraph.Clear();
/*** Somehow create a new customer from the template? ***/
// Update additional data
cust = customerGraph.CurrentCustomer.Current;
cust.AcctCD = importRecord.AcctCD;
cust.AcctName = importRecord.AcctName;
customerGraph.CurrentCustomer.Update(cust);
customerGraph.Actions.PressSave();
}
}