You need to sign in to do that
Don't have an account?
Semira@gmail.com
change record type of a child based of parent's value
Hi folks,
I have a quick request. How would I go about chaning a record type of a child object depending on what the value of a picklist field on a parent object.
This should be done by Visualforce page because I'm trying to overwrite the New button on the child object. So that users won't have to sleect the record type.
Please help, this is a little urgent.
I have a quick request. How would I go about chaning a record type of a child object depending on what the value of a picklist field on a parent object.
This should be done by Visualforce page because I'm trying to overwrite the New button on the child object. So that users won't have to sleect the record type.
Please help, this is a little urgent.
I think you are clicking new Button from Related list of child object under the parent object. Correct me, if i am wrong.
Follow below steps:
1. You can create a new Button on child object as a "list button".
2. Give name and label for button
3. Select Content Source: URL
4. In the formula window,
/apex/name of page?RecordTypeID=value you want to set.
Regards
Mohit Bansal
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
You write a logic to query the parents List value and the Childs record type ID based on that.
New button does not allow you to write the formula or anything. It has to be Visualforce page. I am trying to overwrite the NEW button.
Sanjay,
Trigger only allows after you select the record type. I need to avoid having user to be able to select record type.
So They click new, it takes them directly to edit page with the selected Record type depending on a value of a field in parent record.
You can't add a custome button on a related list. Otherwise, I would have done that. I have tried creating a button and when I went to page layout to add the button on a related list, it doesn't give you any option.
Anyway, I think I found a way to overwrite the New button on obj B. but if you can find a way to create a button isntead, that's way better than coding.