Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Auto update of fields while doing appointment

Posted on by 190

Hello,

we do appointments in Appointment entity. i have one new requirement witch is explained below.

In appointment entity we select the account of customer, one account will may have 10 or 15 Opportunities and we select any one of opportunities. and we have have field called descriptions  we write here in details of appointment.

now my requirement is i want to create a field in Account entity called Dealer in options set - yes/no.  , 

when i do any appointment and select any account , where account has Dealer - yes and then if we select any one of opportunities and write the descriptions and complete the appointment , then it should auto update the Descriptions in all other opportunities related to same account.  

Example-

entity - Appointment 

field Account - xyz pvt (selected account) [ in account entity we have field called Dealer and this is selected dealer type YES) 

field Opportunities - xzz (selected any one Opportunities out of 10)

field Descriptions - abcdefghijklmnopqrstuvw.............

when i do complete appointment . then 

this same Descriptions abcdefghijklmnopqrstuvw............. should be auto updated for remaining 9 Opportunities .

 

please any clue or help . need urgent basis.

 

thanks

amit

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Auto update of fields while doing appointment

    Hi Amit,

    The steps to implement the plugin is provided in the first answer that I wrote.

    Are you facing any issues in writing the plugin? If so, do let us know by giving a short but complete code snippet and the error logs, so we can help you troubleshoot the issue.

    Here are some useful documentation on how to write code.

    docs.microsoft.com/.../plugin-development

  • amity Profile Picture
    amity 190 on at
    RE: Auto update of fields while doing appointment

    Hello Sara,

    ya exactly ..you are right Sara.  any help in writing plugins for this Dear.

    Thanks

    Amit.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Auto update of fields while doing appointment

    Hi Amity,

    So, if you complete one appointment for the Account after having completed the Description field (Appointment entity), then you want to update Description field of all other Appointment records for the same Account and other opportunities, i.e., remaining 4 appointments.

    Account: Microsoft

    • Dealer flag is set to Yes

    Opportunities: 

    1. Opportunity #1
    2. Opportunity #2
    3. Opportunity #3
    4. Opportunity #4
    5. Opportunity #5

    Appointments:

    1. Appointment for Microsoft regarding Opportunity #1
    2. Appointment for Microsoft regarding Opportunity #2
    3. Appointment for Microsoft regarding Opportunity #3
    4. Appointment for Microsoft regarding Opportunity #4
    5. Appointment for Microsoft regarding Opportunity #5

    If you open Appointment for Microsoft regarding Opportunity #1 and fill in the Description field and complete it, it should copy the Description field to all the other Appointments and mark them as well complete?

    A plugin is definitely the way to go. See previous post on how to implement the plugin. 

    - Sara

  • amity Profile Picture
    amity 190 on at
    RE: Auto update of fields while doing appointment

    Hi

    Dear Sara W Ellis

    Thanks for your quick response.

    It is a little unclear where the Descriptions field is -: Appointment entity.

    And dealer field is on Account entity.

    ----  one account is having 10 opportunities. (one customer has 10 Opportunities).

    so while visiting to customer means(Account) sales person is doing 5 Opportunities means 5 Appointment( Count = 5)

    basically idea of doing behind is that-----------

    10 /or  8 or / 5 Opportunities = 1 customer(Account) = should be 1 Appointment .

    if we have created 5 appointment with 5 different opportunities with same account. then

    when salesperson is going to start any one appointment from same account and write Descriptions(this field is present in appointment entity) abcdefghijklmnop and mark complete then  remaining 4 appointment with 4 different opportunities with same account should be auto updated the field value of Descriptions and mark this complete appointment.

  • Suggested answer
    Radu Chiribelea Profile Picture
    Radu Chiribelea 6,667 on at
    RE: Auto update of fields while doing appointment

    Hi Amit,

    I think you could do this via a plug-in triggered once the appointment is completed (state is changed). The plug-in should retrieve the parent account and from there get all the child opportunities and update them.

    Hope this helps as a starting point.

    Regards,

    Radu

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Auto update of fields while doing appointment

    Hi Amit, 

    It is a little unclear where the Descriptions field is.

    1. Where is the field Descriptions - is it in the Opportunity entity or the Appointments entity? It appears to be in both Opportunity and Appointments. Is that correct?
    2. If you create another Appointment for the same Account, but choose a different Opportunity (say, Opportunity #2) and when you complete it, should it overwrite the contents in the Opportunity record?
      1. For instance, I have an Account called Microsoft which has 10 Opportunities and has Dealer field set to Yes
      2. I create an Appointment today (19/11) for Microsoft and select Opportunity #1 and set the Description as "Appointment #1 for Microsoft"
      3. I complete appointment. All 10 opportunities have Description field updated to "Appointment today - 19 November, 2018"
      4. I create an Appointment today (19/11) for Microsoft and select Opportunity #2 and set the Description as "Appointment #2 for Microsoft"
      5. I complete appointment. What should be the Description field in the 10 Opportunity record - is it "Appointment #1 for Microsoft" or "Appointment #2 for Microsoft"

    Either way, I think you need a plugin or a custom workflow activity. 

    1. Call the plugin on Completion of Appointment 
    2. Retrieve the Description field from the Appointment
    3. Retrieve the RegardingObjectId (assuming that all appointments are related to Account) which will give you the Account Id
    4. Using the Account Id, retrieve all Opportunities
    5. Loop through the Opportunities and update the Description field (here, you may either want to append or just overwrite depending upon your requirements)

    You can use a couple of Workflow extensions (developed by community members and MVP) to update child records without writing any code - Dynamics Workflow Tools. If you are using this tool, then do the following

    1. Create a workflow to be triggered on Completion of Appointment
      1. Check if Dealer is set to Yes
      2. Set a flag on Account record (i.e., the Regarding Object)
      3. Copy the Description from the Appointment to a new field
    2. Create another workflow on Account which is triggered on the flag being updated

    Call the Dynamics Workflow Tools - Update Child Record step to update the Opportunities associated with the account with the description from the Account record. 

    Hope this helps. 

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans