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...
Answered

Setting lookup field value in JavaScript throwing error in uclient script

(0) ShareShare
ReportReport
Posted on by

I have a function to set a lookup field which works for the classic version of the form but not in the unified interface version.

This error is thrown in UI:  UciError: Value should be of type: entityType: Parameter Name: value[0].entityType


pastedimage1598449790679v1.png

The error appears to be thrown in one of the UCI scripts:

pastedimage1598450024494v2.png

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Can you please provide the code that calls this setLookupField function?

  • Community Member Profile Picture
    on at

    var formContext = executionContext.getFormContext();
    var result = XrmServiceToolkit.Soap.Fetch(fetchXml);

    if (result.length > 0) {
       caseManagerTeamId = result[0].attributes["ofs_team"].id;
       caseManagerTeamName = result[0].attributes["ofs_team"].name;
    }

    setLookupField(formContext, "ofs_casemanagerteam", caseManagerTeamId, caseManagerTeamName, "Team");

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Thanks, that's the answer - don't use "Team", use "team". In the client scripts use lowercased entity names.

  • Suggested answer
    Community Member Profile Picture
    on at

    Fantastic, thank you Andrew!  Oddly enough, this worked in the classic view.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 171

#2
ManoVerse Profile Picture

ManoVerse 54 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 46

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans