Change value of date/time fields

Hallo,

I just want to blank out the value of 2 date/time fields (Out & Unloaded) when a button is clicked (they 're both “editable”):

FIELD Result := Result;

FIELD Out := Out;

FIELD Unloaded := Unloaded;

Result := @Prompt([YesNo]; “WDP”; “Are you sure you want to blank out the Unloaded and Departure data?”);

@If(Result=“YES”;@SetField(“Unloaded”;0)&@SetField(“Out”;0);“”)

However, they keep their value. Any idea what happens?

Subject: change value of date/time fields

u do onething create one field

called x if x=“1”;write that condition else some other action

instead of yes keep it as “1” in condition

Subject: change value of date/time fields

Try this:

Result := @Prompt([YesNo]; “WDP”; “Are you sure you want to blank out the Unloaded and Departure data?”);

@If(Result=1;@Do(@SetField(“Unloaded”;@Unavailable);@SetField(“Out”;@Unavailable));“”)

Per Designer Help, @Prompt([YesNo] returns a 1 if the user selects Yes, 0 for No.

Note that I used @Unavailable instead of 0 as the replacement value, as your post indicated that you wanted to blank out the field values, which @Unavailable will do.

Also, execution of multiple commands like you need should be done using @Do. That is the purpose of @Do.

Note: this has not been tested, but should work.

Subject: RE: change value of date/time fields

Also, the “declaration” of fields prior to using @SetField is not required in Notes 6 and up.