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

Attachments not deleted in mobile offline application

SA-84772

Summary



In a mobile offline application, when removing work objects from a mobile device after submitting and synchronizing an assignment, the work objects are removed from the device. However, all the attachments related to these work objects are not removed from the device.

The below script is used to confirm if the file exists on the device:

launchbox.PRPC.ClientStore.getItem("DATA-WORKATTACH-FILE","DATA-WORKATTACH-FILE RR-MOBILETEST-WORK O-89!20190705T085058.427 GMT").then (item => {console.log(item.url); launchbox.DocumentViewer.open(item.url,{},handlers)}) and image was successfully opened.

The user has Pega 7.4 with Hybrid Client (HC) 7.41.3.1 without any custom code.


Error Messages



Not Applicable


Steps to Reproduce

  1. Define a sample offline case type.
  2. Add a button to the section and change the control type to 'Attach content'.
  3. In the Control properties, change Category to 'File'.
  4. Build an Android or iOS application (Android for this use case). The device is connected to the Internet..
  5. Create a new case.
  6. Click the Attachment button created. Click a photo and attach it to the case. Note the case ID.
  7. Submit the case.
  8. In Chrome DevTools, list all items with API:

    launchbox.PRPC.ClientStore.getItemsStats(function(x) {console.log("elo1: " + JSON.stringify(x));}, function(x) {console.log("elo2: " + JSON.stringify(x));});

     
  9. In the output, locate the attachment item using the case ID.

    In this use case: {
    "type":"DATA-WORKATTACH-FILE","handle":"DATA-WORKATTACH-FILE O77V2G-HARNESS-WORK H-25!20190705T124026.079 GMT","size":null},

     
  10. Define the handlers using the information provided in: http://docbuild.antennasoftware.com/docs/archives/ac/ac_7_41_0/client_api/container_example_doc_viewer.html

     
         var handlers = {
            onProgress: function (progress) {
              console.log('Progress: ' + progress * 100);
            },
            onSuccess: function () {
              console.log('SUCCESS!');
            },
            onFailure: function (error) {
              console.log('FAILURE! ' + error.description + ' code: ' + error.code);
            }
          };

     
  11. Invoke the below getItem API:

    launchbox.PRPC.ClientStore.getItem("DATA-WORKATTACH-FILE", "DATA-WORKATTACH-FILE O77V2G-HARNESS-WORK H-25!20190705T124026.079 GMT").then(item => {console.log(item.url); launchbox.DocumentViewer.open(item.url,{},handlers)})

    Reported behavior: The below is printed and the image displays on the device screen,

    filebox://fs_com.pega.gcs.pushtest/shared_temporary/ClientStore/files/4aqYgZ0fhJEhSyvU4eTD8Ph4tmyNgCw8.jpg
     
    Expected behavior: The attachment should be removed from the device after the case is submitted.


Root Cause



A defect in Pegasystems’ code or rules.


Resolution



Apply HFix-54781.

Published December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

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