WE have a requirement to relate a record to another record(lookup Field) when the value of pick list is changed to a certain value.

we have an object called listing which has the pick list "status" with values Sold , Reserved and cancelled. when the user selects Reserved then a lookup input field must be displayed for the user to select a riskprofile(another custom object related via lookup). And again after 4 days if it is sold then user changes to "Sold" and nothing is to be done. but if it is cancelled then the user changes the status to cancelled. then this relation must be deleted. can anyone suggest the way to achieve this?

  • Do you have some code to show us ?
    – SF_user
    Sep 26, 2014 at 7:07

1 Answer 1


Your first requirement could be resolved by creating a workflow rule + field update that changes the record type when Status is changed to "Reserved". Assign a different page layout for this specific record type where you show the lookup field. The disadvantage of this is that user first needs to save the record, before being able to see and fill in the lookup field. If this is unacceptable, you should look into a Visualforce page.

When "Cancelled" is chosen, you could use a similar logic to flip back to the original record type and page layout. To delete the value in the lookup field, you could use a flow trigger. Another solution would be to use a trigger for this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .