Code to Call AX class in .Net
using Microsoft.Dynamics.BusinessConnectorNet;
namespace InsertAxRecord
{
class Program
{
static void Main(string[] args)
{
Axapta ax;
AxaptaRecord record;
try
{
// Create AX object and logon to AX
ax = new Axapta();
ax.Logon(null, null, null, null);
// Create a new AxaptaRecord object with
// the name of the table as input parameter
using (record = ax.CreateAxaptaRecord("ABCTable"))
{
// Remember to clear the tablebuffer if you are inserting inside a loop
record.Clear();
record.InitValue();
// Set the fields in the table
record.set_Field("ss", "dd");
record.set_Field("dd", ddg);
record.set_Field("dd", "dd");
record.set_Field("df", "dff");
record.set_Field("dfd", dfdf);
// Insert the record
record.Insert();
}
// End the AX session
ax.Logoff();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}