This post will help to create address of particular role type for customer.
static void _createAddress(Args _args)
{
DirPartyPostalAddressView addressView;
LogisticsPostalAddress postalAddress;
DirParty dirParty;
Container roleID;
addressView.CountryRegionId = "USA";
addressView.State = "OH";
//addressView.City = "NY" ;
//Zipcode should be a valid one
addressView.ZipCode = "45044";
addressView.Street = "Lake Dr";
addressView.StreetNumber = "2311";
addressView.IsPrimary = true;
addressView.Party = Custtable::find("10001").Party;
dirParty = DirParty::constructFromPartyRecId(addressView.Party);
roleID = conIns(roleID,1,LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Business).RecId);
// if you pass the location value(Postal address) in addressView, this method update the address
dirParty.createOrUpdatePostalAddress(addressView,roleID);
}
{
DirPartyPostalAddressView addressView;
LogisticsPostalAddress postalAddress;
DirParty dirParty;
Container roleID;
addressView.CountryRegionId = "USA";
addressView.State = "OH";
//addressView.City = "NY" ;
//Zipcode should be a valid one
addressView.ZipCode = "45044";
addressView.Street = "Lake Dr";
addressView.StreetNumber = "2311";
addressView.IsPrimary = true;
addressView.Party = Custtable::find("10001").Party;
dirParty = DirParty::constructFromPartyRecId(addressView.Party);
roleID = conIns(roleID,1,LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Business).RecId);
// if you pass the location value(Postal address) in addressView, this method update the address
dirParty.createOrUpdatePostalAddress(addressView,roleID);
}
Thanks,
K. Arunsubramaniam
No comments:
Post a Comment