NetTalk Central

Author Topic: CASE MESSAGE on NT  (Read 6278 times)

osquiabro

  • Hero Member
  • *****
  • Posts: 664
    • View Profile
    • Email
CASE MESSAGE on NT
« on: October 05, 2019, 06:28:35 AM »
is possible create a case message popup like clarion desktop ?? like this :

CASE MESSAGE('Are you sure you want to Change Zip Code? etc..

thanks

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: CASE MESSAGE on NT
« Reply #1 on: October 09, 2019, 02:28:22 AM »
Hi Osa,

yes, but the context matters. Remember the web page is always moving forward.
So it's probably not going to "work" the way you expect - there's no procedure "waiting" on the server for the user to enter input.

So in order to answer this question better I would need to know a lot more about your context. Where you are, what you are doing, and what you are hoping to do with this message, etc.

cheers
Bruce


osquiabro

  • Hero Member
  • *****
  • Posts: 664
    • View Profile
    • Email
Re: CASE MESSAGE on NT
« Reply #2 on: October 09, 2019, 08:18:29 AM »
is simple i have a Zip Code field and need a popup message before change the value of the field

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: CASE MESSAGE on NT
« Reply #3 on: October 09, 2019, 10:06:43 PM »
You can have a popup message - alerting the user to some detail, when the field is changed.
But in that context it would be a message, not a decision (ie not a yes/no question).

Tell me more about the message you are intending to display, and what you then expect the user to do, and then what you want to do based on that...

cheers
Bruce

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: CASE MESSAGE on NT
« Reply #4 on: October 10, 2019, 05:12:46 AM »
Hello Bruce,

I think osquiabro is looking for confirmation message, similar when in a browse the user is gonna delete a record. But in this case, alter or change the record.
« Last Edit: October 10, 2019, 05:16:44 AM by urayoan »

osquiabro

  • Hero Member
  • *****
  • Posts: 664
    • View Profile
    • Email
Re: CASE MESSAGE on NT
« Reply #5 on: October 10, 2019, 05:43:29 AM »
Exactly urayoan, but for more specific this is a code that run in desktop program and needed a similar code with NT

CASE MESSAGE('Are you sure you want to Change Zip Code?, This Change Delivery Charge.','Alert',ICON:Question,+Button:Yes+Button:No,,1)
            OF Button:Yes
                PUT(BillofLadings)
                History::Bil3:Record  :=: Bil3:RECORD
                SQL{prop:sql} ='select BillofladingId, isnull(ChargeId,0) as ChargeId, PaymentType,0 as ChargeTypeId, ChargeDescription from billofladingcharges where billofladingid= '&Bil3:BillofLadingId & ' AND ChargeDescription = <39>'& 'DELIVERY<39>'
                   
                LOOP
                    NEXT(SQL)
                    IF ERRORCODE() THEN BREAK.
                    CASE Bil3:PaymentZone
                    OF 'C'
                        Shipper{prop:sql} = 'CALL BolChargesByCharge('&Bil3:BillofLadingId &','&chr(39)&CLIP(SQL:C3)&CHR(39)&','&Bil3:CustomerId&','& 0 &','&CLIP(SQL:C2) & ',0)'                               
                        BREAK
                    OF 'P'
                        Shipper{prop:sql} = 'CALL BolChargesByCharge('&Bil3:BillofLadingId &','&chr(39)&CLIP(SQL:C3)&CHR(39)&','&Bil3:ShipperId&','& 0& ','&CLIP(SQL:C2) & ',0)'                                 
                        BREAK
                    OF 'T'
                        Shipper{prop:sql} = 'CALL BolChargesByCharge('&Bil3:BillofLadingId &','&chr(39)&CLIP(SQL:C3)&CHR(39)&','&Bil3:PartyId&','& 0 &','&CLIP(SQL:C2) & ',0)'                                 
                        BREAK
                    END                       
                END
                Charges.Load
                Charges.Reset(1)
            OF Button:No
                Bil3:ShipToZipCode = History::Bil3:Record.Bil3:ShipToZipCode
                Bil3:ShipToCity    = History::Bil3:Record.Bil3:ShipToCity
                Bil3:ShipToState   = History::Bil3:Record.Bil3:ShipToState
                SELECT(?Bil3:ShipToZipCode)
                ThisWindow.Reset(1)
            END
        END

osquiabro

  • Hero Member
  • *****
  • Posts: 664
    • View Profile
    • Email
Re: CASE MESSAGE on NT
« Reply #6 on: November 06, 2019, 09:07:09 AM »
this is possible with NT or not?

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: CASE MESSAGE on NT
« Reply #7 on: November 06, 2019, 03:06:24 PM »
Hi Osquiabro,

Totally possible.

Create Memory Form and format it so it can ask your question (this could easily be generic like message).

Call it as a popup at the correct time.

Record its response somewhere (like session variable).

Back when your previous screen gains focus after the popup closes, check the session variable.

Perform necessary actions.

Regards
Bill

osquiabro

  • Hero Member
  • *****
  • Posts: 664
    • View Profile
    • Email
Re: CASE MESSAGE on NT
« Reply #8 on: November 06, 2019, 05:17:11 PM »
but how call a popup after user change a value of field like my sample code that is when change zip code

thanks..

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: CASE MESSAGE on NT
« Reply #9 on: November 06, 2019, 06:15:35 PM »
Tick "Send new value to server", then in that embed, check if the value changed.

There is a javascript function called ntd.push that will open a popup window for you. I also think in a newer version of NT (then what I user), there may be a nicer way to access it.

Use p_web.script & ntd.push to open your popup (dont forget you need to tell NT you are using a popup window by calling YourMessage(p_web,Net:Web:Popup) in your calling screens init stuff.

eg.

IF ValueChanged = True
  p_web.Script('ntd.push(''YourMessage'',other parameters I cannot recall go here);')
.





osquiabro

  • Hero Member
  • *****
  • Posts: 664
    • View Profile
    • Email
Re: CASE MESSAGE on NT
« Reply #10 on: November 08, 2019, 10:12:54 AM »
bshields, thanks for your guide, look how it looks

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: CASE MESSAGE on NT
« Reply #11 on: November 08, 2019, 03:39:46 PM »
Perfect :)

Johan de Klerk

  • Full Member
  • ***
  • Posts: 214
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: CASE MESSAGE on NT
« Reply #12 on: November 08, 2019, 11:36:49 PM »
Hi Osquiabro,

Wow that looks nice.

I need to do something similar but have not idea how and where to start.

Are you willing to give a step by step guide on how you have done this please.

Regards

Johan de Klerk
Clarion 10, NT 11.57

osquiabro

  • Hero Member
  • *****
  • Posts: 664
    • View Profile
    • Email
Re: CASE MESSAGE on NT
« Reply #13 on: November 09, 2019, 05:10:05 AM »
hi Johan, this is small sample of call messagebox, the password field call a messagebox

osquiabro

  • Hero Member
  • *****
  • Posts: 664
    • View Profile
    • Email
Re: CASE MESSAGE on NT
« Reply #14 on: November 09, 2019, 08:08:24 AM »
i have a trouble with this solutions, if try to restore the previous value if a user select NO the field  the code in embed no work more.

 the code in is:

case p_web.gsv('Loc:Response')
OF 1
    loc:alert='Return Value for MessageBox: '&p_web.gsv('Loc:Response') &' Yes'
OF 2
    loc:alert='Return Value for MessageBox: '&p_web.gsv('Loc:Response') &' No'
    p_web.SetSessionValue(' MAI:Password', p_web.gsv('Password') )
    do refresh::MAI:Password
END
Do SendMessage

the do refresh::MAI:Password kill the embed work again

the p_web.gsv('Password') is initialize in PreUpdate