Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Examining a file within a display screen

Status
Not open for further replies.

femeur

Programmer
Apr 4, 2005
2
US
Hello, I am fairly new to ServiceCenter and have run into an issue. A display screen (cc.first) has an option that runs an existing RAD. I want the RAD to execute only when a value exists within a different table/file (not the table/file that is assigned to $file in the display screen). I want to search the "solution" table for an id... if it exists then the RAD should be executed. I tried to assign the solution table/file to a variable in the following manner (through the Pre-RAD expressions)...

'rtecall("fileinit", $L.errcode, $L.file1, "solution")'

The error says that the 4th parameter must be the source file. I checked the db and the "solution" table does exist in the db. How do I assign this file to a variable as a Pre-RAD Expression? Once assigned to the variable, is there an easy way to check the file for a value in a specific field?
 
check the documentation for validation / fill / formatcontrol

there is no rtecall fileinit , may be you talking about rinit ? check the links for this forum for some basic information ... you already got a peregrine training ;-) ?
 
Unfortunately I am unable to get the training, although it would be exceptionally useful. In the SC 5 documentation, "fileinit" is the correct parameter for the rtecall function. I am not seeing anything for "rinit". Is this new to version 6? What does it do and what is the syntax? When I use the rtecall syntax listed below it returns a value of true in the debug window.

'd rtecall("fileinit", $L.errcode, $L.file1, $file)'

So when I replace $file with "solution" is when SC generates an error (as in my first post). Any ideas of how I can instantiate the solution file so that it may be used?
 
The "rinit" RTECall is not in the SC5 documentation. It was listed in the documentation for SC4, but was dropped in later documentations. The SC4 documentation lists some other RTCalls that are also not listed in the newer docs.

"rinit" basically creates a new file handle and assigns it to a variable (file variable). While "fileinit" (which is a valid RTECall, as you say) requires the last parameter to be an existing file variable, "rinit" requires that it is a file name. Besides that difference, the syntax of these two are practically the same.

They used to have a copy of the SC4 "RAD Guide" (which lists the RTECalls) available for download at but I was not able to find the location while writing this. Anyway, you can register with that site; they also have a forum where you can post questions and the registration is free. Furthermore, one of the postings is an on-line list of all unlisted RTECalls; after registration, do a search on the keyword rtecalls or try the link
cheers,

JJ
 
This may push you in the right direction:

$L.solution.init.rc=rtecall("rinit",$L.solution.init.flg,$L.solution,"solution")

$L.solution.query="id=\""+id in $L.filed+"\"" <-- assumes string type for id

$L.solution.sel.rc=rtecall("select",$L.solution.sel.flg,$L.solution,$L.query)

You could base your condition on the $L.solution.sel.flg which will return 1 if one record, 2 if multiple, 3 if no records found, 4 if error.

Condition might be (depending on your requirements):

same($L.solution.sel.flg,1) or same($L.solution.sel.flg,2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top