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
RamyaKrishnaRamyaKrishna 

Required Field validation on Dynamic VF page.

HI,

I have 3 custom objects.

Object1:- It contains fields as Name (Auto), FieldName__c (Text), ObjectName__c(Text).

Name     FieldName__c            ObjectName__c

1 Item__c(lookup) object2

2             Color__c(Text)              object2

3             Size__c(Text)                 object2

like this i entered records.

Object3: It Contains fields as Name(auto), Item__c(Text), Required__c(Text).

Name         Item__c           Required__c

1 AC Color

2 FAN SIZE

 

With "object1" i constructed a new VF page dynamically using Wrapper class Functionality.

Initially all the fields on DVF is not required. This page Contains Item__c (lookup), color__c, Size__c fields and save button.

Now select Item__c value (AC) from the lookup then save.

Per Item "AC" Color is required. Here Color value is null.

So, i need to make that color field as required field with Red (Just like standard salesforce functionality).

Like this i need to perform the validation on my Dynamic VF page.

 

 

Please suggest me.

 

 

 

 

WillNWillN

Typically if you're using a custom controller, you'll need to do your field validation on the client using Javascript or similar.  I think that if you're using a standard controller, you have access to the default validation behavior.  With your use case, though, I'm not sure that'll work.