The screen fields do not appear when I click the button holding my mail merge

Hello all. I have a mail merge with some fields added in the Screen Fields.

When I launch the mail merge from my application, I expect the screen fields to show up before sending my email but it does not. My email is immediately sent.
The way the mail merged is launched is from inside a function: five.executeAction(‘MailMergeActyionID’, mailMergeContext).
This function is called from an Event “Do press” of an action button of a form (Action area is Form).

Can you explain me what I did wrong? I am wondering… are the screens fields displayed only when the mail merge is directly called from a menu button as an Action ?

Thank you for your help.

Hi Jean,

executeAction() will just send the email which sounds like what is happening in your case, try using selectAction() this way your screen fields will be displayed and you can enter the values, when you click the tick, your mail merge will then be sent.

selectAction() is a frontend function so it needs to go on the On Press event rather than the Do Press event.

The following 2 links will help if you haven’t used selectAction() yet.

selectAction() | Five | Low-Code For Real Developers

selectAction() | Five | Low-Code For Real Developers

As a note, you can populate the screen fields programmatically via the context of executeAction()

I hope this gets it working for you, let me know if you need any more help.

Kind regards,

Jo

I haven’t used selectAction() yet. I’m attaching a report and running a SQL query in the same function. I will have to manage this between the front-end and back-end functions to get a satisfactory result. I will give a try and come back if I need more help. Thanks for your advice!
Jean

Ok, I succeed to do what I wanted :slight_smile: ! The doc Action Buttons | Five | Low-Code For Real Developers also helped me a lot.

But in this documentation, I don’t understand the utility of the Screen Field ‘Message’ in the Mail Merge. Refer to sections 6 @ 10

https://help.five.org/2.9/docs/events/action-button#add-the-message-email-mail-merge

I deleted the ‘Message’ field, so the Mail Merge ‘MessageEmail’ has no Screen Fields at all, and the application ‘Button Demo’ works correctly.

What is the purpose of adding ‘Message’ field in the Screen Fields ? Thank yo

Hi Jean,

Great you have got it working! The Message field you’re talking about in the documentation, just demonstrates an example of how a screen field can be used. For that example, it shows you can type a message in the screen field, and it will get entered into the email template where the Message variable is set.

Kind regards

Jo

1 Like