I have one detail page where i have inserted inline VF page which is used for text search and save the results of text search into some custom field of detail VF page.There are few text fields inside inline Vf page.I want to make those fields mandatory inside inline VF page.is it possible.Or any other solution.

  • Can you post the inline VF and outside VF code ? – karthikselva Feb 25 '16 at 10:54

I can think of 4 options:

  1. Create a validation rule for new records.
  2. Use a Before Insert Trigger. Either of these two will cause the fields to become required.
  3. You can also add code to the inline VF fields to apply the required attribute before the page can be saved.

  4. Finally, if wrapped in a form tag, you can use the features from something like the jQuery validation plug-in that won't allow it to "submit" until those fields have been completed.

Since you've not provided code, those are the best options I can think of that would apply to the situation you've presented.

  • Door #3 methinks. – Adrian Larson Feb 25 '16 at 15:07
  • @AdrianLarson #3 would be my choice as well, but many people like smorgasbords. ;) – crmprogdev Feb 25 '16 at 15:10
  • Yes, it's the only way to answer such a question. – Adrian Larson Feb 25 '16 at 15:11

Yes. It is absolutely possible. You can make use of required attribute on text fields which will make the fields mandatory.Please find the screenshot which shows my test implemented inline contact's VF page where I have made Home Phone mandatory.

enter image description here

  • @shailesh-will those fields be visible in standard edit page.No right ? – Jack vardy Feb 25 '16 at 11:46
  • @RobertBarnett Sorry if I misunderstood the question. Could you please post some of your code? – Shailesh Patil Feb 25 '16 at 12:07
  • I have one standard page layout for creating a record in which i am adding inline VF page.Now when i am trying to create record that time inline Vf page wont be available.Once record is created then only we can see inline vf page as inline vf page is available on detail page only.So what i want is how to check for validation on fields of inline page while creating a new records. – Jack vardy Feb 25 '16 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.