NetTalk Central

Author Topic: Pause session until a process finish  (Read 1410 times)

hectorp

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Email
Pause session until a process finish
« on: July 14, 2021, 10:12:04 AM »
Hi,

I need to pause a form after a user save a record. When the record is inserted a process will execute in the server/background. Meanwhile the form must pause for a few seconds until the process finished.

Is there a command to indicate a form to pause before jumping to the next form?

TIA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: Pause session until a process finish
« Reply #1 on: July 14, 2021, 10:21:24 PM »

What exactly do you mean by "pause a form"?
Does the user see anything while it is paused?

Also not completely sure what "jumping to the next form" means? You mean the On Save URL for the form?

code you put in the various Post routines (postInsert, postCopy, PostUpdate) will execute after the write to disk, and before the destination URL is processed. So that _sounds_ to me like what you are looking for.

Cheers
Bruce

hectorp

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Email
Re: Pause session until a process finish
« Reply #2 on: July 15, 2021, 12:21:31 PM »
Hi Bruce,

This NTWS application is sending requests to another application which is not a Clarion one.  The data interchange is done by xml messages. The NTWS application send an xml request to the second application in the postInsert embed.

The other application reads/process the request and save the necessary data in the TPS file.

So when the Save URL for the form execute, the result of the request will be displayed in a browse form.

The problem is that sometimes the browse form is blank, so no data is displayed. But the data is in the TPS file.

I need a way to synchronize the time the request is sent and the display of the browse form so no blank browse is displayed.

I don't think a SLEEP command here is the most elegant way to do it.

Thank you for your response.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: Pause session until a process finish
« Reply #3 on: July 15, 2021, 09:27:54 PM »
Hi Hector,

>> The NTWS application send an xml request to the second application in the postInsert embed.

to do this right this should be a call to another procedure in the app. ie embed this API request in another procedure, and call that procedure from PostInsert.

This other procedure must be a Window procedure (you can hide the window), you make the request at the end of the INIT method, and you handle the result in the PageReceived method. You must post an event:closewindow from both PageRecieved and ErrorTrap to make the window nice and automatic.

cheers
Bruce