You need to sign in to do that
Don't have an account?

Beginner: New Record Button
Hi,
I'm making my first steps, and I'm running against a wall already. It feels like this should be very easy, but I can't find a way to do it at all.
I want to create a button on the Case page to create a new record (custom object) based on the case displayed. The most promising (if the word applies) description is a six-year-old post on how to do your very own URL rewriting, but that does not seem to apply on custom objects (or the description is simply out of date).
In my fantasy SF I'd use a custom action of type "Create a Record", and set some translation table for which data to set in the new record (if required at all, should be obvious really). For some reason, "Create a Record" is limited to very few objects, and has no way to seed data into the new record.
So where to start? Is there some piece of SF wisdom I've still to pick up, so that I can answer questions like this with a simple search in the documentation?
There is still a whole lot of SF I haven't even looked at, maybe the answer is simple. I'm supposed to learn Apex anyway, and always wanted to try Javascript, so if one of those is the best solution, then that's where I want to go. Again, where to start reading?
Thanks in advance!
Cheers,
Thorsten
I'm making my first steps, and I'm running against a wall already. It feels like this should be very easy, but I can't find a way to do it at all.
I want to create a button on the Case page to create a new record (custom object) based on the case displayed. The most promising (if the word applies) description is a six-year-old post on how to do your very own URL rewriting, but that does not seem to apply on custom objects (or the description is simply out of date).
In my fantasy SF I'd use a custom action of type "Create a Record", and set some translation table for which data to set in the new record (if required at all, should be obvious really). For some reason, "Create a Record" is limited to very few objects, and has no way to seed data into the new record.
So where to start? Is there some piece of SF wisdom I've still to pick up, so that I can answer questions like this with a simple search in the documentation?
There is still a whole lot of SF I haven't even looked at, maybe the answer is simple. I'm supposed to learn Apex anyway, and always wanted to try Javascript, so if one of those is the best solution, then that's where I want to go. Again, where to start reading?
Thanks in advance!
Cheers,
Thorsten
I am going by the first assumption that you want to create a record on click of a button.
Step 1. Create a Detail page button with Execute JavaScript.
Add this code into your button.
This button will call a class, in which you can pass case id. Perform your DML operation there and return a success or error message you want to display Class code to perform rest of the action. Create a class with the below details :- Note : - You can have your own name I used YourClassNames etc just for better understanding.
All Answers
I am going by the first assumption that you want to create a record on click of a button.
Step 1. Create a Detail page button with Execute JavaScript.
Add this code into your button.
This button will call a class, in which you can pass case id. Perform your DML operation there and return a success or error message you want to display Class code to perform rest of the action. Create a class with the below details :- Note : - You can have your own name I used YourClassNames etc just for better understanding.
Thank you very much for your help!