locked
How to create a workflow to trigger the on Save function of CRM ? RRS feed

  • Question

  •  

    Hi Guys,

     

    Does anyone know how to use a workflow that triggers the on Save () javascript of an entity ?

     

    or add javascript code when a record status changes without the on Save () functionality ?

     

    cheers

    Tuesday, October 28, 2008 12:39 AM

Answers

  • Since Javascript is client side script and workflow/plugin are server side executables, i am afraid its not possible. If you elaborate your issue then i may help you by looking into other workarounds.

    Tuesday, October 28, 2008 2:32 AM
    Moderator

All replies

  •  

    Hi,

     

    Please write your issue in detail as there are many combinations to accomplish these tasks.

     

    You can trigger a workflow/plugin by creaing a hidden flag and setting its value at save event. Since javascript is client side script so it only executes from client side. Javascript can execute your workflow/plugin but your workflow plugin will not execute javascript.

     

    Hope this helps,

    Tuesday, October 28, 2008 2:06 AM
    Moderator
  • thank you for your Ayaz.

     

    I wanted the workflow to trigger the javascript.

     

    The workflow was to change a value from a picklist, ie from unprocessed to process. Behind this picklist is javascript. The javascript is on Change () value.

     

    is that still possible ?

     

    Tuesday, October 28, 2008 2:11 AM
  • Tay Le,

     

    CRM 3.0 or 4.0?

     

    Tuesday, October 28, 2008 2:17 AM
  •  

    its CRM 4

     

    I have created a new entity called Time sheet. On this entity, its has Title, description, contract and deliverables, date and Hours.

     

    I have another entity called Task

     

    On this Task entity, we have 3 date fields and 3 time fields. When we enter the Date and time fields of each one, another field called actual work time -  calulates the time taken. So in terms, the 3 date and 3 times fields relate to the actual work.

     

     A workflow is created to turn the Time sheets into Tasks. The hours on the Time sheet is updated on the Task Times field.

     

    But its doesnt update the actual work. 

     

    Cos the javascript is set behind the On Save () event, the work flow doesnt have the option to select the on Save ()

     

    Im not to sure if this makes any sense to you..

     

    is there any work around for this ?

     

    You reply would be most helpful

     

    Tuesday, October 28, 2008 2:30 AM
  • Since Javascript is client side script and workflow/plugin are server side executables, i am afraid its not possible. If you elaborate your issue then i may help you by looking into other workarounds.

    Tuesday, October 28, 2008 2:32 AM
    Moderator
  •  

    Why dont you programme the javascript logic into the workflow?
    Tuesday, October 28, 2008 2:40 AM
    Moderator
  • Or create a plug-in that will be called whenever save. So you can even put your logic in it instead of being in javascript

     

    Tuesday, October 28, 2008 2:46 AM
  • My programming isnt strong.

     

    Was the workflow does, it Changes a Timesheet into a Task. Once the Task is filled in, the work flow completes the Task.

     

    But the thing is workflow, even those the Task is completed, the status only changes. But the on Save () doesnt trigger.

     

    The process is TimeSheet is converted into a Task, The Task is now against a Deliverable. The Deliverables has hours that is related to the actual work time of a Task. If the actual work time of a Task is not filled in, no time is taken off the deliverable

     

     

    Tuesday, October 28, 2008 2:47 AM
  • Put your logic on onSAve the onload too. At least when someone opens the form data will be recalculated again. But will only work when the user opens the form.
    Tuesday, October 28, 2008 2:56 AM
  •  

    Thanks Guys,

     

    I'd just spoke to my Developers and they said the same thing.

     

    Thanks for your time guys

    Tuesday, October 28, 2008 3:11 AM