Hi,
I have a requirement of getting a Reference field as a Picklist on ‘edit’ mode and Completely removing/disabling the hyperlink (to native salesforce UI) on ‘read’ and ‘readonly’ mode using javascript snippet.
I wrote following snippet to address the issue:
field = arguments[0],
value = arguments[1],
$ = skuid.$;
skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field, value);
//If we are in edit mode render the reference field as pick list
if(field.mode === ‘edit’) {
field.options.type = ‘REFPICK’;
skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field, value);
}
// If we’re in read or readonly mode, then remove hyperlink
if (field.mode !== ‘edit’) {
var linkTag = $(‘a’, field.element);
if(linkTag.length){
var output = $(‘
output.append(linkTag.html());
}
linkTag.replaceWith(output);
}
This code works fine in all scenarios except ‘edit and cancel’ scenario. When I edit a record (inline edit ) and cancel without saving it the hyperlink reappears !
Is there any way around it?
Thanks!
-Jnanendra