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
rakiraki 

How to Save a record With out ValidationRule Fields on VF Page

I created a VF page With some inputfield components these fields don't have any validation rules but when i am trying to save the records after entering the details in it. I am getting an error MSG as

Insert failed. The first exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must review the preferences section before you can save this record.

 There are some validation rules on other fields in the same object. According to my requirement I don't want these validation fields on my VF page for now.

Devendra@SFDCDevendra@SFDC

 

Raki,

 

Validation rules gets executed on create/edit operations.

 

Validation rules gets invoked even though you are not using some fields(Fields which are causing validation errors) on VF page.

 

Hope this helps :)

 

Thanks,

Devendra

rakiraki

Thanks Devendra 

but im getting error msg

Im pulling some Custom fields from lead object to vf page when trying to save the page showing me with a error msg
Devendra@SFDCDevendra@SFDC

 

Raki,

 

Is there any validation rule which is causing a problem? Please check.

 

Thanks,

Devendra

rakiraki

yeah there are some validation rules in the object but im not using those fields

Devendra@SFDCDevendra@SFDC

Raki,

 

Validation Rules-

 

Validation rules apply to new and updated records for an object, even if the fields referenced in the validation rule are not included in a page layout or an API call. Validation rules don't apply if you create new records for an object with Quick Create. If your organization has multiple page layouts for the object on which you create a validation rule, verify that the validation rule functions as intended on each layout. If your organization has any integrations that use this object, verify that the validation rule functions as intended for each integration.

 

Here doc explains about using Pagelayout. Similarly validation rules get applied on visual force page event though you have not added particular field on the page.

 

Hope this helps :)

 

Thanks,

Devendra