You need to sign in to do that
Don't have an account?
Nitish Singh 22
How to open Contact Object page layout from visual force page
I have a page layout named "User_ContactLayout" for Contact object. I want to open this as a tab on my service console on click of a button on the visual force page.
Try this code. Onclick of the button, you need to call this piece of code.
All Answers
Are you trying to open a Contact record using this page layout? Or, you want to edit the page layout on click of a button?
If you are trying to open a Contact record, you can create a PageReference in an APEX method and call it on click of a button.
Like the following. contactID in th above code is your ID of the contact record. You need to make sure this record uses the above mentioned Page Layout for the user.
Hope this helps.
Anyways, you can try to copy it from Address bar (by editing the Pagelayout manually) and use it in the above Page Reference Code.
Let me know how it goes.
I am looking to open the Contact edit page from where the details to add new contact can be enterred
This page to add new contact , i am trying topen as a subatb on service console from another vf page
Try this code. Onclick of the button, you need to call this piece of code.
You can copy the "Relative URL" from the address bar.
what is the url that i should be passing. currently i did somethimg like this :
sforce.console.openSubtab(primaryTabId , 'https://cs17.salesforce.com/003/e?retURL=%2F003%2Fo', false,
'salesforce', null, openSuccess, 'salesforceSubtab');
this is opening a blank tab for me
Thanks for your help. It works