MyAdminForm.Current.Local.txtLocalVariable returns nothing...
I have an admin form, myAdminForm, with two date fields, Local.dtmStart and Local.dtmEnd, and a command button that opens another admin form, mySecondForm.
From the MySecondForm I am trying to get the myAdminForm date field values, like this:
myAdminForm af = new myAdminForm();
local.dtmStart = af.Current.Local.dtmStart;
The date fields have Field is dependent on another checked.
The af.Current.Local.dtmStart command, however, is returning nothing.
Has anyone try this? Any ideas?
Thanks,
Stephen
Comments
-
Hi Stephen,
Is it absolutely necessary to do this on the server? Have you tried passing the values as dialog parameters between your Admin forms client side with javascript? I don't think Local variables' scope will allow what you're trying to do between forms.
In this example, OpenCalledForm() is on the calling button on the 1st Admin form… LoadCalledForm() is on the Load event of the 2nd Admin form. Textfields are used here but Datetime fields also support the getField() and setField() functions.
function OpenCalledForm() {
{
//Set up the parameters to be passed onto the other form if desired
var param = getField("txtFirstName","") + "," + getField("txtMiddleName","") + "," + getField("txtLastName","");
//Customize the called form's appearance if desired
var settings = "centre:yes;resizable:no;dialogHeight:225px;dialogWidth:150px";
//Set up the Action and Map - refer to Web Client configuration Guide Section: 4
var action = "MyAdminForm";
var map = "MyAdminFormGroup";
//Call the eForm.aspx passing in query string (be wary of special characters)
var url = "eForm.aspx?Map=" + map + "&Client=External&Action=" + action + ""
//Call the modal dialog
var returnedVal = window.showModalDialog(url, param, settings);
}
return true;
}
function LoadCalledForm() {
//Get dialog parameters
var param = window.dialogArguments;
//Split on comma (or whatever delim you choose) into string array
//and loop for each setting the fields
var s = param.split(",")
for (var i = 0;i<=s.length-1;i++){
//Set the values of the form fields
if (i==0){ setField("txtFirstName","",s[0]);}
if (i==1){ setField("txtMiddleName","",s[1]);}
if (i==2){ setField("txtLastName","",s[2]);}
}
return true
}
0 -
Another way to do it, which I feel is even easier, is to use a Status field type to do the drill down to the 2nd admin form rather than using a command button. 9.1 introduced the ability to easily configure drill-down and passing of parameters from one form to another using the Status field's drill down properties and the expression builder.
0 -
No reason it has to be server side. Will try client side...
0 -
I am using version 9.0.3 so I can not use the Status field option.
0 -
Do you have an example solution for this?
0 -
Stephen,
Try this. If the attachment doesn't post, then send an email to helpdesk.
0 -
First off, you cannot access values in other forms like this. If you think about it for a moment, the server has absolutely no idea which instance of this form you are referring to.
As suggested, we typically use a client script to manage this. We do it very often. We have simple SetCookieFromField() and SetFieldFromCookie() functions in our Library (from the link below) that allow us to pass all required variables with the absolute minimum of code. We then just use the 'Initiate a process' type of button.
In our experience, once you get more complex than that, it keeps breaking in future versions and creates a maintenance nightmare.
0 -
Passing values via URL looks quite good and more safe than using cookies.
0 -
I tried this with 2 Admin form passing a single text variable and the loadcallform doesn't seem to get the variable. It opens correctly but doesn't "get" the info passed. I added an alert to check and the field shows as "undefined" even though an alert check in the calling form shows it grabs the correct value.
Any ideas why.?... it's not like there's a number of variables and settings to mix up.
function LoadCalledForm() {
var myTag = window.dialogArguments;
alert ("Tag = " + myTag);
eworkSetField("Tag","",myTag);return true;
}
Thanks!!
0 -
I figured out the problem - with showModaldialog is supported only in IE and not in FireFox.
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 152 General Questions
- 148 Thrust Services
- 57 Developer Hackathon
- 37 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories