BPM Custom Code Ice Messagebox

Hey Guys,

Just a quick little question… is there any way to change the size of the popup message boxes when calling them via BPM’s custom code?

I’m displaying some memo’s on the screen and it would be great to make the message box larger.

Or alternatively is there a better message box to use other than the below for this specific purpose?

this.PublishInfoMessage(message, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");

Thanks in advance
Lee

1 Like

You can use a BPM Data Form instead of an InfoMessageBox and that would allow you to set whatever size you want via customization

1 Like

Hey,

Thanks for that tip- I have created a BPM Data Form and created then a customized version of that form (to make it look pretty etc) but I can’t seem to find any c# code examples of how to actually call that form via custom code.

Is there any reference material for doing this- I have looked in the Ice tools customization guide, BPM guide, and customization guide over at Epicweb but can’t seem to find much on this?

Thanks again
Lee

Don’t call it from Custom Code, call it via a node. have the Custom code be the condition which calls the form :slight_smile:

Is there a way to call a BPM Data Form from custom C# code? I’m having to code in a form customization and need to have a prompt. It would be great to be able to call a BPM Data Form and use that, if possible.

I have done this but it really works quite poorly when called from custom code. If you are simply looking for a way to prompt the user for something in a form customization, there are much better ways to accomplish that than trying to call a BPM data form. You should note that it will only be called from your form customization, not from a BPM.

2 Likes

I am interested in changing the size of the popup message box when I call PublishInfoMessage simply because I am displaying debug info at various points in my C# code to test my understanding of whether my code is calculating something correctly. It is wasting a lot of time for me to try to resize each popup so I can see all the info. It also is annoying that the default action if I hit “Enter” is the “Detail” button instead of “OK” (so I have to hit TAB TAB TAB ENTER or else mouse over to the “OK”) but that is a different matter I suppose.

But it sounds like, and correct me if I am wrong, that you are saying that there really isn’t a good way to accomplish this?

It is not possible

Never say never

2 Likes

Or at least use it an even number of times in the same sentence.
(and no, zero is not even)

Have you considered logging to a file instead? The “logging” ecosystem is really growing in the web application arena these days. A lot of very powerful tools in the market. Logging is integral to the SysOps movement too. And since we seem to be heading that way…

2 Likes

From the Epicor documentation:

Note that the possible values for message type are: Information, Question, Warning, Error, UpdateConflict. The possible values for the InfoMessageDisplayMode are: Individual & Grid.

Anyone know what using Ice.Bpm.InfoMessageDisplayMode.Grid does?

The messages box looks the same as when you use .Individual

Never used it, this is the best I got:

If there are multiple messages associated, it will list them in a grid (and a slightly bigger box), otherwise, you will get individual message boxes

I presume if you do multiple messages in a call using Grid, you will get one message

Yeah confirmed, but it groups by Type, BO, and Method
image

image

2 Likes

How can I test this?

I mean making a message with multiple values
(i.e. infoMessage.MessageItems.Count > 1)

Everything I try fails a syntax check. Error’s like
cannot convert from 'string[]' to 'string'
and
cannot convert from 'System.Collections.Generic.List<string>' to 'string'

edit

whoops… I was composing when you made your last post.

But it looks like you make 3 consecutive calls. Is there a way to pass a variable with multiple items (not a string, or array of strings - unless that works) in a single call?

See above

Nope, I think the idea is you are building your message as you go, then after the call is done, it compiles them

If you REALLY wanted to do it that way I suppose you could use anonymous funcs

Action<List<string>> doMessage = messages => {
foreach(var msg in messages)
{
    PublishInfoMessage(msg, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Gridl, string.Empty, string.Empty);
}
};

then you can 
var MyMessages = new List<string>();
MyMessages.Add("Stuff");
..
doMessage(MyMessages);
1 Like

So if you want two disting messages, make sure to use the .Individual DisplayMode?

InfoMessageBox (mode=Individual)
image

InfoMessageBox (mode=Grid)
image

But with the Grid mode, you can hover the mouse over it and see the full message!

edit:

Make sure you follow up your initial call of PublishInfoMessage with a second one, with a blank message). This is to force the “Grid” type display.

3 Likes

Correct, if you look in the code snip from the decomp above, if there is only 1 message, it uses individual mode anyway