Testing if a New Record Was Created


If you want conditionally run a script only when a new record was created, you can place this code in the CanSaveRecord event of the form.

dim tbl as P
tbl = table.current()
if (tbl.mode_get()= 1) then
' you are in change mode = existing record
    if (tbl.mode_get()= 2 ) then
    ' you are in enter mode = new record
    ' This is neither a change or enter event
    end if
end if


Desktop applications only. Not available in Community Edition.

See Also