I am moving from 4.1.7 to 5.1.4 and was wondering if anyone noticed that the databaseManager.hasNewRecords(foundset) no longer works correctly?
My situation is this, I create a new record foundset.newRecord(). This foundset requires that you create another record in another table because it is a superset (one to one relationship). which I do immediately afterwards with foundset.super_set_to_sub_set_record.newRecord().
This is kind of an issue because I need to validate if the super_set foundset has a new record to set some column data before saving and other data if its only an updated record.
Doesn’t really make sense to me that the databaseManager.hasNewRecords(foundset) would be set to false after that because its still a new record that hasn’t been saved to the database.
heres a quick sample case for you. I made a mistake in my initial post. It should be once a new record has been altered, the foundset no longer returns as hasNewRecords
Below is a simple function when clicking a button
function createNewCustomerHasNewTest(event)
{
application.output("Before new record: " + databaseManager.hasNewRecords(foundset));
foundset.newRecord();
application.output("After new record: " + databaseManager.hasNewRecords(foundset));
foundset.customerid = 'abcd';
application.output("After alter new record: " + databaseManager.hasNewRecords(foundset));
}
Results Before new record: false After new record: true After alter new record: false