Hi,
I want to create Address for a Customer in CustTable through code. I have written a simple job updating Address Table but it does not create anything. The job is the following:
static void Address(Args _args)
{
Address tAddress,sample;
CustTable tCustTable;
DirPartyTable tDirPartyTable;
;
tDirPartyTable=DirPartyTable::find("041069955_160");
While Select ForUpdate tAddress
{
tAddress.initValue();
tAddress.AddrTableId = tDirPartyTable.TableId;
tAddress.AddrRecId = tDirPartyTable.RecId;
tAddress.Name = "sample.Name";
tAddress.Street = "sample.Street";
tAddress.ZipCode = "sample.ZipCode";
tAddress.City = "sample.City";
tAddress.County = "sample.County";
tAddress.State = "sample.State";
tAddress.CountryRegionId = "sample.CountryRegionId";
tAddress.insert();
}
}
Please help.
Thanks,
John