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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Stakeholders on an opportunity

(0) ShareShare
ReportReport
Posted on by 115

We are trying to complete our stakeholders section on our Opportunities form so we can identify who is involved and what roles they are playing. For the most part this works for us. However, when I use the New Connection button to add a stakeholder, in the "As this role" field, it gives me the whole range of connection roles (in all different categories) and not just the few defined stakeholder roles I want. Consequently, our users are mistakenly adding in other roles. Not only does this mess up our process, it also means the stakeholder they just added often doesn't get added to the stakeholder list (because they selected a non-stakeholder role). Of course, this ruins what we want to accomplish with our stakeholder section.

So, how do I limit the selection of roles to just the stakeholder roles and not get all the other roles mixed in?

Thanks

I have the same question (0)
  • Suggested answer
    Hicham GRC Profile Picture
    200 on at

    Hi,

    I suggest to try to create a JS function that fires on change event of stakeholder field and create an XML custom filter on the lookup "As this role".

    This an example that you can find in this documentation https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/addcustomfilter

    var Sdk = window.Sdk || {};
    
    Sdk.setParentAccountIdFilter = function (executionContext) {
    
        formContext = executionContext.getFormContext();
        formContext.getControl("parentaccountid").addPreSearch(Sdk.filterCustomerAccounts);
    }
    
    Sdk.filterCustomerAccounts = function () {
    
        var customerAccountFilter = "";
        formContext.getControl("parentaccountid").addCustomFilter(customerAccountFilter, "account");
    }

    In your case, your filter should look like : 

      
        {9C86F660-5F5B-E611-810B-00155DBD6A1D}
        {63E69A22-8E7F-4524-BE97-37E05480F7F0}
      
    

    Depending on the role of the stakeholder, you can add only the roles you want in the filter.

    Hope this will help. 

    Hicham

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 180 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans