current.isNewRecord() gives false when used in calculation field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 09:21 AM
current.isNewRecord() gives false when used in calculated value on a field on a change record for create newswhen used in calculation field on a change record for create new

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 09:22 AM
Hi Ravali,
Can you share the calculation you are using in that field? I suspect that the calculation isn't done until the field is saved, but would like to hear more details of your use case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 09:38 AM
it is field called assessment. it has script something like this. When I create new change, it should get into else as it a new record, but it is returning false with current.isNewRecord and gets into IF.
if(!current.isNewRecord()){
current.u_assessment = true;
}
else{
current.u_assessment = false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 09:39 AM
also
current.sys_id, current.number all are returned empty when I put them in the calculate value of the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 09:50 AM
That confirms my suspicion that current doesn't have values until the record is created.
isNewRecord() basically says "The information you are looking at hasn't been saved to the database yet.", not "This is a brand new record saved to the database."
Hopefully that will allow you to use it properly and set the value of your assessment field accordingly (and the logic around it.)