Question Status

Suggested Answer
AngleMisc asked a question on 28 Sep 2013 10:30 PM

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

Reply
Suggested Answer
Dominic Lee responded on 2 Oct 2013 1:04 AM

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

kind regards,

Dominic Lee

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.

Reply
AngleMisc responded on 3 Oct 2013 9:45 PM

Hi DoLee,

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

Regards

Reply
Suggested Answer
Dominic Lee responded on 2 Oct 2013 1:04 AM

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

kind regards,

Dominic Lee

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.

Reply