0

Can you set a default value to a lookup field based upon Record Type?

Essentially I have an Object, "Call". This is related to another custom object "Call Type". I have created Record Types on Call which determine the fields displayed to user. The Record Types directly relate to "Call Type" records so I would like to either:

  • Automatically assign a value to the Call Type based upon Record Type selection?
  • Select the Record Type based upon Call Type selection?

I think I did a render test using a VisualForce, could this be applied to the second option to filter the fields displayed to the user (sounds like more work).

FYI - screenshot of end result process builder http://awesomescreenshot.com/0105bvpv9d

  • What is the purpose of the child object call type? Typical this is done via a pick list not a related record. – Eric Oct 16 '15 at 21:46
  • Thanks,the Calls Type will hold fields determining things like owning department, SLA's, grouping etc and hopefully allow useful reporting. The Call itself is the call detail, related to contact amongst others - I asked a question about it here: salesforce.stackexchange.com/questions/95376/… – n34_panda Oct 16 '15 at 21:55
  • Ok, I can see how Process Builder can create a record with a specified call type but I am struggling with the first part. The process can kick off when a record is created/edited but I won't be creating any new call types (much) but calls often. I would need to execute the process when the create call action occurs?!! Sorry if I missed something obvious. – n34_panda Oct 16 '15 at 22:14
  • I do not think process builder can do it.....I think you will have to write a trigger to do it. Or a invokable method that process builder can use – Eric Oct 16 '15 at 22:24
  • No, you were right - the Process Builder can do it! Essentially I set the Call Object to execute on record create the action an "Update Record" action. I associated this to call, then set the criteria for updating records to filter based upon the Record Type ID (you need the 18char ID) followed by the final part which sets the Call Type field ID value as necessary...Works great in 3 tests I have done...thanks. If you want to create a true answer go ahead and I'll mark it up as complete. – n34_panda Oct 16 '15 at 22:39
1

I believe you can use process builder to set the association.

Create a field on the call type to hold the record type that the record will be used for

then use process builder to update the call lookup field based on the record type of the call and the associated call type....

Per your comment here is how you did it:

set the Call Object to execute on record create the action an "Update Record" action. I associated this to call, then set the criteria for updating records to filter based upon the Record Type ID (you need the 18char ID) followed by the final part which sets the Call Type field ID value as necessary

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.