error with snippet property "metadata.displaytype" after deploying to Lightning

  • 1
  • Question
  • Updated 12 months ago
  • In Progress
I'm migrating some pages to Lightning and am having an error where the browser (Chrome) doesn't seem to recognise a specific property in a snippet.

The error I'm getting is: 
"1. There was a problem rendering a component of type basicfieldeditor: dt is not defined"

The dt property refers to "metadata.displaytype" set in the snippet below:

//snippet to remove the parenthetical/converted value from a currency field
var field = arguments[0],
    value = arguments[1],
    metadata = field.metadata,
    curr = field.row.BuyCurrency__c;
    dt = metadata.displaytype; 
    $ = skuid.$;
   
if (field.mode !== 'edit' && value !== null) {
    field.metadata.displaytype = 'TEXT';
    var textvalue = value.toLocaleString('en', {style: 'currency', currency: curr});
    value = textvalue;
} else if (value === null) {
    field.mode = 'edit';
}
skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value);

This works fine in classic (deployed via VF page) but fails in Lightning (deployed with either Skuid page component, or within a Lightning Component).

Is this property available in lightning?
Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb

Posted 1 year ago

  • 1
Photo of Christine Jessen

Christine Jessen

  • 670 Points 500 badge 2x thumb
Greg -

I just tested this out and I am able to access this property in Lightning -

What Skuid version are you on?  

Did you generate a support file for this page?  
https://docs.skuid.com/v10.0.10/en/guide-dev/#how-skuid-accesses-your-custom-code

Thanks!
Christine
Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb
The problem seems to be intermittent and hasn't shown up for a week now. We are on Millau 11.0.1. I have re-generated the page support files and it seems to be working fine now.

Thanks