how to set to select/unselect the row when using ca_fdAddTableRow

book

Article ID: 128888

calendar_today

Updated On:

Products

CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

when using OOTB js function  ca_fdAddTableRow()  to insert the row into the table in the form , it doesn't have control on select/deselect upon inserting into the table :

 ca_fdAddTableRow(formId, _id, values)
 

how to set to select/unselect the row  with  using ca_fdAddTableRow() ? 

Environment

ITSM service catalog 14.1 ,17.1 and 17.2 

 ca_fdAddTableRow(formId, _id, values  )

Resolution

There is  an undocumented parameter with   ca_fdAddTableRow()  JS API 

ca_fdAddTableRow(formId, _id, values ,  boolean_value )

The boolean_value here can be  'true'  or false :
true :   inserted row will be selected 
false :  inserted row will not be selected 
by default ,  without explicitly specifying the last parameter here ,   it is 'true'  .  

For example : 
ca_fdAddTableRow('form1','table',{'col1':'a','col2':2,'col3':_.user.id}, 'false' ); 

The last parameter above  'false' will have the inserted row unselected when it is added into the table .