1. damian jimenez
  2. PowerServer
  3. Thursday, 18 May 2023 11:32 AM UTC
We are migrating our application to PowerServer (PB2022 Build 1900) and it is working great.
I'm currently having trouble with a Datawindow, since it doesn't exist initially.
These are created successfully at runtime. with:
dw_1.SetFullState(Blob_string)
The Blob_string argument is also created by configurations made by the user at run time. When executing dw_1.retrieve(), the DBError() event is fired I get SQLDBCode=-1 SQLErrText="Select error: Could not create datastore" the error handler of the window gives the option to cancel or try again, if it is tried several times,
finally, the data is displayed correctly. I have tried programmatically to ignore all script error
(when IsPowerserverApp() is true and SQLERRText="Select Error: Failed to create the datastore").
By doing it this way, the behavior of the program for the end user is transparent and immediate and no errors are observed.
But I'm looking for a better way to solve it.
why dberror is triggered ? 
How can I prevent dberror from triggering ? 

thank you so much

Damian

mike S Accepted Answer Pending Moderation
  1. Monday, 22 May 2023 15:20 PM UTC
  2. PowerServer
  3. # 1

You should test it with a datawindow source that does not require an argument to see whether the problem is with the setfullstate. 

I am guessing that maybe it is the argument creation that is the problem.

 

also post the actual code from setfullstate to the retrieve.

 

Comment
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Friday, 19 May 2023 03:11 AM UTC
  2. PowerServer
  3. # 2

Hi Damian,

It looks like a bug. Kindly please report your issue and PB case via our support ticketing system to ensure it is being properly received by our tech support and tracked at: https://www.appeon.com/standardsupport/

Regards,
Logan
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 19 May 2023 18:38 PM UTC
  2. PowerServer
  3. # 3

Hi Damien;

  This could also be because ...

1) The DWO source is not located in the PB App's source PBLs. For example: it's dynamically retrieved from a DBMS Blob column or in your case, it only lives after a SetFullState() command. Both meaning it's only there at App runtime - never at compile time.

2) Due to #1 - no corresponding C# Web API(s) code was built during the PS compilation (build & deploy) phase - because no SQL was analyzed and thus, no C# code generate to handle it..

3) Thus, after the DWO is dynamically built "on the fly" from an external source, the PS App has no idea how to handle it's SQL at runtime.

Regards ... Chris

Comment
  1. mike S
  2. Monday, 22 May 2023 15:15 PM UTC
Actually, PS fully supports dynamically created dwos. It can be created at runtime via script or retrieved from a database blob or anywhere else. PS handles not having the sql at compile time. And, if the datawindow is available at compile time and you change the SQL at runtime, PS correctly runs the updated sql.















  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 24 May 2023 18:43 PM UTC
Hi Mike;

Actually, PS Apps will fail on SelectBlob or LibraryImport, etc dynamically acquired DWO's as the PS Compile needs to build the .NET DWO's and the Web API's as it sees the inline and DWO's DML commands in the C/S App's PBLs / PBDs.

If the PS compile does not have any DWO's to look at (no DWOs in the PBL/PBD), there will be no Web API's built for them. Thus a runtime, the PS App will fail when processing (for example: A SelectBlob only DWO).

What PS does support is the SyntaxFromSQL() command as during the compilation (Build & Deploy) sequence, it *does* sees all the actual DML and thus generates the C# code for the .NET DWO + Web APIs. HTH

Regards ... Chris
  1. Helpful
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.