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"
Hi JFulfordMS,
Glad your code worked!
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.
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);
}
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156