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
Lawrence PetersLawrence Peters 

Force a data record to be created based on Picklist value

Hi,

I have a situation where I would want that a record be created on related Custom object based on a picklist value on a certain field on the Opportunity Object. The two objects are not master detail.

It is a kind on validation rule but not on a field but on another object where the record has to be created.

Please can someone help.

 
Lawrence PetersLawrence Peters
So basically I want that the User is forced to enter a record on a related object if a ceratin picklist value is chosen.
Pankaj_GanwaniPankaj_Ganwani
Hi,

Can't we automate this process using Process builder or trigger instead of forcing the user every time for creating the record due to change?

Thanks,
Pankaj
Lawrence PetersLawrence Peters
I believe I have not been able to explain my question properly. Let me put this in more detail. I have a Picklist field on Opportunity object which called as barrier to sale. This field has many values. But when the user chooses Price as picklist value then they should not be able to save a record until they enter a record on a related object called competitor price. I hope this helps to make it more clear. The competitor price is a custom object which is related to the opportunity as lookup. So the competitor price object has a field called opportunity.

 
Pankaj_GanwaniPankaj_Ganwani
Hi,

I believe there is no straightforward solution through which we can achieve this functionality. The only solution I can think of is to use the combination of both Validation Rule and Process Builder with record creation. Just create essential fields related to price on Opportunity object and force the user to populate their values when picklist field value is changed to Price(ISPICKVAL(pick__c,'Price')). This operation can be done through validation rule.

Once user will be able to save the records, use process builder to create the related records and map the values of fields on Opportunity with your custom object fields(essential fields).

Thanks,
Pankaj