Hi, Is there a FormAPI call to get the workarea owner user namethanks
<item name="owner" pathid="owner"> <label>Owner</label> <text size="40" /></item>
read the templating developers manual. For TS 6.7, appendix B talks about using callouts. The perl script will get the workarea name. Then run:$iwhome/bin/iwattrib $workarea ownerthat will return the owner, the callout can insert that into the DCR field.Make it readonly or hidden with formapi
is this service available in TS 6.5?I am using TS 6.5
function set_datacapture_item_value( selectedValue ){ if ((window.opener == null) || (window.opener.closed)) { return false; } var calloutForm = eval($form_name); if (!calloutForm) { return false; } var calloutElementFound = false; for ( i = 0 ; i < calloutForm.elements.length ; i++ ) { if (calloutForm.elements.name == '$element_name') { calloutForm.elements.value = selectedValue; calloutElementFound = true; break; } } if (!calloutElementFound) { return false; } return true;}
Hi CGI-callout experts, as my knowledge extend, I knew that CGI callout usually will launch a popup windows when user clicks on a button and then user selects value from there, and a javascript function will populate the value back into DCT. function set_datacapture_item_value( selectedValue ){ if ((window.opener == null) || (window.opener.closed)) { return false; } var calloutForm = eval($form_name); if (!calloutForm) { return false; } var calloutElementFound = false; for ( i = 0 ; i < calloutForm.elements.length ; i++ ) { if (calloutForm.elements.name == '$element_name') { calloutForm.elements.value = selectedValue; calloutElementFound = true; break; } } if (!calloutElementFound) { return false; } return true;}In my case, I need to capture the workarea name, and the workarea owner name, and populate them into DCT, which doesn't require user interaction.my 1st question is, can the CGI-callout be trigger automatically (example, on DCT load)? How?my 2nd question is, since there is no user interaction, can we by pass the popup window and use perl script instead of using Javascript to write the value back to DCT? How?
A1. Yes. Almost any FormAPI activity can be triggered upon Form opening. To do that you'd have to code and register your own Handlerfor 'onFormInit' Event, there are samples in FormAPI manual and/or DevNet. Although you can not *trigger* callout Event from it(not in any supported manner anyway) you can call desired Callout Event Handler(s) directly from onFormInit Handler.A2. Yes. FormAPI is Client-side technology. All this jazz is played by Browser's JS Engine. Access to Server resources is provided viaIWDatacapture.callServer method. Note that since it is asynchronous, callServer is by far the most complex FormAPI method to properly implement.Having said all that - note that it's just educational. You do not need these FormAPI, CGI Callouts, callServer and whatnot to do what you need. Ghoti pointed out (10 months ago? 11?) that the easiest way to do it is by using DCT Inline command. Guess what, it is stilltrue today. "Inline" is executed on the Sever Side, it's run automatically, there are no extra Windows and WA Path is provided to you in the Environment variable.Please note also that the code fragment you've provided (what for?) is obsolete. It still can be used for legacy DCT CGI Callouts.Somewhat modified, it can be used in MDCT CGI Callouts (IWOV modified MDCT Form in 6.x, it used to be structured identically to DCT).In all other cases FormAPI allows you to code any 'callback' function you wish within DCT Form and access it from CGI's JS.
Yes, you are true.I successfully build a inline script to get the current workarea the user is working on.however, when I try the same method to get the workarea owner name, I failed. it always return me empty value.I make a copy and hardcode the workarea and run under CMD, I can see the workarea owner printed on the cmd screen.do any expert here know what is going wrong?
Try to redirect STDERR to see what your problem is. Like that:my $execute_string = qq($iwhome/bin/iwattrib $workarea_vpath owner 2>&1);That may return execution error message if you have any
ERROR:5000068: Error connecting to server: s01tdi123
wow, thats amazing.I got this error message: ERROR:5000068: Error connecting to server: s01tdi123 I thought inline script will be execute on server side?Anyway, when I run the command, I remote desktop into the server to execute the perl script. Therefore I didn't got this error when I run the script manually.
Hi,I have the following immediate opening...
The inline script is executed on the server side.Is s01tdi123 the actual TS server? Or is it an "old" TS Server that was upgraded / migrated to a new machine?This could be a symptom of an improperly configured iw.cfg file...
Error:5000068
$iwhome/bin/iwattrib $workarea_vpath owner
Hi there, since no new reply on this anymore, I would like to refresh this issue, I still facing the same problem. Did anyone have any similar experience before?when I call the inline script to run an iw cmd: $iwhome/bin/iwattrib $workarea_vpath owner I got this error: ERROR:5000068: Error connecting to server: s01tdi123
$workarea_vpath
If the article Bo posted does not help you should call support.BTW, do any CLTs work ?
What is the actual value of $workarea_vpath?(it's difficult to debug a problem like this when you cannot see it for yourself)
//s01tdi123/default/main/test_va/WORKAREA/master
$iw-home/bin/iwaccess owner //s01tdi123/default/main/test_va/WORKAREA/master
You can try the CLT iwaccess, this should work fine $iw-home/bin/iwaccess owner //s01tdi123/default/main/test_va/WORKAREA/master Let us know if this is flexible to be used in your requirement.
this is the value of $workarea_vpath. //s01tdi123/default/main/test_va/WORKAREA/master
$workarea_vpath =~ s|^//[^/]+||;