Required field value missing issue

  • 1
  • Question
  • Updated 3 years ago
  • Answered
  • (Edited)
In my skuid application page, i have a required field in object that comes under managed package. with out giving any values when i click on save button, its not showing any error message like "Required field value is missing". how to achieve this error message using field render or any idea.
Photo of raj

raj

  • 840 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Does the managed package make the field required at the database level, or are they using login within a VF page to indiciate that values are missing.  Hopefully not the latter. 

If the latter, you might be able to add some validation rules in Salesforce or even write some javascript in Skuid to detect the blank and publish an error message. 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I think Raymond pointed you to a post where a snippet showed a custom error message:  Here it is again. https://community.skuidify.com/skuid/topics/display-error-message-using-a-skuid-snippet-editor-undef...
Photo of raj

raj

  • 840 Points 500 badge 2x thumb
Rob, i am getting an error while displaying error message in my snippet.

var editor = pageTitle.data('object').editor;" sections gives an error message like"TypeError: pageTitle.data(...) is undefined"

I have given Unique id key from
:  Page Title -> Advance -> Unique Id
Snippet:


var $ = skuid.$;
var pageTitle = $('New Application');
var editor = pageTitle.data('sk-20m1DL-160').editor;
var colmodel = skuid.model.getModel('Collateral');
var col = colmodel.getFirstRow();

if (col.clcommon__Collateral_Name__c === '' && col.clcommon__Collateral_Name__c === null) {

    editor.handleMessages(
        [{
            message: 'Please Enter Collateral name',
            severity: 'ERROR'
        }]
    );

    return false;
}

Another way i have written, but getting same error

var $ = skuid.$;
var pageTitle = $('sk-20m1DL-160');
var editor = pageTitle.data('clcommon__Collateral__c').editor;
var colmodel = skuid.model.getModel('Collateral');
var col = colmodel.getFirstRow();

if (col.clcommon__Collateral_Name__c === '' && col.clcommon__Collateral_Name__c === null) {

    editor.handleMessages(
        [{
            message: 'Please Enter Collateral name',
            severity: 'ERROR'
        }]
    );

    return false;
}
Photo of raj

raj

  • 840 Points 500 badge 2x thumb
Hi Rob, Now that exception is solved with this snippet. but it is not displaying any error message when i click on save button without enter any data.


var $ = skuid.$;
var pageTitle = $('#sk-20m1DL-160');
var editor = pageTitle.data('object').editor;
var colmodel = skuid.model.getModel('Collateral');
var col = colmodel.getFirstRow();

if (col.clcommon__Collateral_Name__c === '' || col.clcommon__Collateral_Name__c === null) {

    editor.handleMessages(
        [{
            message: 'Please Enter Collateral name',
            severity: 'ERROR'
        }]
    );

    return false;
}
Photo of raj

raj

  • 840 Points 500 badge 2x thumb
Thanks, Its working fine
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Glad you were able to figure it out.