Method Community

 

Deleting a record in table using delete link in grid

Last post 04-25-2016 10:42 AM by Method_Ben. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-19-2016 12:21 AM

    Deleting a record in table using delete link in grid

    I am trying to use a common delete approach in Method New in a grid and i have tried everything i can think of an is not working.  Please help me understand how to use links to use the record ID of the grid's item link selected such as delete.

    The where i have recently tried is not working:

    Field.RecordID=Grid.Grid1.RecordID

    ResultQuoteLineRecordID

  • 04-01-2016 12:32 PM In reply to

    Re: Deleting a record in table using delete link in grid

    Hi bergyver,

    My apologies for the delayed response on our end, more than happy to help out!

    After some quick testing on my end, it appears that you are not missing something - this is a bug on our end. On other similiar actions, Update Fields in Table for example, you will see 'Loop' as a selectable value in the 2nd Value Dropdown - See;


    Now it appears this same option is missing from the Delete Records from table action. 

    This being said, there is a quick and easy workaround to get this one up and running, using an Action Result. You Loop through the grid. assigning the Record ID of the current record in the loop to an Action Result, and use this action result as the criteria for the RecordId to delete in your Delete Records from Table action


    Hopefully this helps. Let me know if you would like any more clarification on this one.


    -Ben

    Ben Hargreaves
    Senior Support Specialist
    Method:CRM
    b.hargreaves@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 04-24-2016 2:22 PM In reply to

    Re: Deleting a record in table using delete link in grid

    Can you please show me the logic in the code for Assign Value to Action Reslut and loop through grid. I have tried all differnt configurations and it keeps deleting all the lines not just the one line.

  • 04-25-2016 10:42 AM In reply to

    Re: Deleting a record in table using delete link in grid

    Hi Bergyver,

    Sure Thing. Ive grabbed some screenshots of the Logic behind the actions I mentioned in the above post.

    First The Loop through grid;

    Next, the Assign Value to Action Result;


    For Reference as well, Ive attached the screenshot of the Delete from Table Action, along with the Edit Criteria

    Thanks Bergyver.

    -Ben

    Ben Hargreaves
    Senior Support Specialist
    Method:CRM
    b.hargreaves@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
Page 1 of 1 (4 items)