Contact Loading Problem - Technical

This question has suggested answer(s)

Hi All,

I am new bids for ax2012. i having some problem of Use CSV file to load Vend/Cust Contact as below coding. Vendor & cust address is exist.

Example Data

Cust A, Fax no: 6738433

Cust B, Fax no: 8787223

Result loading:

Cust A, Fax no: 6738433 & Fax no: 8787223  

Cust B,  -

All fax no is create under custA Party, which is very weird.

There is some problem when code execute at

"dirParty.createOrUpdateContactInfo(contactView);".

I am doubting if some thing is missing at dirParty.createOrUpdateContactInfo(contactView)???

Please correct me if there is wrong in below code.

Please help.

{ ......

vendTable = VendTable::find(conPeek(readCon,1));

partyRecId = vendTable.Party;

addressView.Party           =   partyRecId;

dirParty                    =   dirParty::constructFromPartyRecId(addressView.Party);

if (strLRTrim(conPeek(readCon,2)))

               {

                   contactView.Locator =  strLRTrim(conPeek(readCon,2));

                   contactView.Party   =  partyRecId;

                   contactView.Type =  LogisticsElectronicAddressmethodType::Fax;

                   contactView.IsPrimary = NoYes::Yes;

                   contactView.LocationName    =  "Fax" ;

                    dirParty.createOrUpdateContactInfo(contactView);

               }

inserted++;

}

Regards

All Replies
  • Hi,

    Try clear the contactView buffer before each insert.

    i.e.
    contactView.clear(); // Add this line
    contactView.Locator =  strLRTrim(conPeek(readCon,2));
    contactView.Party = partyRecId;
    ...

    When you call dirParty.createOrUpdateContactInfo(), it will update some fields in contactView, clearing the buffer first should solve your problem.

    Regards

    My blog | PBC

    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Hi DoLee,

    Thanks a lot for help. It work fine now..:D.

    Regards