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
@Sunny@Sunny 

Making Filed Required based on lookup selection in visualforce

Hi all,

I have one custom page in that i have one lookup field and one text filed .

I have one requirement if we select look up  name as "ABC" then i want make the text filed required.

Thanks in advance
Best Answer chosen by @Sunny
Ashish_SFDCAshish_SFDC
Hi Sunil,


You can write a validation rule.

If ( AND ( Lookup field = ABC ,Text Field = Blank ) )

Throw error.


Regards,
Ashish

All Answers

Ashish_SFDCAshish_SFDC
Hi Sunil,


You can write a validation rule.

If ( AND ( Lookup field = ABC ,Text Field = Blank ) )

Throw error.


Regards,
Ashish
This was selected as the best answer
@Sunny@Sunny
Thanks ashish that was perfect.