update exsiting postal address by x++ job for a exisitng customer

Dear friends, I have created a job to create a new postal address for existing customer by, but when ever i am trying to update the exsiting postal address for a customer it is not getting updated, checked with debugger also, didn’t get much help. static void jobupdateaddress(Args _args) { LogisticsElectronicAddress LogisticsElectronicAddress; CustTable CustTable; DirPartyContactInfoView contactInfo; DirPartyPostalAddressView postalAddress; DirParty dirParty; DirPartyPostalAddressView dirPartyPostalAddressView; DirPartyContactInfoView dirPartyContactInfo; DirPartyTable DirPartyTable; select Recid from LogisticsElectronicAddress where LogisticsElectronicAddress.Locator == “lol000002@yahoo.com”; //LogisticsElectronicAddress.RecId == DirPartyTable.PrimaryContactEmail && select RecId from DirPartyTable where DirPartyTable.PrimaryContactEmail == LogisticsElectronicAddress.RecId; select CustTable where CustTable.Party == DirPartyTable.RecId; info(strFmt("%1",CustTable.email())); //select * from CustTable where LogisticsElectronicAddress.Locator == “lol000002@yahoo.com”; CustTable = CustTable::find(CustTable.AccountNum); info(strfmt("%1",CustTable.email())); info(strfmt("%1",CustTable.address())); ttsBegin; try { //dirParty = DirParty::constructFromCommon(CustTable); dirParty = DirParty::constructFromPartyRecId(CustTable.Party); dirPartyPostalAddressView.LocationName ='HeadQuarters1 '; dirPartyPostalAddressView.City =‘chennai1’; dirPartyPostalAddressView.Street =‘4th Avenue1’; dirPartyPostalAddressView.StreetNumber =‘181’; dirPartyPostalAddressView.CountryRegionId =‘INDia’; // dirPartyPostalAddressView.State =‘SP’; dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView); dirPartyContactInfo.LocationName =‘SouthStreet Contact Phone’; dirPartyContactInfo.Locator =‘9600147034’; dirPartyContactInfo.Type = LogisticsElectronicAddressMethodType::Phone; dirPartyContactInfo.IsPrimary = NoYes::Yes; // Fill Contacts dirParty.createOrUpdateContactInfo(dirPartyContactInfo); info("address updated "); // Marks the end of transaction. ttsCommit; } catch(Exception::Error) { ttsAbort; throw Exception::Error; } } please help me

Can you please post you code in a readable way? I usually enclose code in pre and code tags. This is the result:

int x;
x = 42;
jobupdateaddress(Args _args) { LogisticsElectronicAddress LogisticsElectronicAddress; CustTable CustTable; DirPartyContactInfoView contactInfo; DirPartyPostalAddressView postalAddress; DirParty dirParty; DirPartyPostalAddressView dirPartyPostalAddressView; DirPartyContactInfoView dirPartyContactInfo; DirPartyTable DirPartyTable; select Recid from LogisticsElectronicAddress where LogisticsElectronicAddress.Locator == "lol000002@yahoo.com"; //LogisticsElectronicAddress.RecId == DirPartyTable.PrimaryContactEmail && select RecId from DirPartyTable where DirPartyTable.PrimaryContactEmail == LogisticsElectronicAddress.RecId; select CustTable where CustTable.Party == DirPartyTable.RecId; info(strFmt("%1",CustTable.email())); //select * from CustTable where LogisticsElectronicAddress.Locator == "lol000002@yahoo.com"; CustTable = CustTable::find(CustTable.AccountNum); info(strfmt("%1",CustTable.email())); info(strfmt("%1",CustTable.address())); ttsBegin; try { //dirParty = DirParty::constructFromCommon(CustTable); dirParty = DirParty::constructFromPartyRecId(CustTable.Party); dirPartyPostalAddressView.LocationName ='HeadQuarters1 '; dirPartyPostalAddressView.City ='chennai1'; dirPartyPostalAddressView.Street ='4th Avenue1'; dirPartyPostalAddressView.StreetNumber ='181'; dirPartyPostalAddressView.CountryRegionId ='INDia'; // dirPartyPostalAddressView.State ='SP'; dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView); dirPartyContactInfo.LocationName ='SouthStreet Contact Phone'; dirPartyContactInfo.Locator ='9600147034'; dirPartyContactInfo.Type = LogisticsElectronicAddressMethodType::Phone; dirPartyContactInfo.IsPrimary = NoYes::Yes; // Fill Contacts dirParty.createOrUpdateContactInfo(dirPartyContactInfo); info("address updated "); // Marks the end of transaction. ttsCommit; } catch(Exception::Error) { ttsAbort; throw Exception::Error; } }

I tried that but code is not coming in the format mentioned by you.

Sorry, I can’t tell you what you did wrong because I don’t know what you did.