function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Pass information from opportunity to custom object

I have a "Order" custom object hanging of an opportunity. What I need to do is have a custom button where I  click to create a new order object hanging of the opportunity. Now when the person is in the edit mode, I need to have the information from the opportunity fields already pre filled. Also, I would like information from the contact related to the opportunity prefilled in the edit mode.
I haven't written AJAX s-controls before, so please advise me, if this is possible, and if not what is the best work around? Also, what the best way to approach doing this?
Greg HGreg H
One option is to have your custom button on the Opportunity detail page.  Upon click of that button you could include any values you want displayed on the edit page of your custom object record in the URL of the click.
I suggest you search these message boards for passing field values in the URL of links because there should be a lot of posts on this topic.
Are you displaying your custom objects as a related list on the opportunity page layout?  If so, I would "override" the new button for your object to go to the same URL as when you create a new object but including the field values as Greg stated.
Although, if you have a custom tab for this object set up... then I'm not sure how that would behave when you click new on the tab or from the "create new" drop down in the sidebar...

My site has a decent walk through of creating custom links with images if you think that may help.