Get A datavalue forme dynamic viewer to SDO

Tharanga herath

New Member
I have a procedure, which is in the viewer dynamic super procedure. And need to call this procedure in the SDO logic procedure. I used following code segment in my SDO logic procedure

{get updateSource hTest}.
ASSIGN cCurrency = DYNAMIC-FUNCTION("test":U IN htest).
This work for me when I used this with direct db connection. But with Appserver this wont get execute and give me an error. Function not found.
Pls help me to sole this problem
 
Hi Tharanga,

Code:
define var hDataSource  as handle no-undo.
define var cColValues   as char no-undo.

/* retrieve the data object linked to this viewer */

hDataSource = dynamic-function( "linkHandles", "data-source" ).
if not valid-handle( hDataSource ) then return.

/* fetch column values of the current row from the data object */

cColValues = dynamic-function( "colValues" in hDataSource, "itemnum" ).
message entry( 2, cColValues, chr(1) ) view-as alert-box. /* the first entry is a comma separated list of rowids */
What I usually do when I'm working with Dynamics and ADM2 is look at the methods and properties of the relevant smart object and it's classes to find what I'm looking for.

I like to say that the ADM2 reference doc is your friend :)

Hope this helps.
 
updateSource function returns you a handle to procedure in your current session. When running sdo on app server sdo runs in different session and therefore doesn't have a way to run something in your client session. You should redesign you program flow to either call it from sdo _cl file before executing something on app server or not to call it at all.
 
you could mark your test procedure as non db-required so it will be included in the client side proxy but even then it would need to make a call to the data object or another procedure on the other side of the appserver.

imvho a more logical and simpler way would be to include the currency info in the data object query and fetch the current row currency value using the colValues( ) function.
 
This does NOT answer your question, though it a thought for future development.
I personally DO NOT LIKE defining a hadle to use in executing a block. The overhead is initially to assign the handle earlier in the block. E.g. RUN whatever IN handle / with the work arounds you are using function whatever IN handle. This is 90s Progress and ADM(1) which fell down. V9 implemented named events which is looser coupling. A handle is not needed. I would have used the PUBLISH SUBSCRIBE mecanism available. Publish the named event in the Smart Data Viewer where the UI triggers are, then SUBSCRIBE to that event where the business logic processing is. I know it does not answer the question though that is the approach I would have taken. By naming the object handle you are limiting future development.
 
Back
Top