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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Getting JS error setting team owner.

(0) ShareShare
ReportReport
Posted on by 189

var olook = [];
var lookup = {};
lookup.id = "8a7a2996-c11d-e911-a841-000d3a1f4157";
lookup.entityType = "team";
lookup.name = "Tax Team";
olook[0] = lookup;
formContext.getAttribute("ownerid").setValue(olook);

This code results in the following error and I'm not sure what the problem is. The ID/Name are correct for that team.

"Value should be of type: entityType: Parameter Name: value[0].entityType"

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi JFulfordMS,

    I copied your code and it can run successfully in my environment.

    function setLookup(executionContext)
    {
    // Getting Form Context
    var formContext = executionContext.getFormContext();

    var olook = [];
    var lookup = {};
    lookup.id = "177f29f1-7ff3-ec11-bb3d-000d3a34996f";
    lookup.entityType = "team";
    lookup.name = "Tax Team";
    olook[0] = lookup;
    formContext.getAttribute("ownerid").setValue(olook);

    }

    pastedimage1656049663671v1.png

    Maybe you can try to click the owner field and select the team on the form, Check if manual changes can be made successfully?

    And you can try to clear browser cache to test again.

  • JFulfordMS Profile Picture
    189 on at

    I actually found that the error was because the Team entity had not been added to the App. Once I added Team to the app the code worked as expected. Really terrible error message and quite an odd requirement.

  • Community Member Profile Picture
    on at

    Hi JFulfordMS,

    Glad your code worked!

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

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 55

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans