You need to sign in to do that
Don't have an account?
matthew.field
Assign recordtype based on picklist value on VF page
Hi All,
I have a VF page that will be used to enter incident reports into Salesforce. There are two recordtypes for incident reports. I am trying to figure out how to assign the recordtype based on the value of a picklist field (if Incident_Type__c = "Moisture", recordtype = "a", "b"), but I'm not sure exactly how to spell this out on the visualforce page.
Any help will be greatly appreciated.
Thanks,
Matt
I have a VF page that will be used to enter incident reports into Salesforce. There are two recordtypes for incident reports. I am trying to figure out how to assign the recordtype based on the value of a picklist field (if Incident_Type__c = "Moisture", recordtype = "a", "b"), but I'm not sure exactly how to spell this out on the visualforce page.
Any help will be greatly appreciated.
Thanks,
Matt
Here is one sample. Let me know if this helps.
I have a picklist field Type__c in Account. If the selected value for Type is 'Type 1' then the account record type is 'a' and the record type is 'b' otherwise.
Here is the simple VF, Here is the corresponding controller extension, I have trimmed it down to only parts relevant to your requirement.
As you are using a VF page is have put this logic to the controller itself. However this is also possible using workflow. But workflow has a limitation in terms of querying to the RecordType object. So you need to hard code the recordtypeid in the workflow field update action.
--Akram