Creating Transfer Order using .Net Business Connector.

I have a requirement that i need to create a transfer order using the c-sharp application. I can connect and insert the records in the AX database its working but its not working when i goto create the transfer order.

I read on the Internet that we can use 2 classes axInventTransferTable, axInventTransferLine.

I am using the axInventTransferTable class to test and create the header record. I am using the following code but its not doing any thing at all.

private void button3_Click(object sender, EventArgs e)
{
Axapta ax;
AxaptaObject axobj;
string s1, s2;
try
{
ax = new Axapta();
ax.Logon(null, null, null, null);
{
ax.TTSBegin();
using (axobj = ax.CreateAxaptaObject(“axInventTransferTable”))
{
s1 = “34”;
s2 = “Store1”;

axobj.Call(“parmInventLocationIdFrom”, s1);
axobj.Call(“parmInventLocationIdTo”, s2);
axobj.Call(“parmShipDate”, “9/16/2011”);
axobj.Call(“Save”);
// str3 = axaptaobject.Call(“parmTransferId”).ToString();
}
ax.TTSCommit();
ax.Logoff();
MessageBox.Show("Transfer Order Inserted … ");
}
}

catch (Exception err)
{
Console.WriteLine(err.Message);
}
}

Please if any one already done this share the code.

Thanks and regards.

Instead of using axobj.Call(“Save”), use axobj.Call(“doSave”) method , supply transferid and transit warehouse(InventLocationIdTransit) .

how will i get the transferid through .net it is auto generated when record insert.

Public str GenerateNumberSequence()
{
str newTransferId;

ttsbegin;

newTransferId = NumberSeq::newGetNum(InventParameters::numRefTransferId()).num();

ttscommit;

return newTransferId;

}

Create a new class and add the above method and call it from .net to generate transferid for transfer order. hope it helps.

what happen brother? Is it working.

No i dont know but its not working and doing nothing.

Do you have any sample code if so please provide me the same.

Thanks i appreciate your help.

can you tell me the error thrown by .net.