Solved

tsf_send_message shows the default message after the custom message

  • 31 August 2022
  • 4 replies
  • 133 views

Userlevel 1
Badge +4

In a default I made a custom message with the abort = 1 but after the custom message a second message of the Software Factory pops up.

 

custom message

 

SF default message

 

How can i make sure that only the custom message shows up?

icon

Best answer by Jochem Pieper 31 August 2022, 15:44

View original

This topic has been closed for comments

4 replies

Userlevel 4
Badge +3

Hey Maarten,

It looks like an attempt has been made to save the record with one or more mandatory fields being empty. In your second screenshot it looks like the default has emptied the value of ‘Besteld’.

I expect that this is what is causing the second message to pop up, because this is a default GUI message that alerts you to mandatory values not being present.

There are some options possible but I would personally recommend using a combination of a default and a layout. Use the default to throw the message, use the layout to prevent the user from saving the record if the provided value does not comply to the present requirements.

Hope this helps 😄

Userlevel 1
Badge +4

@Renée Evertzen  The following situation happends:

A person fills in 17 while the minimum is 25

Then the person saves the row and then the message shows up.
So the action of trying to save already happend. 'Besteld’ is the last field in the grid to fill in.

I did try to disable the confirm button to see if this would effect the grid saving but it did not sadly.

 

Userlevel 2
Badge +1

Hi Maarten,

Seems like the GUI is still trying to save the record, although it has been emptied by the default.

Did you try to add the following code after your tsf_send_message query?

rollback;
return;

I'm not too sure if this cancels the saving of the record, else you could check what causes the row to be saved other than the user trying to save it (manually).

Userlevel 4
Badge +3

@Maarten : If you are editing in grid and that field is the last to fill in, then using TAB to leave the last field will automatically trigger the row to be saved as well as triggering the default. Not the most fancy of solutions, but maybe you could swap the last column with the second last column?