web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Address Composite field update

(0) ShareShare
ReportReport
Posted on by 1,720

Hi

One of my plugins updates the address fields to null in a contact, but when I open the contact in CRM application, the composite field still shows the old address but the individual fields in the fly-out are blank. Is there a way to set the composite field to null as well.

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mithilesh Kumar Profile Picture
    10,047 on at

    Hi Hassan,

    You need to update the "address1_composite" field also to null.

    Hope that helps

    Thanks

  • Mir Hassan Ali Profile Picture
    1,720 on at

    Hi

    That unfortunately is a read-only property.

    Thanks

  • Aileen Gusni Profile Picture
    44,524 on at

    Hassan,

    Try to set the related Customer Address entity fields (all fields, include street1, street 2, street 3, city, postal code, state, county, country, or any fields you need) to Null as well.

    And you need to know that customer address line number 1 is the address1_composite field and customer address line number 2 is the address2_composite, so that not all of the customer records you need to set to null, just the address 1 or address 2 based on what address composite field you need to set to null.

    Hope this helps!

    Thanks.

  • Mir Hassan Ali Profile Picture
    1,720 on at

    Hi Aileen

    I am already doing that as shown below, but the composite field is not set to null rather it displays the whole previous address.

                           contact.Address1_Line1 = null;

                           contact.Address1_Line2 = null;

                           contact.Address1_Line3 = null;

                           contact.Address1_City = null;

                           contact.Address1_StateOrProvince = null;

                           contact.Address1_PostalCode = null;

                           contact.Address1_Country = null;

                           os.Update(contact);

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at

    No Hassan,

    I mean the customer address entity, not the contact. (Contact has 1:N Relationship to an entity, so-called Customer Address), the composite fields (addresses field) in CRM are related to the Customer Address entity as well.

    Thanks.

  • Mir Hassan Ali Profile Picture
    1,720 on at

    Thats it. Deleting record from Customer Address entity worked, thanks!!

  • Mir Hassan Ali Profile Picture
    1,720 on at

    Just to elaborate further (incase anyone else runs into this condition), if you just delete the record from Customer Address entity then you will not be able update that address later from the CRM application and you will get an error. The reason being that CRM application expects a record to exist in the Customer Address entity for each Mailing and Physical address and if any or both of the records are missing then it will throw an exception. So in my case, after I deleted the record from Customer Address, I created a new blank record as well and all was OK.

  • Aileen Gusni Profile Picture
    44,524 on at

    Hassan,

    SO that I think, do not delete, but set to Null for all fields.

    " so that not all of the customer records you need to set to nul"

    Thanks.

  • Mir Hassan Ali Profile Picture
    1,720 on at

    Hi Aileen,

    No, that brings back the original problem, you can not update the address composite field as it is read-only and setting all other fields to null does not set the composite field to null.

    Thanks

  • Community Member Profile Picture
    on at

    How did you create a blank record for the account after deleting it. I was able to create the customeraddress but the account no longer has any address on it.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans