Tech Support > Microsoft Windows > Windows CRM > Manually Apply workflow rule on multiple activities
Manually Apply workflow rule on multiple activities
Posted by MatsL on October 9th, 2006




Is it possible to manually apply a workflow role to automatically close
all selected open activities. I haven't found any Action menu => Apply
Rule when viewing activities. It's possible to apply a workflow rule
when you open a selected activite, but i like to apply a manual rule
for multiple activities.

// Mats

Posted by Shane on October 10th, 2006


Not sure if I understood correctly. But if I were to guess: When selecting a
range of activitties on a grid; you would like to press a button that would
close all the activities. Sound correct?

If so: Here are my thoughts. Yes.

This is what you would need to do.
1. figure out how to launch a workflow with jscript
2. add a button to the grid with that jscript
3. create a work flow for each activity type
4. In your jscript, cursor through the grid for selected rows and submit the
workflow for the applicable row given its activity type. For example, if it
is a task, submit a complete_task workflow if it is an appointment submit
complete_appointment workflow.

Believe it or not this is all possbile. It would take me three days to
figure it all out. But I bet Microsoft could help you faster.



Shane


"MatsL" wrote:

Posted by MatsL on October 10th, 2006



Thanks Shane,

I will try this and see if it works.

// Mats


Shane wrote:

Posted by Stefan on November 12th, 2006


Hey Mats,

I'm trying to achieve similar goal.
The thing is I can't seem to manage to add a button to the grid.
I know I have to edit the isv.config file but when I add my code the button
still doesn't appear.
Can you share how you did this?
Also some example of the javascript would be helpful as this would be my
next task.

This is what I added to isv.config
----------------------
<Entity name="activity">
<Grid>
<MenuBar>
<Buttons>
<Button Title="Grid" JavaScript="alert('test');"/>
</Buttons>
</MenuBar>
</Grid>
</Entity>
---------------

Thanks,
Stefan
"MatsL" wrote:

Posted by Chad Fulda on November 16th, 2006


I'm trying to do this as well. I've been digging around for the code that
the "Apply Rule" option uses so I can modify that to do what I want. No luck
so far, of course.

Stefan-- if you're trying to add your button to the Activities screen grid,
you need to use "activitypointer" instead of "activity". Like so:

<Entity name="activitypointer">
<Grid>
<MenuBar>
<ActionsMenu>
<MenuItem Title="Complete Multiple Activities"
Url="http://blah/test.aspx" WinParams="" WinMode="1" />
</ActionsMenu>
</MenuBar>
</Grid>
</Entity>

If anyone has some suggestions for the actual code to call the workflow via
the button, please don't be shy about sharing...

"Stefan" wrote:

Posted by Stefan on November 16th, 2006


Thanks for the reply,
I figured that out yesterday and today I have my custom "workflow" working
as intended.
Only..it's not a workflow.
I didn't find any specific info on how to call a workflow from javascript,
so I made a separate ASP.NET webpage that implements the workflow logic and
opens whenever the user clicks on the custom button.

Hope this helps in a way.
If you do figure out a way to call the workflow please let me know

Thanks,
Stefan

"Chad Fulda" wrote:


Similar Posts