我想知道如何使用 Dynamics AX 2009 .NET Business 连接器中的模板创建新的项目记录。我知道如何使用 Dynamics AX 2009 来做到这一点。是否有我可以调用的静态方法?我还想在保存之前向用户显示新项目信息。这可能吗?
请帮忙
谢谢
我想知道如何使用 Dynamics AX 2009 .NET Business 连接器中的模板创建新的项目记录。我知道如何使用 Dynamics AX 2009 来做到这一点。是否有我可以调用的静态方法?我还想在保存之前向用户显示新项目信息。这可能吗?
请帮忙
谢谢
查看 Casperkamal 的博客文章Using record templates in code for Dynamics Ax 4.0。正如标题明确指出的那样,这适用于 Axapta 4.0,但我没有理由相信它在 AX 2009 中不起作用。
摘抄:
sysRecordTemplate = SysRecordTemplate::newCommon(inventTable);
sysRecordTemplate.parmForceCompanyTemplate('Feed'); //Template name as string
sysRecordTemplate.createRecord();
您必须将此 X++ 转换为目标语言的 Business Connector 调用。
What I would do is create a class inside X++ ( because that is our habitat :-) ) and let that class be the 'controller' for doing what you want to do.
Then just make sure you can call the logic you created by creating a static method that you can call. That way, you can use the business connector and you logic is contained in Ax.
(To show data to users before they insert, you could also provide a method that collects the data and passes it to the business connector. (You could create a data contract-like class for this)