NetTalk Central

Author Topic: Where to embed the code to update record status after printed?  (Read 5441 times)

skyong38

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Where to embed the code to update record status after printed?
« on: November 15, 2018, 06:03:34 AM »
Hi,

May I know where is the correct embed point to write the code to update record status after printed button clicked and direct refresh browser?

I have tried few days, embed at Report procedure, it wont direct refresh the browse. Embed at "Server-side code when pressed" also not function.

Please advice. Thank you.

Regards,
Nelson

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Where to embed the code to update record status after printed?
« Reply #1 on: November 15, 2018, 10:22:42 PM »
Hi Nelson,

I'm not sure I'm understanding your question.
Can you explain again please?
I _think_ you are saying

a) on browse
b) user clicks in-row button to do a print
c) report updates some field in the table ("printed"?)
d) you want the browse to "refresh" to show the updated record?

cheers
Bruce


skyong38

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Re: Where to embed the code to update record status after printed?
« Reply #2 on: November 16, 2018, 03:51:08 AM »
Hi Bruce,

Yes, this is what I want.

Even I have click the "Refresh other column at the same row" and added "Printed" field. It also won't refresh. Need manual press F5 to refresh.

Please advice. Thank you.


Regards,
Nelson

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Where to embed the code to update record status after printed?
« Reply #3 on: November 19, 2018, 11:03:15 PM »
I suspect it is possibly refreshing - but "before" the report has altered the value.
Tell me more about the report display - do you open it in another tab? Or as a media field in the same form?

cheers
Bruce

skyong38

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Re: Where to embed the code to update record status after printed?
« Reply #4 on: November 26, 2018, 07:21:51 PM »
Hi Bruce,

I have create a sample app to show my problem.

Please have a look and correct me the problem.

Thank you.

regards,
Nelson

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Where to embed the code to update record status after printed?
« Reply #5 on: November 27, 2018, 12:53:37 AM »
Thanks for the example - they always help.

Unfortunately your approach here is not going to work "as is" (in NetTalk 10)
The report request happens on a thread - and it sets a variable. The report opens in another tab.
In other words the _browse_ is completely unaffected by it all.
In NetTalk 10 and earlier, the button can only do "one thing". This was primarily to avoid confusion.

With NetTalk 11 (11.05) I've extended it slightly. The button can now do 2 things, BUT (and it's a big BUT) the _order_ of the things is unknown. So in your case the button could;

a) open the report in another tab AND
b) notify the browse the button was pressed (and refresh the browse)

BUT the order of the above 2 events is not determined. Thus you cannot do something in one part (like setting CusA:Printed += 1) which affects the other part. You will need to decide to do it one one side, or the other side.

Cheers
Bruce