none
Run a Workflow on All Datasets

    Question

  • I have several workflows that need to be applied to all Leads, all Accounts, etc. However, I can only do 250 at a time because that is the maximum page size. How can I apply a workflow to all entries at once?

    Thanks
    Monday, March 16, 2009 10:08 PM

Answers

  • You can tap into the pre execute message and change the count attribute on the fetchxml fetch element e.g. <fetch. we built a simple wizard that allows us to define how many records are displayed for a given entity per user.  we also allow the user to change that number on the fly so he can work with the system views and for example show 10 account records per page and change that to 1000 when he uses the advanced find. the wizard also enables us to limit the range for each user.

    One thing you need to pay attention to is when you change the count attribute make sure that the fetchxml is not an aggregate query. if it is, don't change the count as it only returns a single record.

    hope this helps.
    Tuesday, March 17, 2009 8:46 PM

All replies

  • There is an unsupported way to change the record set delivered.  Below is the link to the post.  You might also be able to write some custom code using the SDK to make the changes that the workflow would make.

    http://social.microsoft.com/forums/en-US/crm/thread/41f1650d-d939-4d0c-b5da-c92d445e7c98/
    Best Regards, Donna
    Monday, March 16, 2009 11:58 PM
    Owner
  • Thanks for that link. However, it does not seem to work for me. I checked the tabe UserSettingsBase. There are 21 rows. In one of the rows the PagingLimit column is set to 250 (HomepageArea=Workplace). For all others it is 50. I changed the 250 to 2000 (and also 500) but I still only get 250. Interestingly enough, when I go to the options it shows 25 (it probably chose the first as it did not find 2000). So how do I get this to work?

    Thanks
    Tuesday, March 17, 2009 7:13 AM
  • If you are not able to get this to work based on the information provided, then I recommend that you don't do this as it is not supported and you could end up with other issues.  I am not sure what types of changes you are trying to make on records in CRM but you may want to consider making those changes by leveraging the SDK rather than workflows.  Here is a link in the event you need it.

    http://msdn.microsoft.com/en-us/library/bb928212.aspx

    Best Regards, Donna
    Tuesday, March 17, 2009 12:34 PM
    Owner
  • Interestingly enough I can change the value in Tool->Options. If I set it to 25,50,75, etc then that is the value shown in Tools->Options. If I set it to higher then 250 it will default to 25.

    However, more importantly it has no effect on the number of entries shown in the list. It stays at it's previous value. Only when I make a change in Tools->Options it has an effect on the list. Selecting 250 will simply change the value in the database to 250. I was hoping it would take over the value I set. Setting it first to 250 and then changing the value in the database also does not help.

    UPDATE    UserSettings
    SET              PagingLimit = 3000
    WHERE     (SystemUserId IN
                              (SELECT     SystemUserId
                                FROM          SystemUserBase
                                WHERE      (FullName LIKE 'xxx')))
    Tuesday, March 17, 2009 7:23 PM
  • You can tap into the pre execute message and change the count attribute on the fetchxml fetch element e.g. <fetch. we built a simple wizard that allows us to define how many records are displayed for a given entity per user.  we also allow the user to change that number on the fly so he can work with the system views and for example show 10 account records per page and change that to 1000 when he uses the advanced find. the wizard also enables us to limit the range for each user.

    One thing you need to pay attention to is when you change the count attribute make sure that the fetchxml is not an aggregate query. if it is, don't change the count as it only returns a single record.

    hope this helps.
    Tuesday, March 17, 2009 8:46 PM
  • Adi, that sounds impressive. Unfortunately, I don't have a clue where and how to do that. It's not some javascript code that I can add to a form, right? If not I assume this would be done on a server-side plug-in?

    Thanks.
    Tuesday, March 17, 2009 9:23 PM
  • Indeed. the wizard main operation is controlled by a plug-in with a step registered on the execute message pre event. you may add configuration xml to the step unsecure configuration box and control which entity and user can extend the fetchxml count functionality.
    Tuesday, March 17, 2009 10:17 PM