skuid field empty or not checking in a javascript snippet

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I have a javascript button working fine.Now I want to check some skuid fields before  weather they are empty .If they are filled only then the javascript button should work.

Here is my code 

var applicationModel = skuid.model.getModel('Application');//alert("applicationModel "+applicationModel);
var applicationRow =  applicationModel.data[0];

var appId =applicationRow.Id;

var stat=applicationRow.;

var agree = confirm("Are you sure ?");

if (agree){
  */
I want to check fields e.g genesis.application.status__c is empty or NOT

  */
    var retVal = sforce.apex.execute("DemooOrgUtils","borrowerAccepted",{app:appId}); 
    alert("retVal"+ retVal);
    window.location.reload();
    }
    
Photo of Raya Banerjee

Raya Banerjee

  • 456 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
if (agree){
   // Check if Application Status is empty
   if (!applicationRow.genesis__Application_Status__c) {
      // Status is empty
   } else { 
      // Status has a value
   }
}