I have a parent object Contract__c
and a child record Risk__c
.
The parent object has a picklist:
Classification: high, medium, low
Risk__c
has two record types high
and low
. The fields for these record types are different, and I have created a visualforce page for each record type, because I need to modify the save&new
functionality.
When the user enters high
on Contract__c
, the user needs to click on the related list button Create high risk
, which opens the high risk visualforce page. I have another button called Create medium risk
, which the user should click if medium
was selected in the classification
picklist.
The problem is, I want to only display the high button if high was selected in the picklist, and I want to be able to display the medium button, only if medium was selected. Is that possible?
Otherwise I would be happy to just have one button, which has some logic to decide which page to open. But I wouldn't know how to do that.
Tia.
Create X risk
button is a custom button why can't you just check the parent's picklist value before redirecting to the creation page? Something likeIF(ISPICKVAL(Classification, "high"), "VisualforcePage1", "VisualforcePage2")