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 365 | Integration, Dataverse...
Answered

Plugin for Contact Option Set field upgrade trigger phone call activity

(0) ShareShare
ReportReport
Posted on by 102

Hi Experts,

Due to the reason of performance and integration, the approach must implement plugin for the following scenario

I have a Global Option Set and a Local Option Set field in the Contact entity, both of them with the name of "Rank", items are: start, base, rank1, rank2,rank3, rank4, and rank5 from the lowest level to the highest level.

Once the Rank UPGRADE (that means only going up, not go down), trigger a Phone Call Activity.

Following are the main points:

  1. Populated Phone Call Activity's Subject must involve upgraded Rank value (e.g. If one Contact's level is Rink3 before upgrading, the Subject must be: Your Rank has upgraded to Rank4).
  2. The Rank option set has two primary items: Start and Base, but the phone call activity trigger does NOT apply to these two items.
  3. Populate the Start Date as the activity create time and the Due day is 7 days after Start Date.
  4. Call From is the Owner of the record.
  5. Call To is the Contact.
  6. Regarding is the Contact
  7. Another option set field named Role needs to populate the value: Role Type.

Note: For the historical reason, the option items sequence (From Lowest to Highest) doesn't consistent with the order of their values, which say Rank5=8, Rank4=1, Rank3=2, Rank2=3, Rank1=2, Base=1, Start=7.

Can you please help me by providing your suggestion on how to dev this plugin.


Any response should be welcome and appreciated.

I have the same question (0)
  • DATAGREE Profile Picture
    102 on at

    Looking forward to hearing from you.

  • Verified answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    Thank you for your query.

    Let me give you an idea:

    • Create a plugin that runs on Pre-Update of the Contact Entity.
    • Create a Pre-Image and Post-Image, compare for the Rank field before and after value. You should also select Owner field in the image.
    • As your optionset values are not consistent, get the Rank number from the optionset label. For example:

    int prevRankNo = int32.parse(prevRankLabel.replace("Rank", ""));
    int nextRankNo = int32.parse(nextRankLabel.replace("Rank", ""));
    // This is just an idea, you can extract rank number using Regex as well.

    • By comparing the rank numbers, you can decide if you need to create a Phone Call or not.
    • Use Prev. and updated Rank number to provide Subject to Phone call entity.
    • Assign From to the Owner of contact (get from image), set Call To and Regarding to the contact (current record).
    • Set Role Type as per your logic.

    Please note, To and From fields are activity parties, you need to create an array of Activity Party (instead of GUIDs), take a look here:

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/205114/plugin-issue-create-phone-call?pifragment-97030=1

    For plugin pre and post images, take a look here:

    https://carldesouza.com/dynamics-365-plugins-pre-post-images/

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 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans