Showing posts with label datawindow. Show all posts
Showing posts with label datawindow. Show all posts

Invalid Datawindow row/column specified at line xx


Error: Invalid DataWindow row/column specified at line xxx in function of _funct of oject n_cst_xyz."

 Click OK -> "Application terminated. Error: Null object reference at line 27 in XYZ event of object n_cst_xyz."

Possible Reasons:
  • Rows Retrieved is zero.
  • Incorrect column name specified in the script.
  • There might be a row retrieved, but there may not be a row in the primary buffer.

DataWindow Error: Row changed between retrieve and update

Normally this problem comes in multiuser scenarios where some other user has modified the record on which you are working. In a single user scenario this will come only if the datawindow flags have not been properly set/reset after an update command.

The best way to avoid the "row changed between retrieve and update" error is to use the "Key columns" update option. If you have timestamps or fields updated by triggers including them in the update statement ("Key and updateable columns") can cause problems.

Consuming Web Services in Powerbuilder Classic 12.5 - The DataWindow method

A web service is any piece of software that makes itself available over the internet and uses a standardized XML messaging system. XML is used to encode all communications to a web service. For example, a client invokes a web service by sending an XML message, then waits for a corresponding XML response. Because all communication is in XML, web services are not tied to any one operating system or programming language.

In Powerbuilder 12.5, WebServices can be used either using the new Web Servicesdatasource or by Web Service Proxy wizard. 

The below step by step approach is for consuming a web service through datawindow web service. The Web Service used in http://www.webservicex.net/stockquote.asmx?WSDL

Step 1. Click New
Step 2. Navigate to Datawindow tab
Step 3. Select Web Service. Click Next button.
Step 4. Provide the WSDL file name (http://www.webservicex.net/stockquote.asmx?WSDL). Assembly name is optional.                   
Step 5. The web service list is displayed. We have only 1 web service linked to WSDL file.
Step 6. Functions associated with the web service will display. These functions are defined in the web service and are used in powerscript to get data from the web service.
Step 7. Select the RET parameter. Once we hit Finish, the datawindow looks like this
Step 8. Select the setting for your datawindow and click finish
Save the datwindow                                                                   

 To test the data retrieval, right click in Datawindow Preview mode and select Retrieve
.
Provide the value. I have used T as symbol. T stands for AT & T. You can test using the list available at http://en.wikipedia.org/wiki/Companies_listed_on_the_New_York_Stock_Exchange
The data is being returned as XML.