Answered by:
CRM 2013 - Execute WorkFlow via Javascript

Question
-
Hi
I have a workflow that will automatically send a email when a certain condition is met
However I was wondering if it was possible to have javascript open a message box stating
Do you want to send a email Yes/Cancel
If yes is clicked only then will the workflow for sending the email start
Thanks. Shaun
S.Harrison
Wednesday, July 23, 2014 8:57 AM
Answers
-
Hi Shaun,
Sorry, didn't notice you're using CRM 2013. The code in the link wont work, since it contains 2007 endpoint references which were removed in CRM 2013.
Could you try the answer code in this once?
- Marked as answer by Shaun Harrison Wednesday, July 23, 2014 11:00 AM
Wednesday, July 23, 2014 10:26 AM -
Hi Dynamotion
I've just figured a work around for the problem
I implemented a confirm dialog for on save for the form, if the user clicks yes then a value of 1 goes into a new field I've just created
Then within the workflow process the step is that the email sends if the field value is 1, and the automatic process is set to the newly field value being changed and it all works fine.
Thanks for all your help
Shaun
S.Harrison
- Marked as answer by Shaun Harrison Wednesday, July 23, 2014 11:00 AM
Wednesday, July 23, 2014 10:29 AM
All replies
-
Hi Shaun,
Yes, you can trigger a workflow from JavaScript. Have a look here. You could have a command bar button that gives you a JavaScript Confirm box and when you click on OK, the workflow will be triggered.
Wednesday, July 23, 2014 9:11 AM -
Hi Dynamotion,
Thanks for you reply
Within the code do you have any idea what the function
GenerateAuthenticationHeader()
Is used for?
Thanks, Shaun
S.Harrison
Wednesday, July 23, 2014 9:43 AM -
Hi Shaun,
Since the request is a SOAP one, the GenerateAuthenticationHeader() method creates the header to authenticate the request (as the name implies). You don't need any implementation for that method, it's fetched from the CRM Page.
Wednesday, July 23, 2014 9:48 AM -
Hi
The error I had was that GenerateAuthenticationHeader() is undefined
From what your saying I just need to put
function GenerateAuthenticationHeader()
{
}
in the code?
Thanks, Shaun
S.Harrison
Wednesday, July 23, 2014 9:56 AM -
Hi Shaun,
Sorry, didn't notice you're using CRM 2013. The code in the link wont work, since it contains 2007 endpoint references which were removed in CRM 2013.
Could you try the answer code in this once?
- Marked as answer by Shaun Harrison Wednesday, July 23, 2014 11:00 AM
Wednesday, July 23, 2014 10:26 AM -
Hi Dynamotion
I've just figured a work around for the problem
I implemented a confirm dialog for on save for the form, if the user clicks yes then a value of 1 goes into a new field I've just created
Then within the workflow process the step is that the email sends if the field value is 1, and the automatic process is set to the newly field value being changed and it all works fine.
Thanks for all your help
Shaun
S.Harrison
- Marked as answer by Shaun Harrison Wednesday, July 23, 2014 11:00 AM
Wednesday, July 23, 2014 10:29 AM