1. Louis Arena
  2. PowerServer
  3. Tuesday, 3 January 2023 16:06 PM UTC

How come the IDE is updating a datawindow correctly but Powerserver is not?  My code is very simplistic.  

I have a window that has 1 DW on it.  I have a button to update the DW and I also show the SQL in the sqlpreview event.  This issue is in both runtime and debug.  But I will explain what happens in debug.

I retrieve the DW.  I enter the sqlpreview event and see the syntax, no issues, for both IDE and Powerserver.

I update a column on the DW.

I accept text

I update the datawindow.  There are no issues in SQLCA. When I am in the IDE, I enter the sqlpreview and see the update command.  In Powerserver, I never enter the sqlpreview.

I have no issues with the update so I issue the commit. 

The data in the database is not updated in Powerserver.  I have deleted all files in my local inetpub and webapi folders and did a full rebuild.  The problem still exists.  Any advice?

Thanks

 

Louis Arena Accepted Answer Pending Moderation
  1. Wednesday, 4 January 2023 22:10 PM UTC
  2. PowerServer
  3. # 1

I was working with Appeon support and I discovered the problem.  My SQL statement has the following for the datetime column

 

CASE WHEN punchclock.out_time IS NULL AND CONVERT(DATE, attendance_day) = CONVERT(DATE, GETDATE())
THEN GETDATE()
ELSE punchclock.out_time END AS out_time,

 

Now the IDE still recognized that out_time is the column in the table punchclock I want to update but PS does not.

 

by changing the sql to just punchclock.out_time it works.  I reported this as a bug because if it works in the IDE it should work here.

Comment
  1. mike S
  2. Thursday, 5 January 2023 15:10 PM UTC
  1. Helpful 1
  1. Louis Arena
  2. Thursday, 5 January 2023 15:11 PM UTC
This is the official work around from Appeon. They are working on a fix. I fixed this, the issue was I figuring out what the problem was. I will upload their fix.
  1. Helpful
  1. mike S
  2. Thursday, 5 January 2023 15:43 PM UTC
I assume you are talking about using the pb.ini fix?

I have to wonder why they took the approach they did to begin with (using placeholder instead of the actual sql).

My guess is that @(_COLUMNS_PLACEHOLDER_) runs faster than using the actual sql, but they never said.
  1. Helpful
There are no comments made yet.
Louis Arena Accepted Answer Pending Moderation
  1. Tuesday, 3 January 2023 20:32 PM UTC
  2. PowerServer
  3. # 2

I just did a test.

lt_now = time('15:00')
ldt_temp = datetime(date('12/21/22'),lt_now)
dw_1.object.out_time[2] = ldt_temp

The code above generates a database error on update.  In the dberror event sqldbcode = -1.  sqlsyntax is blank.  sqlerrtext = database error.

 

This code works.

dw_1.object.reason[2] = 'no reason'

So it boils down to PS has an issue with updating datetime columns on a datawindow.  Anyone have a solution or workaround. I did not see anything in the documentation regarding anything unsupported.

 

 

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 3 January 2023 20:43 PM UTC
Hi Louis;

What DBMS & version are you using? Also, what DB Client software & settings?

Regards ... Chris
  1. Helpful
There are no comments made yet.
Louis Arena Accepted Answer Pending Moderation
  1. Tuesday, 3 January 2023 19:23 PM UTC
  2. PowerServer
  3. # 3

This is all great info.  But I have tracked it down to setting a datetime.  The unsupported documentation does not list anything about this.  But apparently the SetItem and/or Settext is not updating my column in PS and as a result no update statement is being issued.  I am trying to somehow create a work around.

 

 

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 3 January 2023 21:06 PM UTC
Weird! :-(

What if you created a new simple test case PS App with a new DWO on the same table that updates those same two columns. Does that work?

  1. Helpful
  1. Louis Arena
  2. Tuesday, 3 January 2023 21:12 PM UTC
I created a new test window. I took the code from the original DW and created a new tabular DW with no edits or anything. That is what I have been testing on. The punchclock table is being updated using embedded SQL, when a user logs in their record for the day is created. But the updates in a DW do not work.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 3 January 2023 21:19 PM UTC
Thanks for trying that Louis!

I would now suggest (since you have a simple test case), would be to open a Support Ticket for this issue.

In the support ticket, I would include ...

1) Test Case

2) DML to recreate the referenced Table

3) Test data for SS

Then we can delve deeper into this anomaly for you ;-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 3 January 2023 16:54 PM UTC
  2. PowerServer
  3. # 4

Hi Louis;

  The SQL Preview event is not supported in PowerServer 2022 currently.

FYI:  https://docs.appeon.com/ps2022/SQLPreview.html

Note that this event is planned to be supported in PB 2022 release #2 as per the roadmap...

https://www.appeon.com/developers/roadmap

In the meantime, please check the PS log ...

https://docs.appeon.com/ps2022/Logging_with_the_settings_in_Logging.json.html

HTH

Regards ... Chris

 

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 3 January 2023 17:25 PM UTC
Adding to what Chris said, anytime something works in client/server but not PowerServer most likely it is unsupported feature. So you should carefully review problematic code against the docs: https://docs.appeon.com/ps2022/unsupported_features_guide.html
  1. Helpful 1
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.