Confirmation message?

I have a button to save some process in my APPayments Form.

In this Form i have a Button to generate an XML and set the Payment as "Generated".

When click the button, the process run and set the values.

But... I need a confirmation message on this button:

Ok: run the process normal

Cancel: this option cancel the process to set the "Generated" value

 

How can i set a confirmation message?

I code in Visual Basic.

 

Sorry for my english

  • Francisco, I do not have an answer to your question, but just wanted to say that you do not need to offer an apology for your English. Have a great day!
  • The Help documentation from Mongoose is a little vague on this-- however after some fiddling around i got you some info.

    Infor Docs for Application.ShowMessage: https://docs.infor.com/mg/10.x/en-us/mongooseolh/default.html?helpcontent=lsm1454148040187.html

    The signatures:

    'Public Function ShowMessage(Prompt As String, Style As Microsoft.VisualBasic.MsgBoxStyle, Caption As String) As Mongoose.Scripting.wsMsgBoxResult': Option Strict On disallows implicit conversions from 'Microsoft.VisualBasic.MsgBoxStyle' to 'String'.
    'Public Function ShowMessage(Prompt As String, Buttons As Mongoose.Scripting.wsMessageStyle, Icon As Mongoose.Scripting.wsMessageStyle) As Mongoose.Scripting.wsMsgBoxResult': Option Strict On disallows implicit conversions from 'Microsoft.VisualBasic.MsgBoxStyle' to 'Mongoose.Scripting.wsMessageStyle'.

    So to accomplish what you're wanting to do you could simply use the second one. This one allows the use of an Icon on the messagebox whereas the first one does not.

    Public Function ShowMessage(Prompt As String, Buttons As Mongoose.Scripting.wsMessageStyle, Icon As Mongoose.Scripting.wsMessageStyle) As Mongoose.Scripting.wsMsgBoxResult

     An example for this particular signature would be:

    If Application.ShowMessage("Do you want to continue", Mongoose.Scripting.wsMessageStyle.wsOKCancel, Mongoose.Scripting.wsMessageStyle.wsQuestion) = Mongoose.Scripting.wsMsgBoxResult.wsOK Then
         Application.ShowMessage("You clicked OK")
    Else
        Application.ShowMessage("You clicked cancel")
    End If

    Let me know how this works for you.

  • Use the prompt event response type, no code needed and it supports string substitution for building the message.

    docs.infor.com/.../lsm1454148024166.html

    Differing style/buttons are available and these can also prompt WinStudio Events.

    if you absolutely have to code then your code can trigger the event handler which shows the prompt, and the prompt event can in turn invoke another event handler with script attached.

    In many cases no code is required to do basic operations like variable management and conditional checks.
  • Very interesting Lee, and although this is not my thread I'm wondering: the doc seems to say that the prompt would allow for the posting to occur even without an answer because it is asynchronous and non-blocking (?).
    So, does this mean it would not suffice for a confirmation message, whose purpose is to block the further events to execute unless the user clicked Yes/OK on the prompt?
    (or did I misunderstand the doc?)
  • Hi Florent.  

    The way the prompt is designed, it should be the last handler in the event, unless you want operations to continue whilst the prompt is open.

    I think the docs mention the standard behaviour to avoid confusion.

    It will trigger secondary event(s) depending on which button is pressed.

    Begin with a GenerateXmlPrompt event which displays the prompt, then does nothing.

    Have a GenerateXmlOK event which does the generation, firing that event off OK button in the Prompt.

    A GenerateXmlCancel event could be fired if you wanted to do something when the user cancels the operation (though usually on a 'cancel' there would be no follow up actions).

    Lee

  • ¡Ey Lee! Thanks very much, this really helpful me.
    Now i can validate "something" depending of my user's decisions.