Hi all,
I am trying to figure out a way to update any fields with xml sent as a body over http. I could hard code all 102 columns into the ws_read, but their names are always changing and we’re always adding and removing columns.
I was wondering if there was a way to use jsTable.getColumnNames() to put the column names in an array then match any columns in XML to the columns in the array. Kind of like this:
/**
* // TODO generated, please specify type and doc for the params
*
* @param {Object} part
*
* @param {String} id
*
*
* @returns {Boolean}
*
* @properties={typeid:24,uuid:"8CADE4C5-727A-4889-BE9F-F204A88F9F06"}
*
* @AllowToRunInFind
*/
function ws_update(part, id){
if(part && id && foundset.find())
{
foundset.fld1 = id
if(foundset.search() == 1)
{
[b]var jsTable = databaseManager.getTable(foundset)
var columnNames = jsTable.getColumnNames()[/b]
var record = foundset.getRecord(1)
if(part.fld1 && id != part.fld1) record.fld1 = part.fld1
[b]if(part.columnNames) record.columnNames = part.columnNames[/b]
//if(part.fld2) record.fld2 = part.fld2
return databaseManager.saveData(record)
}
}
return false
}