[SalesForce] Get Custom Object full Id

I need help with an issue I'm facing. In short, I have created a Custom Object with two Record Types. Then created a tab for it and everything works as expected when creating/editing records. The problems start when I override the New/Edit buttons to redirect to my Custom Visualforce pages. I can't find a way to get the CustomObject full id to pass it to the 'ent' url parameter as in the standard page behavior of 'Save&New'. Below is the url from the standard page. I would greatly appreciate any help. Thank you!

https://eu5.salesforce.com/setup/ui/recordtypeselect.jsp?ent=01I24000001R1wj&retURL=%2Fa05%2Fo&save_new_url=%2Fa05%2Fe%3FretURL%3D%252Fa05%252Fo

I have found one solution here: Finding a Custom Object Id (01I…) to get the Setup page URL
But unfortunatelly it does not work for me.

Best Answer

Try this:

SELECT CustomObjectId FROM CustomObjectUserLicenseMetrics WHERE CustomObjectName ='[YOUR_OBJECT_NAME]'

Related Topic