1

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.

  • If you override the New button make sure the "Skip record type selection page" is not checked...The edit button, typical pattern is to use the Recordtype field on the VF page if you want to give the ability to change it – Eric Nov 12 '15 at 14:15
1

Try this:

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

  • without any context or explanation, this answer does not prove very useful. – glls Feb 23 '18 at 14:07
  • Works for me. Although it does not return any result when running it in packaging org. It must be because "CustomObjectUserLicenseMetrics" does not have any license info in packaging org. YOUR_OBJECT_NAME must be the name without __c. For example if the object name is myNamespace__Object_Name__c. Them pass "Object_Name" to above query – Mitesh Sura Nov 5 '18 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.