Dynamics AX 2009 .NET Business connector

I want to know how to create a new item record using a template in Dynamics AX 2009 .NET Business connector. I know how to do this using Dynamics AX 2009. Is there a static method that i can call? I also want to show the new item information to the user before saving it. Is this possible?

Please help

Thanks

Upvotes: 0

Views: 2177

Answers (2)

Kenny Saelen
Kenny Saelen

Reputation: 894

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)

Upvotes: 1

Jan B. Kjeldsen
Jan B. Kjeldsen

Reputation: 18051

Have a look at Casperkamal's blog post Using record templates in code for Dynamics Ax 4.0. As the title explicitly states this works for Axapta 4.0, but I have no reason to believe it does not work in AX 2009.

Excerpt:

sysRecordTemplate = SysRecordTemplate::newCommon(inventTable);
sysRecordTemplate.parmForceCompanyTemplate('Feed'); //Template name as string
sysRecordTemplate.createRecord();

You have to convert this X++ to the Business Connector calls in your target language.

Upvotes: 2

Related Questions