You need to sign in to do that
Don't have an account?
shambavi
please help me on this...
Please create a Custom List View Button "New Case" that will pre-populate the Contact, Account, Email, based on the current logged in User if the User is external (community profile) and use the standard functionality if he is not
The contact field should be updated with $User.ContactID if the Record Type is Case from Communities
Thanks in Advance.......
Thanks & Regards
Gopal.
The contact field should be updated with $User.ContactID if the Record Type is Case from Communities
Thanks in Advance.......
Thanks & Regards
Gopal.
Hi Gopal,
The solution is listed below.
Step1: Create Custom list view button with JAVA Script
var url = parent.location.href;
window.location.href ='/apex/CaseCreateNew?retURL='+url;
Step 2: Create a VF Page with controller and 1 redirection method that will be called on page load
<apex:page controller="redirectTest" action="{!redirect}" > </apex:page>
Step 3: Define custom redirection in your with prepopulatedFields
public PageReference redirect() {
retURL= ApexPages.currentPage().getParameters().get('retURL');
//GET Current user detailas and gather all the required fields need to be prepopulated
if(Your_Condition){
/* Pre populate the fields */
return new PageReference('/500/e?retURL='+retURL+&def_contact_id=0032800000Bspze&def_account_id=0012800000EKNzT');
}else{ /* default create new page */
return new PageReference('/500/e?retURL='+retURL);
}
}
P.S: This can be done using JavaScript button as well, however using controller you will get more flexibility.
Please mark it, if it helps you.
Thanks and Regards,
Paras Bhatt
All Answers
Hi Gopal,
The solution is listed below.
Step1: Create Custom list view button with JAVA Script
var url = parent.location.href;
window.location.href ='/apex/CaseCreateNew?retURL='+url;
Step 2: Create a VF Page with controller and 1 redirection method that will be called on page load
<apex:page controller="redirectTest" action="{!redirect}" > </apex:page>
Step 3: Define custom redirection in your with prepopulatedFields
public PageReference redirect() {
retURL= ApexPages.currentPage().getParameters().get('retURL');
//GET Current user detailas and gather all the required fields need to be prepopulated
if(Your_Condition){
/* Pre populate the fields */
return new PageReference('/500/e?retURL='+retURL+&def_contact_id=0032800000Bspze&def_account_id=0012800000EKNzT');
}else{ /* default create new page */
return new PageReference('/500/e?retURL='+retURL);
}
}
P.S: This can be done using JavaScript button as well, however using controller you will get more flexibility.
Please mark it, if it helps you.
Thanks and Regards,
Paras Bhatt
Thank you for given reply, if passible could please share the code. Give me mis call on this number +91 9739969134.
Thanks & Regards
Gopal M.