Discussion:
Check if form exists
(too old to reply)
bmistiaen
2010-08-24 11:54:04 UTC
Permalink
Hello,

I would like to create a method that takes a form name (string) as input,
and is able to tell me if that form exists or not.
How can this be done?
I know it cannot be done with the formstr() function.

boolean formExists(FormName _formName)
{
;
//<pseudocode>
if the form exists
then return true
else return false
//</pseudocode>
}
unknown
2010-08-24 15:16:03 UTC
Permalink
Here's a quick job that should help you out.

static void Job1(Args _args)
{
#AOT
TreeNode treeNode;
str formName = 'InventTable';
;

treeNode = TreeNode::findNode(strfmt('%1\\%2', #FormsPath, formName));

info(queryValue( treeNode ? true : false));
}
--
Mathieu Vaillancourt
http://vaillancourtm.blogspot.com
Post by bmistiaen
Hello,
I would like to create a method that takes a form name (string) as input,
and is able to tell me if that form exists or not.
How can this be done?
I know it cannot be done with the formstr() function.
boolean formExists(FormName _formName)
{
;
//<pseudocode>
if the form exists
then return true
else return false
//</pseudocode>
}
bmistiaen
2010-08-25 08:18:03 UTC
Permalink
Thank you!
This works perfectly!
I guess there's no other way to do this, besides searching the AOT?
Post by unknown
Here's a quick job that should help you out.
static void Job1(Args _args)
{
#AOT
TreeNode treeNode;
str formName = 'InventTable';
;
treeNode = TreeNode::findNode(strfmt('%1\\%2', #FormsPath, formName));
info(queryValue( treeNode ? true : false));
}
--
Mathieu Vaillancourt
http://vaillancourtm.blogspot.com
Post by bmistiaen
Hello,
I would like to create a method that takes a form name (string) as input,
and is able to tell me if that form exists or not.
How can this be done?
I know it cannot be done with the formstr() function.
boolean formExists(FormName _formName)
{
;
//<pseudocode>
if the form exists
then return true
else return false
//</pseudocode>
}
Loading...