You need to sign in to do that
Don't have an account?
Amar c
Need object record id with salesforce Urgent
HI I am stuck in a problem.I need code for get object record id with salesforce by this my problem will soved to redirect on record type... for example URL is
https://cs11.salesforce.com/abc?setupid=CustomObjects
I need abc by apex code not by visual force page.Is there any way to fetch this. Please some one rely on this.
what do you mean in apex code not in visualforce page?
in what context your apex code will run? (custom button/trigger/...) and how is that context related to this url?
code is something like this...
i have to open some record type page directly, so make Url we need custom object's ID.
I will override new button of custom object and by this visual force page's controller i will redirect on record type accoding to profile.
so to make recordtype URL i need this.because i have to skip on some caes recordtype selection page as well.
???
need any clerification?
Hi Amardeep
I'm sorry if i dont understand you correctly, but what i did understand is that you want to override the "new" button of an object and skip the record type selection, to automatically select it according to the user profile. hope i'm correct.
please see the solution below. its quite robust and you can always use a more hardcoded solution, but i dont advise that.
basically the solution is overriding the new button to a visualforce page (provided below with extension) and using a custom setting list table to hold a mapping of profile name to desired record type name (this way you can change mapping without deployment).
you can change the maaping to id for id and save some queries, but that will cause maintenance issues when transferring between environments.
and the page itself (please remember to change the standardController to your object).
The custom setting used is called - Profie RT Mapping (i dropped the "L" and didnt bother fixing, you can go ahead and get it right in table and code) - and it consists of a "Name" field (default for all custom settings) which holds the PROFILE name. and a "Record_Type_Name__c" name field (Text) which holds the relevant record type name.
i didnt bother with "return URL" for the page, or default maaping in case the profile isnt mapped - i think you can handle that the way you like.
Hope this helps.
dont hesitate the ask any questions.