Skip to main content

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.

Is this what you want?



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


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


yes.


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 = argumentst0], value = skuid.utils.decodeHTML(argumentst1]), 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) && (!uniqueTargetstr.objectName])) { targets.push(r); uniqueTargetstr.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.fieldRenderersrmetadata.displaytype]efield.mode](field,value);