I want a custom button on a related list called 'Associated Facility' of Account to create Opportunity and this button should behave exactly like a standard 'New Opportunity' button.
I have created a Custom button as List button and used the below formula in the formula editor, but here the problem is the value in the Account lookup field for new Opportunity which is getting populated as constant value for every new opportunity:
{!URLFOR("https://cs45.salesforce.com/setup/ui/recordtypeselect.jsp?ent=Opportunity&retURL=%2F0018A000008TiIA&save_new_url=%2F006%2Fe%3FretURL%3D%252F0018A000008TiIA%26accid%3D0018A000008TiIA")}
Anyone please suggest a solution for this problem.