![]() |
Sergey Kornilov admin 1/9/2025 |
You need tomake sure that your query returns data. As far as I can see, your query relies on tsTicks variable that is not defined anywhere. In either case, you need to use Chrome Developer Tools to see the response from the server code and see what exactly is being passed from Server event to ClientAfter event. Also, printing the actual SQL query from the Server event would be benefitial. More info: |
G
|
Garyl author 1/9/2025 |
Yes it does return data, and I can use that data in the server event. This is from Dev Tools out of chrome in the response. select * from patient.tasks where vitallink = 'ts638720182163630057'<br/>{"record":{"Id":103,"PatientId":"638717730519009103","UpdatedBy":"gxxxxxx","TaskTitle":"120","Description":"RPM Vital Review CPT 99457 Provides review of vitals by a qualified clinician","NeedFollowup":null,"FollowupStaffId":"","FollowupTime":"","StaffId":"gxxxxxx","StartTime":"2025-01-19 11:16:56","DueTime":"2025-01-19 11:16:56","CreatedAt":"2025-01-09 11:16:56","FinalOutcome":"","ClosedBy":"","Priority":1,"Status":"2778","Outcome":"","TaskTemplateItemId":null,"TrackedTimeInMinutes":"","DisplayOnSummaryReport":null,"TaskResultId":null,"ActionNeeded":null,"IsUrgent":null,"TaskType":null,"CreatedBy":"gxxxxx","ServiceHistoryId":1,"vitallink":"ts638720182163630057"}} I defind tsTicks just above that, did not copy it in prior long ticks = DateTime.Now.Ticks; I just cannot seem to get it in the ClientAfter Event. |
![]() |
Sergey Kornilov admin 1/9/2025 |
If the query is correct and data is retrieved and being passed to the ClientAfter event, then it means you are doing something wrong with it in ClientAfter event. You need to rememer that you are passing an array from Server to ClientAfter event and you need to treat it as an array as opposed to a scalar variable. |
G
|
Garyl author 1/9/2025 |
Ok so I know that what I am passing did have data, so this evening I took a different approach. I wiped everything out, put in a new custom button, and when clicked I received the Hello World !!! Then I wiped ever everything in the ClientBefore removed the Parmeter in the Server and just put in quotes Hello World and it worked fine. I left the ClientAfter the same var message = result["txt"] + " !!!"; In the Server I added one line of test code at a time: Test 1Server *Compiled Worked as expected Test 2Server Code string logFilePath = @"C:\inetpub\prod\temp\checktskupdate.txt"; Compiled Worked as expected Test 3Server Code string logFilePath = @"C:\inetpub\prod\temp\checktskupdate.txt";
Worked as expected Test 4Server Code string logFilePath = @"C:\inetpub\prod\temp\checktskupdate.txt"; Compiled Test 5Server Code string logFilePath = @"C:\inetpub\prod\temp\checktskupdate.txt"; Compiled FAILED It Seems to be when I use DB.Query that it fails for some reason, NOTE, I never at one time changed what was in result["txt"]. it always had "Hello World" so i know what was being passed to ClientAfter was static. |
![]() |
Sergey Kornilov admin 1/10/2025 |
Go back to basics: You need to find where exactly your code breaks and why. |
G
|
Garyl author 1/10/2025 |
I did, however you throw in the server event DB.Query, DB.Exec, DB, Select, DB, Lookup in that event and it it breaks what ever you try to put in result, or better yet, not even populate it. If you noticed in my testing, I did not populate result with the result of the query, I kept with Hello World in my trouble shooting. When I put in DB.Query, that is when it broke. The query runs fine, and I can prove I get the correct results expected in the log file, however without even populating result Again, my flow, create a custom button, run it you get back Hello World !!! now throw a simple query using DB.Query, etc, in the server event, and try to populate result, in my app it breaks. Gary |
![]() |
Sergey Kornilov admin 1/10/2025 |
Nobody can possibly tell what is wrong with your code without having access to your project. I can see in earlier posts that your query was executed and correct data were passed to ClientAfter event. So that part alone wasn't a problem though now you started adding SetConnection() call that wasn't there before. In either case, you cannot GUESS the correct code. You need to step through the each line of the code and find where it breaks and what is wrong. |
G
|
Garyl author 1/11/2025 |
Thank you, I figure out a solution for this, Tri-part is working. Gary |