How to insert a customer record through code?

How to insert a new record using jobs

how to relate the Tables and How to insert a record in multiple Tables using jobs…,

What does that mean?

Have look at \Data Dictionary\Tables\smmBusRelTable\Methods\relation2Customer

Hi satheesh,

See this…

Pls give more details…

Hi Satheesh

static void JobCreateCustomer (Args _args)
CustTable custTable;
NumberSeq numberSeq;
Name name =‘SouthSide Street LTDA’;

DirParty dirParty;
DirPartyPostalAddressView dirPartyPostalAddressView;
DirPartyContactInfoView dirPartyContactInfo;

/* Marks the beginning of a transaction.
Necessary to utilize the method numRefCustAccount() */

numberSeq = NumberSeq::newGetNum(CustParameters::numRefCustAccount());
custTable.AccountNum = numberSeq.num();
custTable.CustGroup =‘020’;
custTable.Currency =‘BRL’;
custTable.PaymTermId =‘10DD’;
custTable.PaymMode =‘CHEQUE-01’;

custTable.insert(DirPartyType::Organization, name);


/* Creates a new instance of the DirParty class from an address book entity
that is represented by the custTable parameter. */
dirParty = DirParty::constructFromCommon(custTable);

dirPartyPostalAddressView.LocationName ='HeadQuarters ';
dirPartyPostalAddressView.City =‘São Paulo’;
dirPartyPostalAddressView.Street =‘4th Avenue’;
dirPartyPostalAddressView.StreetNumber =‘18’;
dirPartyPostalAddressView.CountryRegionId =‘BRA’;
dirPartyPostalAddressView.State =‘SP’;

// Fill address

dirPartyContactInfo.LocationName =‘SouthStreet Contact Phone’;
dirPartyContactInfo.Locator =‘551291165341’;
//dirPartyContactInfo.Type = LogisticsElectronicAddressMethodType::Phone;
dirPartyContactInfo.Type = LogisticsElectronicAddressMethodType::Phone;
dirPartyContactInfo.IsPrimary = NoYes::Yes;

// Fill Contacts

// Marks the end of transaction.



this code may be help for u…

address Details are not saved Error found in
this line → dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView);

ERROR → State was not found…,

how to I resolve it…,

Make sure the data had a ‘State’ defined that is valid in the supporting tables, or add the mapped value to the table