Hi,
Im using .net business connector to connect ASp.Net with Axapta.The user interface will be .net.The records entered in .net should be entered in CustTAble. This is achieved by calling Axapta classes in .net. The user will enter CustomerID,FirstName,LastName ,DOB etc.
The customerID can be directly inserted into customer table but firstname,lastname all should be entered in DirPartyTable.
static void Job2(Args _args)
{
DirPartyTable _partyTable;
CustTable _custTable;
str name1;
;
name1= numberSeq::newGetNum(Custparameters::numRefCustAccount()).num();
_partyTable.PartyId = DirPartyTable::getNewPartyId(true);
_partytable.Name = name1;
_partytable.NameAlias = name1;
_partyTable.FirstName = ‘shiiiio’;
_partytable.LastName = ‘jhooj’;
_partyTable.Type= DirPartyType::Person;
_partyTable.insert();
Print _partyTable.PartyId + _partyTable.FirstName;
pause;
_custTable.AccountNum = name1;
_custTable.Name = name1;
_custTable.PartyId = _partyTable.PartyId;
_custTable.CustGroup = ‘10’;
_custTable.Currency = ‘USD’;
_custTable.insert();
Print _custTable.PartyId +_custTable.AccountNum;
pause;
}
When i tried this code Firstname ,LastName are not captured in DIrPartyTable.
If i take out the relation from the code
_custTable.PartyId = _partyTable.PartyId;
then two records are inserted one with firstname and lastname,the otherone with customerid and name.
kindly help.
I