I have a library which has an InfoPath form as its content type with a custom workflow built into it (example of workflow in my other question ages ago: Are sharepoint workflows always sequential?) Unfortunately, the way it has been moved into "Production" means that every time I want to update the form and publish it, the old version is overwritten and ALL old forms start to adhere to the new one.

I have a requirement to provide a way to update two fields to a few users. I thought to go the easier way by providing a custom button to those users (they have unique permissions than the other users so I can limit access to the button) and call a custom edit form that provides ONLY those two fields for update purposes. This I have done successfully and the fields are being updated.

Another of those requirement is to send an email to people working on that particular form depending on the said edited fields. Because I have an already working workflow on this library which is initiated at new and edit modes and because the need for this workflow is ONLY when these fields are edited out of turn, I wanted to start the workflow on submission of the custom edit form. I have tried the spServices method (somehow I cannot get the reference of the workflow from it) and then tried the javascript: {ddwrt:GenFireServerEvent(.... method which is also giving me problems.

I got the way the workflow is started manually which gives me the workflow ID and the list ID:


This also confirms the list ID:

enter image description here

If I follow the instructions provided here: http://ivobouwman.net/2011/03/18/pass-a-listitemid-to-sharepoint-workflow/ I wrote in the following code on the SUBMIT button's onclick (Item ID is hardCoded for now):

"javascript: {ddwrt:GenFireServerEvent(concat('__workflowStart={{80ccf882-4b22-4455-8953-44f17688567f},New,{65616702-f9a2-41a6-8d88-92e07d2ba4a0},ItemId=54213',@ID,'}'))}; window.close();"

I get the following error:

enter image description here

I tried changing the ID's with each other, which still gives me an error. I don;t know what I am doing wrong. What are the parameters of __workflowStart?

Any help would be greatly appreciated!!

Edit: interchanging parameter 1 and 3 with each other like so:

javascript: {ddwrt:GenFireServerEvent(concat('__workflowStart={{65616702-f9a2-41a6-8d88-92e07d2ba4a0},New,{3a34298f-9d1c-4273-8b73-33b1c2ed431c},ItemId=54213',@ID,'}'))}; window.close();

Gives me this error: enter image description here

Why does it think I am trying to add to list instead of initiaing a new workflow?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.