I’m not sure when this started happening but databaseManager.copyMatchingColumns() doesn’t seem to be working correctly. This is what I’m seeing in 5.2.6:
databaseManager.copyMatchingColumns(from_rec,to_rec,false) - copies nothing
databaseManager.copyMatchingColumns(from_rec,to_rec,true) - copies everything (including null columns) except PK column
databaseManager.copyMatchingColumns(from_rec,to_rec,array) - copies everything (including null columns) except PK column and columns specified in array
The docs say it should copy “non-empty” columns. I think it copies empty columns as well. Anybody else noticing this?
Michael,
Am I right that only the first one does not do what you expect?
What does the method return?
Rob
Hi Rob,
My question is how it is supposed to work, and does it work that way:
The first example, with the false parameter, I don’t know what to expect. It doesn’t copy any columns. It’s unclear to me what a ‘false’ value is supposed to do, or even why it’s an option.
The second example, with the true parameter, I assumed would overwrite all columns except for primary key and those where the source column was empty. I doesn’t, it overwrites every column except the primary key even if it is null.
The third example, with the array parameter, I assumed would overwrite all columns except for primary key and those were the source column was empty, and also skipping the columns named in the array. I doesn’t, it overwrites every column except the primary key and named columns, even if they are null.
In all cases true is returned.
Thanks.
Not sure when databaseManager.copyMatchingColumns(from_rec,to_rec,array) stopped working but I just noticed it too in 3.5.
The following:
databaseManager.copyMatchingColumns(source, destination, ["split_ship","carrier","stage_date","date_shipped","tracking_no"]);
will still copy the info in the fields: [“split_ship”,“carrier”,“stage_date”,“date_shipped”,“tracking_no”])
Any ideas?
Providence,
I just tried a small sample which worked fine.
If you can create a sample that does not work, please file a case in our support system. http://crm.servoy.com/servoy-webclient/ … oy_support
Rob
It’s up there. Thanks for looking into this!