Skip to main content

I have a picklist that lets the sales reps choose an opportunity scope (field name Objective__c).  Based on the selection, different fields display, and default values are set.

The snippet that sets these default values works correctly the first time you select any option.

But once you select Default (simplest, fewest fields), and then switch back to any other option, the ui does not update, and there is an error in the console:

Uncaught TypeError: Cannot read property ‘Id’ of undefined

Here’s the skuid function that fails:


function Y(a) {&nbsp; &nbsp; &nbsp; &nbsp; var b, d, e = a,0], f = {};<br>&nbsp; &nbsp; &nbsp; &nbsp; return a.length &lt; 2 ? !1 : (c(a 1]) ? (d = {},<br>&nbsp; &nbsp; &nbsp; &nbsp; dnas1]] = a12],<br>&nbsp; &nbsp; &nbsp; &nbsp; b = a;3]) : (d = a 1],<br>&nbsp; &nbsp; &nbsp; &nbsp; b = a;2]),<br>&nbsp; &nbsp; &nbsp; &nbsp; fne.Id] = d,<br>&nbsp; &nbsp; &nbsp; &nbsp; this.updates = f,<br>&nbsp; &nbsp; &nbsp; &nbsp; void (this.options = b))<br>&nbsp; &nbsp; }<br>


Specifically the error points to:
f
None of the fields that get defaults are rendered until after the objective is selected. 

Figured it out.  When “Default” was selected, the snippet was cancelling the other models.


Reply