1. Richard C
  2. SnapDevelop
  3. Thursday, 18 August 2022 23:05 PM UTC

I attached a PB workspace to my SnapDevelop solution and used a datawindow to convert to data model. Later I scaffolded it to service and controller but they have only the RetrieveAsync method. How do I get the other Post, Put, Delete methods to scaffold? In the dialog, I see checkboxes for all the methods checked while scaffolding but it still does not add those methods to the controller or service. The datawindow has key columns and is updateable but getting only Retrieve method.

Using template - 

  • Any Client is generating Create and Retrieve methods.
  • Non-PB Client is generating Create and Retrieve methods.
  • PB Client is generating only Retrieve method.

In all cases, there is no Delete or Update methods scaffolded.

SnapDevelop 2021 build 1506

Richard C Accepted Answer Pending Moderation
  1. Friday, 19 August 2022 05:23 AM UTC
  2. SnapDevelop
  3. # 1

Yes, I realized the key columns were included but the DW was not updateable.

Still wonder why it was scaffolding the Create method even though it would not create new records due to non-updateability but also it was not scaffolding the Update and Delete methods which is inconsistent.

Only the "Any Client" and "Non-PB Client" templates generate Retrieve, Create, Update and Delete methods separately.

How do we authorize and validate individual create/update/delete logic if using "PB Client" template as it scaffolds only Retrieve and Update methods and Update is used for insert/update/delete?

Comment
  1. Logan Liu @Appeon
  2. Monday, 22 August 2022 04:57 AM UTC
Hi Richard,

Yes. I think you are right. It should not generate the Create method if the .NET DataStore Model is non-updatable in the "Any Client" and "Non-PB Client" templates. Please submit this issue via our support ticketing system to ensure it is received by our tech support and tracked at: https://www.appeon.com/standardsupport/.



Regarding your second question, I think you need to make multiple copies of the Update Action, which is more convenient to authorize separately. You need to do it manually.

You can also try to define custom Scaffolding templates. But they are complicated and hard to debug.

Refer to: https://docs.appeon.com/snapdevelop2021/Scaffolding/index.html#viewing-and-editing-scaffolding-templates



Regards, Logan
  1. Helpful
  1. Richard C
  2. Tuesday, 23 August 2022 16:06 PM UTC
Done - submitted a ticket.
  1. Helpful
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Friday, 19 August 2022 03:13 AM UTC
  2. SnapDevelop
  3. # 2

Hi Richard,

Both Update and Delete need to know the primary key and the update table. Please verify your model class, and make sure there is an [Table] attribute applied to the model class. And at least one [Key] attribute applied for a property.

To generate the [Table] attribute and [Key] attribute correctly when using DataWindow Converter, please make sure 1) there is a primary key defined for your table in the database and 2) the DataWindow object has an Update Table specified in the Update Properties in PowerBuilder.

Regards,

Logan

Comment
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.