Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

addCustomView for connectionrole

(0) ShareShare
ReportReport
Posted on by

Hello

I try to filter the connection role for connections. It actually works with "addCustomView" by other tables, but with the connectionroles the view is always defaulting to 'Applicable connection Roles' even after setting setDefaultView on this control. Is there anyway I can default to my custom view ?

If i check networktraffic in my browser, i can see that my custom fetch is loading, but the default system fetch also is loading and my custom fetch is not added in the lookup

pastedimage1653989472800v1.png

here is my code:

function setConnectionRoles(executionContext) {
    var formContext = executionContext.getFormContext();
	var viewID = "66c0bb1e-90e1-4d56-8497-f1b8eae420c1";
	var entity = "connectionrole";

	var fetchData = {
	  "statecode": "0",
	  "category": "5"
	};
	var fetchXml = [
	"",
	"  ",
	"    ",
	"    ",
	"    ",
	"    ",
	"    ",
	"      ",
	"      ",
	"    ",
	"  ",
	""
	].join("");
	

	var grid = ""  
                " "  
                    " "  
                " "  
            "";
 
	formContext.getControl("record2roleid").addCustomView(viewID, entity, "Connection-Roles", fetchXml, grid, true);

}

  • Dy365Fan Profile Picture
    Dy365Fan on at
    RE: addCustomView for connectionrole

    addCustomFilter also not working

  • Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: addCustomView for connectionrole

    Hi,

    Since you don't have link-entity in your fetch xml, can you please try addCustomFilter instead of addCustomView

    blog.magnetismsolutions.com/.../lookup-filtering-using-addcustomfilter-vs-addcustomview-in-dynamics-365

  • Dy365Fan Profile Picture
    Dy365Fan on at
    RE: addCustomView for connectionrole

    Not working

  • Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: addCustomView for connectionrole

    Hi,

    Can you try below viewID in your code see if it works?

    var viewID = ‘{00000000-0000-0000-0000-000000000001}’;

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans