+ 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.