Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Store parent account on Customer using eConnect

Posted on by 1,035

I have been asked to store the parent account id (corporate account id) on a Customer, but I don't know where to store this field in the Customer class (taUpdateCreateCustomerRcd) using eConnect. Any thoughts? Thanks in advance.

*This post is locked for comments

  • AnhHoang_vn Profile Picture
    AnhHoang_vn 10 on at
    RE: Store parent account on Customer using eConnect

    I exactly get the same problem with you. Could you give out the simple solution?

  • Verified answer
    Rafael Diaz Profile Picture
    Rafael Diaz 1,035 on at
    RE: Store parent account on Customer using eConnect

    Basically I needed to fill in the Child attribute on the RMCustomerMasterType as well

  • Rafael Diaz Profile Picture
    Rafael Diaz 1,035 on at
    RE: Store parent account on Customer using eConnect

    Even if I remove that line it doesn't link the parent id with the recently created Customer

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Store parent account on Customer using eConnect

    Rafeal,

    That is exactly I am trying to tell you , you are placing the update if exists at the wrong container...

    Sorry could not be of help...

    Cheers!

    Sanjay

  • Rafael Diaz Profile Picture
    Rafael Diaz 1,035 on at
    RE: Store parent account on Customer using eConnect

    Again, if you read my question I'm not trying to update if exists anything, that's a different thread of mine.

    In this questions what I simply want to be able to do is to store the parent id on a customer, at the moment I can't store it, not sure why.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Store parent account on Customer using eConnect

    "pasting irrelevant information"  - Thanks!

    parentID.UpdateIfExists = 1; will update the parent customer not customer record with parent id which you are trying to do.

    customerrecord.UpdateIfExists = 1 is what you should be doing...

    Cheers!

    Sanjay

  • Rafael Diaz Profile Picture
    Rafael Diaz 1,035 on at
    RE: Store parent account on Customer using eConnect

    If you read my question it doesn't have anything to do with updating, the only thing I want to do is to store the ParentID on a Customer using eConnect but I can't.

    Please do me a favour and read the questions before pasting irrelevant information, thanks.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Store parent account on Customer using eConnect

    parentID.UpdateIfExists = 1;  Will update any changes to the parent customer not the customer you are updating the parent information.

    For updating the customer record you should set the flag for customertype

                Dim cust As String = "CUSTNMBR9"

               Dim econnect As New eConnectType

               Dim customer As New RMCustomerMasterType

               'Customer record

               Dim customerrecord As New taUpdateCreateCustomerRcd

               With customerrecord

                   .CUSTNMBR = cust

                   .CUSTNAME = "Customer Name"

                   .ADRSCODE = "PRIMARY"

                   .ADDRESS1 = "Address 1"

                   .ADDRESS2 = "Address 2"

                   .ADDRESS3 = "Address 3"

                   .CITY = "City"

                   .STATE = "State"

                   .ZIPCODE = "ZIPCODE"

                   .UpdateIfExists = 1

               End With

               customer.taUpdateCreateCustomerRcd = customerrecord

    Then add the parent record to the customer

               Dim parentobject As New taCreateParentID

               With parentobject

                   .CPRCSTNM = cust

                   .NAALLOWRECEIPTS = 1

                   .NACREDITCHECK = 0

                   .UpdateIfExists = 1

               End With

               customer.taCreateParentID = parentobject

               ReDim Preserve econnect.RMCustomerMasterType(0)

               econnect.RMCustomerMasterType(0) = customer

     

    Cheers!

    Sanjay

  • Rafael Diaz Profile Picture
    Rafael Diaz 1,035 on at
    RE: Store parent account on Customer using eConnect

    RMCustomerMasterType customertype = new RMCustomerMasterType();

    taCreateParentID parentID = new taCreateParentID();

    parentID.CPRCSTNM = corporateAccount;

    parentID.UpdateIfExists = 1;

    customertype.taCreateParentID = parentID;

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Store parent account on Customer using eConnect

    Post  your code ...

    Cheers!

    Sanjay

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans