OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions What to do to use mass_action with parameter

This topic contains 7 replies, has 2 voices, and was last updated by  Hiro 9 years, 6 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #28118

    Hiro
    Participant

    I have noticed Mass Action request does not seem to send the parameter that we can apply to the DQL for the data grid.

    What do I have to do to send the request with a parameter?
    Can we make that happen by putting extra parameter to dataGrid.renderGrid()?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #28119

    Alexandr Smaga
    Participant

    Hello @hiro-ifactory!

    Not sure that I understand you correctly.. Mass action request URI should include all params that comes to renderGrid, are they there ?

    #28120

    Hiro
    Participant

    Thank you for the reply.

    So I need to delete multiple records from a data grid and the query in datagrid.yml file has multiple parameters like “:param_1”, “:param_2″…

    The data grid is generated like:

    According to my FireBug it does not send those parameters when mass action is executed as the request URL is like this (as not including the parameters “param_1”, “param_2″…):

    And I am actually not sure if I have to send “param_X” because technically I do not need them to delete a record as the request URL is sending the id with the query “values”.

    And I am guessing I have to send the parameters to make DQL work for the data grid after having a look at the classes:
    Oro\Bundle\DataGridBundle\Extension\MassAction\MassActionDispatcher
    and
    Oro\Bundle\DataGridBundle\Extension\MassAction\DeleteMassActionHandler

    When I dump $results for the data grid using a parameter, count($results) is zero so that later “foreach” does not happen.

    And frontend gets this:

    What do I have to do to enable a data grid to execute Delete Mass Action when the data grid uses the parameter?

    #28121

    Hiro
    Participant

    In addition to the issue, I have created my own Listener class so that my data grid can refer multiple parameters.

    https://gist.github.com/hiro-iFactory/ac273c8a043a8f82d878

    #28122

    Alexandr Smaga
    Participant

    Yes I got you!

    Seems that this is a bug in “mass actions”, because all params that grid needs in order to fetch data is also required for mass action. We do no send all checked IDs for mass action we only send a selected and unselected arrays in special syntax in order to be able to remove thousands of records by single request.

    We will investigate it and will keep you posted. Thank you!

    #28123

    Hiro
    Participant

    Thank you!

    #28124

    Hiro
    Participant

    Has this issue been amended?

    #28125

    Hiro
    Participant

    I ended up creating a custom Mass Action that skips creating $results.

Viewing 7 replies - 1 through 7 (of 7 total)

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

Back to top