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 :
Service | Customer Service, Contact Center, Fie...
Answered

Need that look up of connection entity show values from only one entity

(0) ShareShare
ReportReport
Posted on by 836

Hi,

There is a entity named connection, the look up of connection shows all entities. Is there a way that I can make it show only work order records. 

I am going to use it for work orders, I want that it directly show work order records and my customer directly use that, is there a way for that.

  • Verified answer
    Nya Profile Picture
    29,064 on at

    Hi, Ravi

    I’d like to know that are you referring to the look up of connection in the picture below.

     7506.png

    1. Go to Advanced Settings > Settings > Customize the System. Expand the main form of the Connection entity. Find the Name of the field.

     pastedimage1615181130136v4.png

    1. Create a new Web Resource with JS.

     pastedimage1615181135484v5.png

    1. Here is the code.

     

    function SetSelectedEntities(executionContext) {
    	var formContext = executionContext.getFormContext();
    	var customControl = formContext.getControl("record2id");
    	if (customControl.getEntityTypes().length > 1) {
    		customControl.setEntityTypes(['msdyn_workorder']);
    	}
    }

    1. Add the Web Resource into the form.

     pastedimage1615181177732v7.png

    1. Save and publish the form. Then it will only show the Work Order type after refreshing the page.

     pastedimage1615181165284v6.png

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

  • Suggested answer
    Al Iggs Profile Picture
    Microsoft Employee on at

    Hi Ravi, have a look at docs.microsoft.com/.../configure-connection-roles

    An example is the connection from customer asset to IoT device.

  • Ravi Fulani Profile Picture
    836 on at

    Hi, I did the following step.  Created a connection role as Associated work order and then selected Work order. When I go back to form and select Associated Work order.  Still I am able to see account and all.

    pastedimage1615254809645v2.png


    pastedimage1615254851897v3.png

    Am I doing something wrong?

  • Nya Profile Picture
    29,064 on at

    Hi, Ravi

    Is there something wrong with my understanding?

    Otherwise I think it would be more straightforward to implement this requirement in JavaScript.

     

    Best Regards,

    Nya

  • Ravi Fulani Profile Picture
    836 on at

    Thanks Nya that was correct. I just changed my functionality and created the work flow instead just to keep the Connection entity base of connecting with multiple entity. as it is. Thank you so much for the code. it helped.

  • COOL Profile Picture
    40 on at

    hi Nya,

    I follows the above but is getting script error, any idea? and btw how i find this entity (['msdyn_workorder'])? my requirement is to only show user, so i changed to (['msdyn_user']);

    error log

    Web resource method does not exist: SetSelectedEntities

    Session Id: bdc46e3f-6f0c-48e8-84a9-f01fc091ca75

    Correlation Id: 73b91fa8-bae6-44ad-9b7d-fb99dbcf3d85

    Event Name: onload

    Function Name: SetSelectedEntities

    Web Resource Name: dev_connection

    Solution Name: Active

    Publisher Name: DefaultPublishercredablsandbox

    Time: Fri Jul 02 2021 18:37:19 GMT+1000 (Australian Eastern Standard Time)

  • Nya Profile Picture
    29,064 on at

    Hi COOL,

    It is recommended to post your issue separately.

    Best Regards,

    Nya

  • COOL Profile Picture
    40 on at

    Hi Ravi, can you show how you achieve this?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
11manish Profile Picture

11manish 48 Super User 2026 Season 2

#2
Travis South Profile Picture

Travis South 45

#3
Ayesha Wajahat Profile Picture

Ayesha Wajahat 18

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans