You need to sign in to do that
Don't have an account?
Ab
overriding button "create" and display it after the tab is opened for specific profiles
Hello,
When weland on page, there is a button called "create case" which is default button,
I want to override this button only for specific profiles, i will use a custom button intead..
how is it possible ?
When weland on page, there is a button called "create case" which is default button,
I want to override this button only for specific profiles, i will use a custom button intead..
how is it possible ?
The below code should work out for you :
All Answers
For the above functionality u need to check the profile of logged in user and then redirect them(if they fall under your specified profiles list)
Something like the below code:
Public Id PId;
Public PageReference pgRef;
Public Profile pName;
public CreateNewAccountPage_Controller(ApexPages.StandardController controller) {
PId=UserInfo.getProfileId();
pName=[Select Name From Profile Where id=:PId];
}
Public PageReference Redirect(){
if(pName.Name=='System Administrator')
{
pgRef= page.RequestAccessForAccount;
}
else {
PageReference returnPage = new PageReference('Some other page');
Hope this helps you
I want to redirect to creation of case (new case)
What page i can use for that ?
public PageReference NewImplementation() {
PageReference caspg= new PageReference ('/500/e?nooverride=1');
caspg.setRedirect(true);
return caspg;
}
https://developer.salesforce.com/forums/ForumsMain?id=9060G000000XixDQAS
Code is here
but by doing this it redirect to the case creation page but it always redirects to the default case record type.
it does not allow chance for other record type creation.
If i am not wrong it should redirect the user to the record type selection page and the user should have the feasibility of selecting the recordtypes !!
testing results
1) when "Skip Record Type Selection Page" is checked in the button override
Result: the record selection page is displayed and give user to choose the record types avaimanble for him, the user selects one of the record type:
Probem: irrespective of record selected, it will create only the default record type
2) when "Skip Record Type Selection Page" is not checked in the button override
user clicks on create case button, he is directly redirected to the case creation edit page by default with the default page.
For my usecase, i want 1 type of use case where user get to select the record type and the record type is getting created.
The below code should work out for you :