2

I am working on a project to manage the human ressources, well my question is: how can I control a picklist to create a new record. Exemple: I go to Application tab, wich contain a picklist, among values I choose 'Time Off'. I want to redirect me to create a Time Off form ( Start date , End date ... etc) on a object Time off that 've already created.

Thank you

4
  • I think you need to use record type insead of picklist.
    – D-Horse
    Mar 18, 2014 at 12:10
  • Okey I will try record type.. thank you for your answer
    – LoveLace
    Mar 18, 2014 at 13:56
  • This question is also posted to Stackoverflow. I think that here (Salesforce) is the best location for it.
    – Jagular
    Mar 18, 2014 at 15:34
  • Absolutely, I agree!
    – LoveLace
    Mar 19, 2014 at 11:15

1 Answer 1

1

Here's a link to one solution showing a button where the record type is being set instead of being allowed to default:

https://developer.salesforce.com/forums?id=906F00000008kdbIAA

The key is that parameter "p3" is the record type. You'll need to replace the code segment

"p3" = "012500000009Wjw"

with something like

"p3" = IF ( ISPICKVAL(TypeToCreate, "Time Off"), "<record type id of TimeOff>", "<default record type (or nest more IFs>")

You could also use Visualforce and Apex for this.

4
  • I didnt get this solution, can you please explain it further more
    – LoveLace
    Mar 18, 2014 at 15:37
  • I've assumed that you wanted to create the new record when the user makes a selection and then clicks on a button. Am I correct? If so, the code needs to be modified with your picklist values and record type IDs. Also, I've assumed only two record types in my example, TimeOff and default. Also, how many record types do you have?
    – Jagular
    Mar 18, 2014 at 15:45
  • Yes exactely! but how can I modifiy the 'save' button code behind in order to redirect me creat a time off new record!! Thank you
    – LoveLace
    Mar 19, 2014 at 12:34
  • I don't think you can change how the "save" button works without going to Visualforce/Apex. The code I reference would have to go into a custom button. You could call it "Create attached record" or whatever you like.
    – Jagular
    Mar 19, 2014 at 14:21

You must log in to answer this question.

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