function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jimmijamzjimmijamz 

Javascript programming help! how to call the 'process' function. automate APPROVAL

Hello,

let me say outright that i'm not a programmer, but i am able to read and cut back code. :)

i'm writing an scontrol and am trying to call the method 'process'. I've looked at the examples and read at the API documentation.. and also the AJAX Toolkit Dev guide, (which makes little sense to a non programmer) ;) Since it was in java & c+

and i thought this would be the way to translate into javascript

Code:
var reqst = new sforce.ProcessSubmitRequest();
reqst.objectID = 'case ids from array[i]'
reqst.nextOwnerId = 'approver ids'
reqst.comment = "Please update ASAP";
// var proResult = sforce.process(new ProcessSubmitRequest() reqst);

1. Create a new object of ProcessSubmitRequest
2. define the arguements.
3. call the process method.. (except i have no idea how to write the syntax -- and for the life of me.. i cannot seem to figure it out. Can somebody help me please! I've commented the line as it is definately wrong.

I assume ProcessWorkItemRequest would be in the same syntax.. but i just dont quite get it?

Message Edited by jimmijamz on 08-03-2007 04:48 AM

jimmijamzjimmijamz
anyone who is interested in the answer, i just found it after 3 days of headache

Code:
var reqst = new sforce.ProcessSubmitRequest();
reqst.objectID = 'case ids from array[i]'
//reqst.nextOwnerId = 'approver ids'
//reqst.comment = "Please update ASAP";
 var proResult = sforce.process([reqst]);

 Note: NextOwner cannot be included, or comments cannot be include on a processSubmitRequest command.
And the final line need only include whatever the  'request' is surrounded by '[' & ']' ... not using () or {}



jimmijamzjimmijamz

Question:
How does a newbie like me, find out all the  syntax, arguments of say this method 'process'
I did not know that ProcessSubmitRequest() only needs a  ID to be inserted.
Where can i find information about this class/ method/ object??


AND

how do i find out, what other methods can be performed on the ResultSets?
SuperfellSuperfell
See the API docs on the Wiki
jimmijamzjimmijamz
Hi Simon,

Here's my dilemma. I've looked at the API docs on the Wiki and still dont really understand it as i dont have a programming background..

It says to perform the command...
sfdc.process(processType processRequest[])

The arguments for    ProcessSubmitRequest()       presents 3. Objectid, nextOwnerId and comment.
That's why i initially wrote my code as i did in my first post.


Create a new instance of ProcessSubmitRequest and  assign values to each of its arguements.
Then try to perform the process  command. Little did i know that the ProcessSubmitRequest() only requires a   'Objectid' and not the other two!!!

Having said that, where can i find in the Wiki, or is there a command in the API (like the describeOject command) which can show me the usages of 'process'/ ProcessSubmitRequest() and the arguements i can pass to it.

I apologise if i mixed up the programming terminologies for the teckies... please bear with me. ;)