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
Aishwarya11Aishwarya11 

Create Button on Contact object .If Account field is not empty throw an error else navigate to any page.

ANUTEJANUTEJ (Salesforce Developers) 
Hi Aishwarya,

As stated in other question can you try checking as mentioned by karan:

You can create Lightning component-based quick actions for this purpose. https://www.biswajeetsamal.com/blog/tag/quick-action/

Let me know if this helps.

Regards,
Anutej
Aishwarya11Aishwarya11
Hi Anutej,

Actually i have created Button using <lightning:button> onclick it is navigating to url. 

My issue is how do i check whether contact related Account field has value or not . 

I have  written Apex class and fetched contact related account.


Thank you....
ANUTEJANUTEJ (Salesforce Developers) 
Sorry but on button click you would be navigating to a URL right before that will it not be possible to just validate the value?
Aishwarya11Aishwarya11
I have less experience in lightning. Don't know we can validate or not.

can we use if condition in helper function and controller function ?