Hi James,
I have used below code for Customer address creation for my business, you can modify it as per you requirement for vendor contact information update.
Let me know if you have any query
public str 1000 FinalCustomerAddressCreation(LogisticsAddressCountryRegionId _CountryRegionId, Description _AddressDescription,
LogisticsAddressZipCodeId _DPCode, CustAccount _CustAcount,
LogisticsAddressStreet _AddressStreet, LogisticsElectronicAddressLocator _Phone1 = "",
LogisticsAddressPostBox _PostBox = "", LogisticsElectronicAddressLocator _Phone2 = "",
TaxRegistrationNumber_IN _GSTINRegNumber = "")
{
LogisticsLocation LogisticsLocation,_LogisticsLocation;
LogisticsPostalAddress LogisticsPostalAddress;
DirPartyLocation DirPartyLocation;
DirPartyLocationRole DirPartyLocationRole;
LogisticsElectronicAddress LogisticsElectronicAddress;
LogisticsLocationRole LogisticsLocationRole;
LogisticsAddressZipCode LogisticsAddressZipCode;
NumberSeq num;
LogisticsLocationId _LocationId;
LogisticsLocationRecId _recid;
TaxInformation_IN _taxInformation;
TaxRegistrationNumbers_IN _taxRegistration;
int _line;
;
try
{
_line = infologLine();
if(!LogisticsAddressCountryRegion::find(_CountryRegionId))
{
throw error("Country region not found");
}
else if(!_AddressDescription)
{
throw error("Address description is mandatory");
}
else if (!LogisticsAddressZipCode::find(_DPCode) || LogisticsAddressZipCode::find(_DPCode).S3_DPCode == NoYes::No)
{
throw error("Delivery point not found");
}
else if(!CustTable::find(_CustAcount))
{
throw error("Customer not found");
}
else if(!_AddressStreet)
{
throw error("Address Street is mandatory");
}
ttsBegin;
_LocationId = LogisticsLocation::getNewLocationId();
//Create logistics location
LogisticsLocation.LocationId = _LocationId;
LogisticsLocation.Description = _AddressDescription;
LogisticsLocation.IsPostalAddress = NoYes::Yes;
LogisticsLocation.insert();
//insert location to party location
DirPartyLocation.Location = LogisticsLocation.RecId;
DirPartyLocation.IsLocationOwner = NoYes::Yes;
DirPartyLocation.IsPrimary = NoYes::No;
DirPartyLocation.IsPostalAddress = NoYes::Yes;
DirPartyLocation.Party = CustTable::find(_CustAcount).Party;
DirPartyLocation.insert();
//insert into role like Delivery/Invoice
DirPartyLocationRole.LocationRole = LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Delivery).RecId;
DirPartyLocationRole.PartyLocation = DirPartyLocation.RecId;
DirPartyLocationRole.insert();
//insert into logistics postal address
LogisticsPostalAddress.CountryRegionId = _CountryRegionId;
LogisticsPostalAddress.ZipCode = _DPCode;
LogisticsPostalAddress.Street = _AddressStreet;
LogisticsPostalAddress.PostBox = _PostBox;
LogisticsAddressZipCode = LogisticsAddressZipCode::find(_DPCode);
LogisticsPostalAddress.city = LogisticsAddressZipCode.City;//Tehsil
LogisticsPostalAddress.CityRecId = LogisticsAddressZipCode.CityRecId;
LogisticsPostalAddress.DistrictName = LogisticsAddressZipCode.DistrictName;//city
LogisticsPostalAddress.District = LogisticsAddressZipCode.District;//city recid
LogisticsPostalAddress.County = LogisticsAddressZipCode.County;
LogisticsPostalAddress.State = LogisticsAddressZipCode.State;
LogisticsPostalAddress.Address = LogisticsPostalAddress.Street +", "+ LogisticsAddressZipCode.DistrictName +", "+ LogisticsAddressZipCode.City + ", " + LogisticsAddressZipCode.County +", "+ LogisticsAddressZipCode.State + ", " + LogisticsAddressZipCode.ZipCode + ", India";
LogisticsPostalAddress.Location = LogisticsLocation.RecId;
LogisticsPostalAddress.ZipCodeRecId = LogisticsAddressZipCode.RecId;//Added by BK as on 08.04.2016
LogisticsPostalAddress.insert();
if(_GSTINRegNumber != "")
{
_taxRegistration = TaxRegistrationNumbers_IN::findByNaturalKey(TaxRegistrationType_IN::Customers, TaxType_IN::GST, _GSTINRegNumber);
if(_taxRegistration.RecId == 0)
{
//Create Tax Registration for GSTN number
_taxRegistration.TaxType = TaxType_IN::GST;
_taxRegistration.RegistrationType = TaxRegistrationType_IN::Customers;
_taxRegistration.RegistrationNumber = _GSTINRegNumber;
_taxRegistration.Name = _AddressDescription;
_taxRegistration.insert();
}
//Create Tax information for this location
_taxInformation.RegistrationLocation = LogisticsLocation.RecId;
_taxInformation.Name = _AddressDescription;
_taxInformation.IsPrimary = NoYes::Yes;
_taxInformation.GSTIN = _taxRegistration.RecId;
_taxInformation.insert();
}
////Phon number 1 insertion
if(_Phone1 || _Phone2)
{
_recid = LogisticsLocation::create('', false, logisticsLocation.RecId).RecId;
}
if(_Phone1)
{
logisticsElectronicAddress.Location = _recid;
LogisticsElectronicAddress.Description = "Celluler Phone1";
LogisticsElectronicAddress.IsMobilePhone = NoYes::Yes;
LogisticsElectronicAddress.Type = LogisticsElectronicAddressMethodType::Phone;
LogisticsElectronicAddress.Locator = _phone1;
LogisticsElectronicAddress.insert();
}
//Second phone number
if(_Phone2)
{
logisticsElectronicAddress.Location = _recid;
LogisticsElectronicAddress.Description = "Celluler Phone2";
LogisticsElectronicAddress.IsMobilePhone = NoYes::Yes;
LogisticsElectronicAddress.Type = LogisticsElectronicAddressMethodType::Phone;
LogisticsElectronicAddress.Locator = _phone2;
LogisticsElectronicAddress.insert();
}
ttsCommit;
return "True$" + _LocationId;
}
catch (Exception::Error)
{
return Utilities.GetInfologInOneLine(_line);
}
}
Thanks