Anyone notice current.isNewRecord() no longer works?

DrewW
Mega Sage
Mega Sage

Anyone notice current.isNewRecord() no longer works?   I have tested this using the below run as a background script in several instances including in a developer instance.   The instances where running Helsinki Patch 5 and Istanbul Patch 1 and also Patch 2.

Just thought I would share just in case my marbles have finally rolled away...

var x = new GlideRecord("incident"); x.initalize(); x.setValue("caller", "2a6f81b60a0a3c2601ddac0243417d02"); x.insert(); gs.print(x.isNewRecord());

If other find otherwise on a Helsinki or Istanbul instance I would love to know the version.

var x = new GlideRecord("incident");

x.initalize();

x.setValue("caller", "2a6f81b60a0a3c2601ddac0243417d02");

gs.print(x.isNewRecord());

If

1 ACCEPTED SOLUTION

DrewW
Mega Sage
Mega Sage

Ok, so apparently something was "fixed" and this is not supposed to work for the script that I wrote and I am blind because the documentation says "but should not be used in background scripts" to indicate this.


View solution in original post

8 REPLIES 8

I know its not the rest of the code because before we upgrade to Helsinki it all worked fine and once I changed the check over to the !current.isValidRecord() it started working again as intended.


DrewW
Mega Sage
Mega Sage

Interestingly enough I created a UI Action on the incident table with a condition of current.isNewRecord() and was able to confirm that it does work there....   So its not reliable.


DrewW
Mega Sage
Mega Sage

Ok, so apparently something was "fixed" and this is not supposed to work for the script that I wrote and I am blind because the documentation says "but should not be used in background scripts" to indicate this.


Haha! Happens to the best of us! But you taught me something