Pre-populate field only if new record

Hi,

I’ve been away from scriptcase for a few years and have now started using it again…so please bear with me.

How can I populate a form field with the result of a method only when i am adding a new record ?

For example I have a php method create-uuid() and i’d like to fill my field {user_id} only when it is a new user.

I can’t use the onloadrecord as that doesn’t trigger for single record forms and onload is undertaken before populating the form so it has no idea if the form is in either INSERT or UPDATE mode.

Likewise beforevalidation cant be used as it’s a database required field.

Any pointers ?

Thanks in advance.

If it’s an edit there will be a Variable present…
So check if that Variable is present.
If it’s not, it’s an ADD.

check form fields section.
each field can be on or off for new or update record situation.

1 Like