• jimmijamz
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 9
    Replies

I've been trying for the past few days trying to get my head around all the javascript coding as i'm not a developer.

I've managed to APPROVE & REJECT and also submit approvals however, i can't seem to Reassign Approvals to other people via coding! HELP!


Below is my code for Approving a request. What is it for Reassignment?

is action = "Reassign";
on the API documentation, and also the WDSL,    nextApproverIds is actually a string() array



Code:
var request = new sforce.ProcessWorkitemRequest();
request.action = "Approve";
request.workitemId = workItemIds[i].Id; <-- this is ProcessInstanceWorkItemID
request.comments = "This approval request has been automatically 'APPROVED' via SQL Account Transfer Process";
debug(request.workitemId);
var proResults = sforce.connection.process([request]);

 


I've managed an extraction once.. and now every time i try to login using the dataloader command line it gives me the error below.



Code:
2007-08-08 16:49:56,976 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:71) - Commons Collections 3
.x available
2007-08-08 16:49:58,429 INFO  [csvExp_UserHR] controller.Controller initConfig (Controller.java:343) - The controller co
nfig has been initialized
2007-08-08 16:49:58,445 INFO  [csvExp_UserHR] process.ProcessRunner run (ProcessRunner.java:102) - Initializing process
engine
2007-08-08 16:49:58,445 INFO  [csvExp_UserHR] process.ProcessRunner run (ProcessRunner.java:105) - Loading parameters
2007-08-08 16:49:58,445 ERROR [csvExp_UserHR] config.Config decryptProperty (Config.java:640) - Error loading parameter:
 sfdc.password of type: java.lang.String
javax.crypto.BadPaddingException: Given final block not properly padded
        at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
        at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
        at com.sun.crypto.provider.DESCipher.engineDoFinal(DashoA12275)
        at javax.crypto.Cipher.doFinal(DashoA12275)
        at com.salesforce.lexiloader.security.EncryptionUtil.decryptString(EncryptionUtil.java:197)
        at com.salesforce.lexiloader.config.Config.decryptProperty(Config.java:634)
        at com.salesforce.lexiloader.config.Config.postLoad(Config.java:586)
        at com.salesforce.lexiloader.config.Config.loadParameterOverrides(Config.java:612)
        at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.java:106)
        at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.java:228)
2007-08-08 16:49:58,445 FATAL [csvExp_UserHR] process.ProcessRunner run (ProcessRunner.java:156) - Error loading paramet
er: sfdc.password of type: java.lang.String

 
This is my code from the process-conf.xml file.
Code:
   <entry key="sfdc.username" value="nztram@myco.com.au"/>
   <entry key="sfdc.password" value="a8e0e61348d01860d7a63a11e8eca6b5f80a8187cf4ee"/>
   <entry key="process.encryptionKeyFile" value="C:\Eclipse\dataload9\conf\key_NZJimmy.txt"/>

i got my usual salesforce.com password and generated a key.
encrypt -g  'mypassword'         = result                    - i put this in a keyfile.txt and in the conf directory.
then i used that result and encrypted once again
encrypt -e  'result'    = 'longer result string'

Using the 'long result string'   i place that into the password section...

where am i going wrong? somebody please help!


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


I've been trying for the past few days trying to get my head around all the javascript coding as i'm not a developer.

I've managed to APPROVE & REJECT and also submit approvals however, i can't seem to Reassign Approvals to other people via coding! HELP!


Below is my code for Approving a request. What is it for Reassignment?

is action = "Reassign";
on the API documentation, and also the WDSL,    nextApproverIds is actually a string() array



Code:
var request = new sforce.ProcessWorkitemRequest();
request.action = "Approve";
request.workitemId = workItemIds[i].Id; <-- this is ProcessInstanceWorkItemID
request.comments = "This approval request has been automatically 'APPROVED' via SQL Account Transfer Process";
debug(request.workitemId);
var proResults = sforce.connection.process([request]);

 


Is there a bug in processSubmitRequest?  I have a process that requires the  approver to be manually chosen but when I run the processSubmitRequest on this I get an error saying a required field is missing.  If I try to set the nextOwnerId it doesn't work either.  Is this a bug or if manual requests are not supported is there a graceful way to determine this and report it back to users instead of displaying a message implying a field is missing?  Here is the syntax:
 
Code:
var request = new sforce.ProcessSubmitRequest();
request.objectId = id;
//request.nextOwnerId = approverIds;
//request.comment = "Test Process Submit Request";

var requests = new Array(1);
requests[0] = request;

var results = sforce.connection.process(requests);

 
 
 
I've managed an extraction once.. and now every time i try to login using the dataloader command line it gives me the error below.



Code:
2007-08-08 16:49:56,976 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:71) - Commons Collections 3
.x available
2007-08-08 16:49:58,429 INFO  [csvExp_UserHR] controller.Controller initConfig (Controller.java:343) - The controller co
nfig has been initialized
2007-08-08 16:49:58,445 INFO  [csvExp_UserHR] process.ProcessRunner run (ProcessRunner.java:102) - Initializing process
engine
2007-08-08 16:49:58,445 INFO  [csvExp_UserHR] process.ProcessRunner run (ProcessRunner.java:105) - Loading parameters
2007-08-08 16:49:58,445 ERROR [csvExp_UserHR] config.Config decryptProperty (Config.java:640) - Error loading parameter:
 sfdc.password of type: java.lang.String
javax.crypto.BadPaddingException: Given final block not properly padded
        at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
        at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
        at com.sun.crypto.provider.DESCipher.engineDoFinal(DashoA12275)
        at javax.crypto.Cipher.doFinal(DashoA12275)
        at com.salesforce.lexiloader.security.EncryptionUtil.decryptString(EncryptionUtil.java:197)
        at com.salesforce.lexiloader.config.Config.decryptProperty(Config.java:634)
        at com.salesforce.lexiloader.config.Config.postLoad(Config.java:586)
        at com.salesforce.lexiloader.config.Config.loadParameterOverrides(Config.java:612)
        at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.java:106)
        at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.java:228)
2007-08-08 16:49:58,445 FATAL [csvExp_UserHR] process.ProcessRunner run (ProcessRunner.java:156) - Error loading paramet
er: sfdc.password of type: java.lang.String

 
This is my code from the process-conf.xml file.
Code:
   <entry key="sfdc.username" value="nztram@myco.com.au"/>
   <entry key="sfdc.password" value="a8e0e61348d01860d7a63a11e8eca6b5f80a8187cf4ee"/>
   <entry key="process.encryptionKeyFile" value="C:\Eclipse\dataload9\conf\key_NZJimmy.txt"/>

i got my usual salesforce.com password and generated a key.
encrypt -g  'mypassword'         = result                    - i put this in a keyfile.txt and in the conf directory.
then i used that result and encrypted once again
encrypt -e  'result'    = 'longer result string'

Using the 'long result string'   i place that into the password section...

where am i going wrong? somebody please help!


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

is it possible to lock/unlock and approve/reject records programamatically?  if so, how?  if not, is this a planned enhancement?

thanks in advance
I have been looking for, and unable to find, any examples of how to setup an automated extraction process.
 
I have successfully ran the CLI from the Appexchange Data Loader and have seen results in .CSV files. 
 
I really have no clue on how or what to put in a .BAT file or .SH file (we are going to be moving this application to a linux box)
 
Can someone please point me in the right direction or post an example process/tutorial on how this is done
 
I have checked both the blog linik >  http://blog.sforce.com/sforce/2005/06/sforce_data_loa.html and the .PDF document, there are no examples here, infact the documentation is not really clear and the blog has not been updated lately.
 
Any help would be appreciated!
 
Thanks
Mike