Execute workflow in JavaScript and wait for it to complete

December 17, 2010 by · Leave a Comment 

Sometimes you want to launch a workflow in JavaScript and wait for it to complete. Andriy Butenko wrote a script that would wait for a workflow to complete in JavaScript.

Scenario
Our customer requested that an email would be created via a workflow and that the user is notified immediately when the email is saved so that he could add some personal notes to the email before sending it out. This required that the form would remain open.

Solution
The system checks if certain fields are filled after which a workflow is started via JavaScript. Immediately, the user gets a notification – using gAddNotification() – that the email is being created. The form close event is set to false so that the user can not close the form. Once completed the system pops up an alert that the email is saved and the activities screen is displayed showing the newly created email. Finally, the form close event is set to true allowing the user to close the form once again.

image

Instructions

  1. Copy the function below in the Onload event.
  2. Create a global function called workflowOnCompleted (see example below) to place logic that needs to run after completion of the workflow.

Note: this function calls another function named gExecuteWorkflow() on our blog.

Read more

Workflow Manipulation Library for CRM

December 3, 2010 by · Leave a Comment 

Found this great article in my RSS feeds about a new plugin by Engage to build complex workflows to solve equations, date calculations, manipulates strings, perform regex (regular expression) formatting & matching.

You can download the plugin from Codeplex:

http://manipulationlibrary.codeplex.com/

There’s also a great explanation here from the folks at Engage that runs down the different categories of utilities and their functions.  Enjoy!!

CRM 2011 Processes: Prompt and Response Dialogs

October 8, 2010 by · Leave a Comment 

I received some more detailed information on Processes (formerly called workflows) in CRM 2011, specifically on how to capture responses and what you can do with those responses.

093010_1656_Processesin4

Microsoft Dynamics CRM 2011 certainly has changed quite a few of the areas that users and developers alike have grown comfortable with in CRM 4.0. While there have been some significant changes to the marketing and service areas (as well as other areas), some of the biggest changes in CRM 2011 have been in the ‘workflow engine.’

If you browse through your CRM 2011 beta environment you may find that there is no longer an area in SETTINGS for WORKFLOWS. Now before you assemble your torch-wielding mob to march to Redmond and decry the loss of workflows in CRM, allow me to explain a bit further.

Read the rest of this article at PowerObjects

Execute a workflow via JavaScript in MS CRM

October 5, 2010 by · 3 Comments 

Jim Wang has written an interesting post on the MS CRM Team blog concerning how to activate a workflow using JavaScript. You can read about it here: CRM 4.0: Use JavaScript execute/call/launch CRM Workflow

This function requires the following parameters: 

  • entityId:     entityid of current record
  • workflowId:    id of the workflow to execute

While you could use SQL Query Analyzer to retrieve the workflowid it is also possible to use the gGetValue() function on this blog to retrieve the GUID via a WebService call. 

A tip of caution: activating a workflow on the on-change event can be a bit hazardous since it is very possible that the event is triggered several times on the same form before it has been saved.
 

Copy the code in the Onload event and use the example to call the function :
Read more

Call Center Scripts now possible with MS CRM 2011

September 27, 2010 by · 1 Comment 

It is now possible to create call center script in MS CRM 2011 using out-of-the box functionality called Processes.

js2

MVP Ayaz Ahmad has posted an interesting article on how to design and execute processes, with screenshots.

Microsoft CRM 4 lacks call scripting features and customer especially call center customer will have to buy 3rd party add-ons like TK Dialogues, custom ASPX pages etc. to fulfill this requirement.

However, Microsoft CRM 2011 provides call scripting out of the box using processes. Processes are now used in place of workflows.

Read the rest of the post at Ayaz' blog.

How to increase the page limit in MS CRM beyond 250 records

July 8, 2010 by · Leave a Comment 

By default MS CRM only allows you to view up 250 records per page. In some cases this can be pretty annoying e.g. when you want to run a workflow for on a large number of records or when you want to delete records after an import.

In the table UserSettingBase (standard CRM installation) check the column PagingLimit for your user record (cross check with FilteredSystemUser) and update it to desired value. Most likely it gives you 5000 limit anyway, but it is still much better then 250.

Make sure you only do this for admin purposes or for users with special rights.
For more information see these posts:
http://www.focaya.com/blog/?p=121
MayankP's Blog

Note:
In case your setting is not updated in GUI – try resetting IIS (WINDOWS START / Run / CMD and type iisreset on command line).
You can revert it back either using GUI or update via DB (and reset IIS)

Running Microsoft CRM Workflows Against Marketing List Members

May 1, 2010 by · Leave a Comment 

One of the gaps in the Marketing List functionality in Microsoft CRM 4 is that the marketing list member entity cannot be used in CRM workflow. That means that you can’t use a workflow to add somebody to a marketing list, and you can’t run a workflow against all of the members of a marketing list.

See this post on Customer Effective Blog: Run workflow against marketing list members