locked
Get multiple ids in bulk edit RRS feed

  • Question

  • In crm it's possible to do a bulk edit on multiple items. How can I retrieve the id's of the items that will be edited. I'm looking for something like xrm.page.data.getid but then for all items in a bulk edit.

    I'm also wondering what the behaviour is..with fiddler I see it does multiple requests like:

    ..../_grid/cmds/dlg_bulkedit.aspx?iId=%7bE4AE4865-39F3-E011-9D66-000C29BE6B43%7d&iIndex=0&iObjType=2&iTotal=1

    You would expect that "xrm.page.data.getid " works per request, but it doesn't...

    THanks

    Thursday, April 5, 2012 12:46 PM

Answers

  • Hi,

    If you wanted to do it in the bulk edit form, this seems to work:

    • Since form's "onload" does not fire for bulkEdit, you will need to add an IFrame to the form(just make it hidden)
    • In the IFrame, window.dialogArguments will give you the list of record ID-s
    • So, you could do it like this(you may also need to handle non-bulkedit situation separately.. maybe just check if data.getid exists, for instance):

    <HTML><BODY>

    <SCRIPT>
      var records = window.dialogArguments;
      if(records != null)
      {
         for(i=0; i<records.length; i++)
         {
           alert(records[i]);
         }
      }
    </SCRIPT>

    </BODY></HTML>


    Alex Shlega, GotchaHunter.Net

    Thursday, April 5, 2012 2:41 PM