Skip to main content
Nintex Community Menu Bar
Question

Not getting the options for Option model for standard Whatid field of Task

  • July 9, 2024
  • 5 replies
  • 13 views

Forum|alt.badge.img+1

I have a table for Task(Standard Object) and I am displaying the WhatId (Standard field for Task) on the same. I need to have the What Id reference to Account Object. When I select Option Source for the field to be Model, it doesn’t give me any option for the models for Account.

This topic has been closed for replies.

5 replies

Forum|alt.badge.img+20

Is this what you want?


Forum|alt.badge.img+1
  • Author
  • July 9, 2024

Nope. We have ‘option source’ in the Search properties of the fields. When I select the Option source as Model, I should get options to select the model. But I don’t see any option for Account Models


Forum|alt.badge.img+20

Oh I see. You want to limit to only Accounts for the whatid?


Forum|alt.badge.img+1
  • Author
  • July 9, 2024

yes.


Forum|alt.badge.img+20

Here’s the snippet you need for this for this as to be custom rendered.

// Define the possible target objects var targetObjects = ['Account']; // Render as a Picklist instead of an Autocomplete? var renderAsPicklist = false; var field = arguments[0], value = skuid.utils.decodeHTML(arguments[1]), metadata = field.metadata, $ = skuid.$; if (field.mode == 'edit') { // Limit the set of target objects var targets = [], uniqueTargets = {}; $.each(metadata.referenceTo,function(i,r){ if (($.inArray(r.objectName,targetObjects) != -1) && (!uniqueTargets[r.objectName])) { targets.push(r); uniqueTargets[r.objectName] = 1; if (targets.length == targetObjects.length) return false; } }); if (targets.length) { // Make this field render as a picklist? if (renderAsPicklist) field.options.type = 'REFPICK'; // Override the current referenceTo metadata.referenceTo.length = 0; metadata.ref = $.map(targets,function(targ){return targ.objectName;}).join(); metadata.referenceTo = targets; } } // Run the standard renderer skuid.ui.fieldRenderers[metadata.displaytype][field.mode](field,value);