I have created a page that also outputs multiple messaages. Now the question, how do I make that the messages are all output in one message. Because now it is so that I have to click away every single message to see the full page.
I have thought to save the messages somehow then at the end of all output one below the other, but I do not know how to do that. Please help
if ...
else
Message('Day %1 is already present.', RecDate."Day");
and I have this several times
Why don’t you make a procedure as MyMessage, i.e. And change th call of this messages to your procedure, and in this procedure, instead of uing the Message function, you send a notificaction. This way it is not invasive and the uer do not have to push Accept with every message.
I hope this will give you a clue and is useful.
I’d probably create a variable to store the messages in then do something like:
if …
else
MessageText := 'Message for error goes here ';
if …
else
MessageText := ’ Next Message is here. ';
if len(MessageText)>0 then
Message(MessageText);
That would accumulate the messages into a variable file. If I’m remember correctly how message works then then \ at the end should add a new line after each message. You’ll end up with one extra line break at the very end, but if that bothers you then you just check the length each time before adding to the string to see if it’s empty and let that decide if the \ is necessary.
On the procedure u have the errors:
Create a Temp Table variable (I usually use a temporary copy of Activity Log)
Create a temp page variable (create the object if u dont have one, and remember to use Activity Log temporary as datatable of the page, insert a repeater in the page).
Instead of saving or showing the errors, Do Inserts in the temp table.
Once u are done getting the errors and validations, show the page with all the lines with error
If there are some critical errors, u can use a formatting on the onafter trigger for the lines (page), then u can mark in red critical errors and let the warnings in a normal format.
U can stop all the code with a handler on the callback from the page.
For example, after inserting the errors in the temp table (rec); handle the errors and dont do anymore code:
rec.INSERT();
if rec.count() > 0 then begin
isOK := FALSE;
If NOT isOK then showpage(rec);
else CONTINUE();
I think this is the most userfriendly and correctly solution when do u want to show a lot of errors.
Moreover u can apply the same page and table to any page u want to show errors.
This is already available.
Please look at the table 700 “Error Message” and where it is used.