Thursday, May 2, 2013

Store address and contact information using dirPartyTable

 

   //address

    dirParty = DirParty::constructFromCommon(custTable);
    dirPartyPostalAddressView.Street = intCustTable.Street;
    dirPartyPostalAddressView.County= intCustTable.County;
    dirPartyPostalAddressView.party = custTable.Party;
    dirPartyPostalAddressView.CountryRegionId = IntCustTable.CountryRegionId;
    dirPartyPostalAddressView.ZipCode = IntCustTable.ZipCode;
    dirPartyPostalAddressView.State   = IntCustTable.State;
    dirPartyPostalAddressView.City   = intCustTable.City;
    dirPartyPostalAddressView.Location   = DirPartyLocation::findPrimaryPartyLocation(custTable.Party).Location      
   dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView);

  

// Contact information

    logisticsLocation.clear();
    logisticsLocation  = LogisticsLocation::create('Phone', NoYes::No);
    dirPartyContactInfoView.LocationName = 'Primay Phone 1';
    dirPartyContactInfoView.Locator  = intCustTable.Phone;
    dirPartyContactInfoView.Type  = LogisticsElectronicAddressMethodType::Phone;
    dirPartyContactInfoView.Party = custTable.Party;
    dirPartyContactInfoView.IsPrimary = NoYes::Yes;
    dirPartyContactInfoView.Location  = PostalAddress.Location;
    dirParty.createOrUpdateContactInfo(dirPartyContactInfoView);

No comments:

Post a Comment