1. DEVASENAAPATHY SHANMUGATHARASU
  2. PowerBuilder
  3. Saturday, 29 October 2022 03:04 AM UTC

Hi Appeon Community, 

Restart() function does not provide Restarting the application, The application is getting closed but it not opening again, What will be the issue? Please help me .

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Sunday, 30 October 2022 00:00 AM UTC
  2. PowerBuilder
  3. # 1

Hi Dev;

  The Restart command can be called from anywhere. You can see this in action in my STD Framework's Demo App. You can download the free framework & demo App from here ...

https://sourceforge.net/projects/stdfndclass/files/Applications/PowerBuilder/OrderEntry/

  Tip: During a restart operation, you might want to set a global flag so the the CloseQuery & Close events are ignored (depending on your App's design).

HTH 

Regards .... Chris

Comment
  1. Miguel Leeuwe
  2. Sunday, 30 October 2022 02:17 AM UTC
Thanks for clearing that up Chris!

Like John, I haven't used it myself yet, so this if good to know.

regards.
  1. Helpful
  1. Miguel Leeuwe
  2. Sunday, 30 October 2022 02:25 AM UTC
Then there's this other information in the help saying that "the Close() events would be ignored and a COMMIT would be issued". I guess we'll have to do some testing to verify also if this is really true. If not, like Chris said, we'd have to set some global flag to avoid any messageboxes interrupting the restart. (for example).
  1. Helpful
  1. Chris Pollach @Appeon
  2. Sunday, 30 October 2022 02:44 AM UTC
This is a very important feature for PB2021/2022 PowerClient & PowerServer apps! If you want to deploy a new App version within business hours. The PC/PS feature will only do this when the App is shut down & then when it's started up again the next time. With the Restart command, you could have an OOAK table in your DB where you post the current version & date/time that it needs to be activated. If your PC/PS app monitors this OOAK table (say on a timer), if the value changes from when the App 1st reads it at startup & the current date/time >= the new activation time, your app can control the new version refresh via the Restart command.

Food for thought. ;-)
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Saturday, 29 October 2022 03:42 AM UTC
  2. PowerBuilder
  3. # 2

For a question such as this, it is VERY helpful to know what version, release & build of PowerBuilder you are using... would you please tell us?

Also: Is the app deployed as machine code (DLL's) or pseudo-code (PBD's)?

Is the application deployed as 32-bit or 64-bit?

Are you using PowerClient to manage/start the application?

The PB Help topic for the Restart() PowerScript function leads one to believe it should be used only in the Application object's Idle event. Is this where you are calling it from? If not, where are you calling Restart() from?

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Saturday, 29 October 2022 23:03 PM UTC
  2. PowerBuilder
  3. # 3

Like John said: RESTART can be used in the application-level IDLE event.

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Saturday, 29 October 2022 23:49 PM UTC
  2. PowerBuilder
  3. # 4

Hi John and Olan,

If it's really true that the Restart() can only be used in the Idle event, that kind of makes it an almost useless command isn't it?

I'd like to use it being in control of whenever I feel that a restart would be needed, not when the user has fallen asleep for x time...

Maybe I'm missing the point here.

Best regards,

MiguelL

Comment
  1. John Fauss
  2. Sunday, 30 October 2022 01:14 AM UTC
I was surprised to see that wording in the Help topic, so I really appreciate Chris' clarification. I can't recall ever using the Restart() function and that's why I looked at Help.
  1. Helpful 2
There are no comments made yet.
DEVASENAAPATHY SHANMUGATHARASU Accepted Answer Pending Moderation
  1. Monday, 31 October 2022 14:54 PM UTC
  2. PowerBuilder
  3. # 5

Hi John, 

I am not using Restart() in application's event, I am using in a window to restart the application.

I am deployed my application as PBD, it is 32 bit application.

I am using PB 2021.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.