0
votes

There is a below code, does not work

FOR EACH customer where customer.contactmethod = 'E':

MESSAGE "EMAILING TO" customer.customerCode customer.CustomerName.

RUN Emaling.p (INPUT parameter 1,INPUT pramater 2 ....)

END.

When this above loop executes it, it messages the first customer only. The reason I found is the outlook message.

The Outlook message is below

"A program is trying to send an email message on your behalf. if this is unexpected, clikc Deny and verify your antivirus software is upto date......................................."

if user click allow/deny in the outlook message, it does not message the second customer as it is stuck in first customer.

How can I suppress this outlook message using 4gl code?

1

1 Answers

1
votes

The key to that is inside your "Emaling.p" procedure. Whatever technique that code is using to send email needs to be adjusted to bypass the security check.

Or you could disable whatever it is that is popping up that message. It looks like some over-zealous Windows security setting.

In any case it has nothing much to do with the 4gl code that you have shown.

Having said that -- your code is obviously incomplete and as shown would not be expected to work at all. Maybe it doesn't really look anything like that but a more workable version of the code above would be:

FOR EACH customer NO-LOCK where customer.contactmethod = 'E': /* without the NO-LOCK you might be aggravating a transaction scoping problem... */

  MESSAGE "EMAILING TO" customer.customerCode customer.CustomerName.

  do on error undo, leave:  /* this may help to keep processing even if errors occur */
    RUN Emaling.p (INPUT parameter 1,INPUT pramater 2 ....). /* you forgot the "." and knowing the rest of the parameters might help to suggest ways to get around the reported problem */
  end.

END.