You need to sign in to do that
Don't have an account?
maddukuri
Case Button
Hi,
On the case detail page, there is a button A. If any person other than the case owner clicks the button, an error message should pop up. Can anybody tell me how to accomplish this? Thanks in advance.
Hi
make a page . and overide that page with bottom
here is my page and extension
<apex:page StandardController="Case" extensions="CaseExtension">
<apex:form >
<apex:pageMessages />
</apex:form>
</apex:page>
public class CaseExtension {
public Id caseid{get;set;}
public CaseExtension(ApexPages.StandardController controller){
caseid = controller.getId();
System.debug('################3username#########'+UserInfo.getUserId());
System.debug('################3Recordid#########'+controller.getId());
Case caseowner = [select id,OwnerId from Case where id =:caseid];
System.debug('################Caseowner#########'+caseowner.OwnerId );
if(UserInfo.getUserId() != caseowner.OwnerId){
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.Error, 'You are not allowed to click this bottom.' );
ApexPages.addMessage(myMsg);
system.debug('MyMsg:'+myMsg);
}
else{
PageReference samepage= new PageReference('/'+caseid+'/e?retURL=%2'+caseid);
}
}
}
some part is not working... I have sloved up to user shows error if he is not owner . Now I am continueing owner part .
did this post answers your questions please mark it solved
thanks
asish
Thank You Very Much for your time. I will try it out.