Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Delete action does not work in repeating dynamic layout

SA-80578

Summary



The Delete action does not work for a repeating dynamic layout when sourced by a page group property.


Error Messages



Not Applicable.


Steps to Reproduce

  1. Configure a repeating dynamic layout with a page group property
  2. Configure a Delete action event
  3. Attempt to delete a record


Root Cause



Delete action does not support page group sourced repeating dynamic layouts.


Resolution

Perform the following local-change:
  1. Include the following JavaScript function in a JS file included in the Harness or in the UserWorkForm:

    <script>
    function removeFromPageGroup(event) {
        var pageGroupProperty = jQuery(event.target).closest('[data-repeat-source]').attr('data-repeat-source');
        var rowBaseRef = pega.u.d.getBaseRef(event.target);
        var lastLeftParentheses = rowBaseRef.lastIndexOf("(");
        var lastRightParentheses = rowBaseRef.lastIndexOf(")");
        var subscript = rowBaseRef.substring(lastLeftParentheses + 1, lastRightParentheses);

        var safeUrl = SafeURL_createFromURL(pega.u.d.url);
        safeUrl.put("pyActivity", "@baseclass.RemoveFromPageGroup");
        safeUrl.put("PageGroupProperty", pageGroupProperty);
        safeUrl.put("Subscript", subscript);

        pega.u.d.asyncRequest("GET", safeUrl, {
            'success': function() {
                var sectionNode = pega.u.d.getEnclosingSection(jQuery(event.target).closest('[data-repeat-source]').get(0));
                pega.u.d.reloadSection(sectionNode);
            }
        });
    }
    </script>

  2. Change the action from 'Delete item' to 'Run script'
  3. Set the function name as 'removeFromPageGroup' and add a parameter with value, 'script:event'


 

Suggest Edit

Published August 15, 2019 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us