You need to sign in to do that
Don't have an account?
sangam vv
Friends i am stuck in java script button validation Rule?
I have Doctor Object in that i have status (picklist) field.
In detail page button I want to Send someting(Email) when Status is available
or else if status is Blocked i want to show error message
In detail page button I want to Send someting(Email) when Status is available
or else if status is Blocked i want to show error message
Please try this. Validation is on Opprotunities' stage fiels. Please change accrodingly.
Hope it will help you.
Thanks,
Sumit Kuamr Singh
Here i want to send one pdf attachment
As 'Sumit' said the js condtions is right. and now implement logic for "send email" section sending you need to call the apex web service class by using sforce .
var callback = {
onSuccess:function(result){ alert(result); },
onFailure:function(error){ alert(error);}
};
try{
var res = sforce.apex.execute('ApexClassName','MethodName',{Id: '{!Opportunity.id}'}, callback);
response = res;
}catch(err){
response = err;
} don't run as it is code. This code have some Pseudo code so change code according to your requirement.
If this post solves your problem kindly mark it as solution.
Thanks.
scenario:
Object 1 have 3 records i need to create 1 button submit for approval if i click that button if the status is approvred then i want to send attachment
if the status is pending Popup 1 error messge. how to do in Java script
You have opportunity ID in the method - make a query -
Opprorunity o = [Select StageName from Opporttunity where Id : Id]
....
..
//Here check whether to send the attachment or ont?
if(o.StageName.equalsIgnoreCase('MtStageName')) {
email.setFileAttachments(fileAttachments);
}