You need to sign in to do that
Don't have an account?
kumarcrm bingi
I do not understand which list variable assigned the values were I am missing it's my code
global class SAPRequest{
WebService static void SendApprovalRequest(string id) {
// create the new approval request to submit
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setComments('Submitted for approval. Please approve.');
req.setObjectId(id);
req.setNextApproverIds(Id[]);
// submit the approval request for processing
Approval.ProcessResult result = Approval.Process(req);
// display if the reqeust was successful
System.debug('Submitted for approval successfully: '+result.isSuccess());
}
}
Error is showing Error: Compile Error: Missing ')' at '[' at line 10 column 27
Submitting an Account Record into an approval when the Account Rating on warm Approved send an email automatically
I do not understand which list variable assigned the values were I am missing it's my code
global class SAPRequest{
WebService static void SendApprovalRequest(string id) {
// create the new approval request to submit
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setComments('Submitted for approval. Please approve.');
req.setObjectId(id);
req.setNextApproverIds(Id[]);
// submit the approval request for processing
Approval.ProcessResult result = Approval.Process(req);
// display if the reqeust was successful
System.debug('Submitted for approval successfully: '+result.isSuccess());
}
}
Error is showing Error: Compile Error: Missing ')' at '[' at line 10 column 27
Try this code:
Let me know if it helps.
Thanks.
showing error Field Integrity Exception. can you please help me
It appears to be that the ID you are passing as an parameter is not a valid ID as per salesforce standard ID datatype. Make sure the ID you are passing is a valid ID. I might be able to help you if you could just show me the script on have written for your button.
Narender Singh(Nads),
This is my JavaScript code
{!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/24.0/apex.js")}
sforce.apex.execute("SAPRequest","SendApprovalRequest", {Id:"{!Account.Id}"});
window.alert("Record sent for approval" );
I think i found out what is causing this field integrity error.
setNextApproverIds() method accepts a list of IDs where these IDs are associated with a user. But in the code an account record ID is being inserted into the list ls. But the method is expecting an ID which is of User type. Hence the error.
Perform an SOQL to get the ID of the user who you want to be the next approver. Add that id to the ls list. And you are good to go.
Let me know if that helps
Thanks!
if you don't mind i am not get it . can you please right code some more please
Thank you
Giri Kumar
Try this: Let me know if it helps
Thanks!