Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Answered

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

Posted on by 814

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.

  • COOL Profile Picture
    COOL 40 on at
    RE: Need that look up of connection entity show values from only one entity

    Hi Ravi, can you show how you achieve this?

  • Nya Profile Picture
    Nya 29,056 on at
    RE: Need that look up of connection entity show values from only one entity

    Hi COOL,

    It is recommended to post your issue separately.

    Best Regards,

    Nya

  • COOL Profile Picture
    COOL 40 on at
    RE: Need that look up of connection entity show values from only one entity

    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)

  • Ravi Fulani Profile Picture
    Ravi Fulani 814 on at
    RE: Need that look up of connection entity show values from only one entity

    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.

  • Nya Profile Picture
    Nya 29,056 on at
    RE: Need that look up of connection entity show values from only one entity

    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
    Ravi Fulani 814 on at
    RE: Need that look up of connection entity show values from only one entity

    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?

  • Suggested answer
    Al Iggs Profile Picture
    Al Iggs on at
    RE: Need that look up of connection entity show values from only one entity

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

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

  • Verified answer
    Nya Profile Picture
    Nya 29,056 on at
    RE: Need that look up of connection entity show values from only one entity

    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

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans