How do you a clear an embedded list cell value through an embedded list client script?

Shant Cancik
Tera Contributor

I've been able to retrieve cell values in embedded lists using list.getCell().innerText (see below) but have not  been able to set values to these cells.

Anyone know how to clear or update cell values? Unfortunately g_form  can't be used for embedded lists through List Client Scripts.

 

for(var embList in GlideLists2){
var list = GlideLists2[embList];
if(list.isEmbedded() && list.tableName == 'u_allocation'){
    var rows = list.table.getElementsBySelector('tr.list_row');
    var sys_id;

    for(var i = 0; i < rows.length-2; i++){
         sys_id = rows[i].getAttribute('sys_id');
         var allocationValue = list.getCell(sys_id, 'u_total_allocation').innerText;

    }

}

}

 

2 REPLIES 2

p t1
Kilo Sage
Kilo Sage

Hi,

Use "return true" to insert record in embedded list 

else don't want to insert record use "return false".

 

Thanks 

Preethi

 

Hey Preethi,

 

We're not looking to abort the embedded list insert all together. We're looking to merely clear the cell value through HTML DOM manipulation.

 

In the code above, we're able to grab the individual Embedded List cell data using:

 list.getCell(sys_id, 'field_name').innerText;

 

We've attempted clearing the value using the code below but have had no luck:

list.getCell(sys_id, 'field_name').innerText = '';

list.getCell(sys_id, 'field_name').innerHTML = '';

 

Any thoughts?