function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abhiraj DattaAbhiraj Datta 

How can we validate some fields before loading a visualforce in Salesforce Lightning? This should not use On-click execute Javascript.

var countryCheck=record.FP_Enable_Credit_Assessment__c; 

var userCheck = '{!User.FP_Allow_Credit_Assessment__c}'; 

if(userCheck == true) 
{ 
   if(countryCheck == 'true') 
   { 
   //Load the visualforce page 
   }  
   else 
   { 
   alert('Quick Credit Assessment is not yet enabled for this country.');
   }
}
else
{
alert('You do not have permission to run the Quick Credit Assessment'); 
}

I want to implement something like this in lightning. But without Javascript. Please help. Thanks!