Highlighted

Clear or Destroy data table in 6.4 form

Christopher_Pa4

09-09-2019

Hello!

We are using an Adaptive Form to display search information from a database.

If we click a Search button, we run this script:

if ((txtFirstName !== null && txtLastName !== null)) {

//clear rows first   

      tableItem11.value = null;

      tableItem13.value = null;

      tableItem14.value = null;

      tableItem15.value = null;

     

  var operationInfo = {

    "formDataModelId": "/content/dam/formsanddocuments-fdm/ps_apexmulti",

    "operationTitle": "getApexMulti",

    "operationName": "get_15613995797250"

};

var inputs = {

    "FIRST_NAME" : txtFirstName,

    "LAST_NAME" : txtLastName

};

var outputs = {

    "FIRST_NAME" : tableItem11,

    //"MIDDLE_NAME" : tableItem12,

    "LAST_NAME" : tableItem13,

    "HC_PARENTDEPT_DESC" : tableItem14,

    "JOBCODE_DESCR" : tableItem15

};

guidelib.dataIntegrationUtils.executeOperation(operationInfo, inputs, outputs);     

}

else{}

However, if the user puts in new data to the search elements, the old data still shows aside from what is replaced. In the screenshot, the first search was for "Michael Smith" and returned 3 results. If I then search for "Peter Shin", one row is cleared, but the rest of the original data is there.

1830281_pastedImage_0.png

Is there a dataIntegrationUtils operation to clear all data from a table or reset it?

Thanks!

Replies

Highlighted

Mayank_Gandhi

Employee

10-10-2019

You can call table.resetData(); to reset the complete table.

Modify your code as per below script:

if ((txtFirstName.value === null) || (txtFirstName.value === "") || (txtFirstName.value).trim().length === 0) {

}

  else{

  table1570715554554.resetData();

 

}

 

var operationInfo = {

    "formDataModelId": "/content/dam/formsanddocuments-fdm/fdm2",

    "operationTitle": "get",

    "operationName": "get_15671949377350"

};

var inputs = {

    "agentID" : txtFirstName

};

var outputs = {

    "siteID" : tableItem11

};

guidelib.dataIntegrationUtils.executeOperation(operationInfo, inputs, outputs);    

Highlighted

sureshp23286254

29-07-2020

Mayank,

  I have similar query but when i tried  table1570715554554.resetData(); it only cleared the rows and continue to see the dummy records. how to remove the blank rows? 

 

Also tried below solution but didn't work either.

 

while (table1585577511230._Row1.count > 1)

{

table1585577511230._Row1.removeInstance(0);

}

 

Do you have any other solution?

 

Thanks & Regards

     Suresh