Clear or Destroy data table in 6.4 form

Avatar

Avatar

Christopher_Pa4

Avatar

Christopher_Pa4

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

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.7K

Likes

1.0K

Correct Reply

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.7K

Likes

1.0K

Correct Reply

1.1K
kautuk_sahni
Community Manager

10-10-2019

Mayank Gandhi Any help here?

Avatar

Avatar

workflowuser

Employee

Avatar

workflowuser

Employee

workflowuser
Employee

10-10-2019

Let me look into this and get back

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

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);    

Avatar

Avatar

Christopher_Pa4

Avatar

Christopher_Pa4

Christopher_Pa4

10-10-2019

Thanks! We'll experiment with this and let you know if we get it working!

Avatar

Avatar

sureshp23286254

Avatar

sureshp23286254

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