title | description | author | ms.author | ms.topic | ms.date | ms.reviewer | audience | ms.search.region | ms.search.validFrom | ms.dyn365.ops.version |
---|---|---|---|---|---|---|---|---|---|---|
X++ compile-time functions |
Learn about and access compile-time functions and describes their syntax, parameters, and return values. via an overview. |
josaw1 |
josaw |
article |
11/03/2017 |
johnmichalak |
Developer |
Global |
2016-02-28 |
AX 7.0.0 |
[!include banner]
This article lists the compile-time functions and describes their syntax, parameters, and return values.
Compile-time functions are executed early during compilation of X++ code. They should be used wherever possible in X++ code to make the code resilient to changes to the metadata stored in the Application Explorer. Compile-time functions have their input value verified by the compiler. If the input value is not found to match any existing object in the Application Explorer, the compiler issues an error. The inputs to these functions must be literals, because the compiler cannot determine the value that a variable contains at run time. A compile-time function is a metadata assertion function. It takes arguments that represents an entity in the Application Explorer and validates the arguments at compile time. It has no effect at run time. Attributes are classes that inherit from the SysAttribute class. To support the validation of form, report, query, and menu metadata, use the AutoDeclaration property on controls. Most of these functions retrieve metadata about items that are in the Application Explorer. Some common compile time functions are as follows:
classNum
– Retrieves the ID of a class.classStr
– During compile time, verifies that a class of that name exists. This approach is better than discovering the error later during run time.evalBuf
– Evaluates the input string of X++ code, and then returns the results as a string.literalStr
– retrieves a label ID when given the string representation of a label, such as the string"@SYS12345"
. For example,myLabel.exists(literalStr("@SYS12345"));
.
Note
X++ compile time functions cannot be called from a .NET program.
Validates that the specified attribute class exists in the Application Explorer; if not, a compiler error occurs.
str classStr(class class)
Parameter | Description |
---|---|
class | The name of the attribute to validate. |
The name of the attribute.
This is a compile-time function. For more information, see Overview.
static void attributeStrExample(Args _args)
{
str s;
;
s = attributeStr(AifDocumentOperationAttribute);
print s;
pause;
}
Retrieves the ID of the specified class.
int classNum(class class)
Parameter | Description |
---|---|
class | The class for which to retrieve the ID. |
The ID of the specified class.
This is a compile-time function. For more information, see Overview.
static void classNumExample(Args _args)
{
int i;
;
i = classNum(Global);
print i;
pause;
}
Retrieves the name of a class as a string.
str classStr(class class)
Parameter | Description |
---|---|
class | The name of the class to return. |
The name of the class.
Use this function instead of literal text to retrieve a string that contains the class name. If the class does not exist, the function generates a syntax error at compile time. This is a compile-time function. For more information, see Overview.
static void clStrExample(Args _args)
{
str s;
;
s = classStr(Global);
print s;
pause;
}
Retrieves the ID of the specified configuration key.
int configurationKeyNum(str keyname)
Parameter | Description |
---|---|
keyname | The configuration key for which to return the ID. |
The ID of the specified configuration key.
This is a compile-time function. For more information, see Overview.
static void configurationKeyNum(Args _args)
{
int i;
;
i = configurationKeyNum(AIF);
print i;
pause;
}
Retrieves the name of a configuration key as a string.
str configurationKeyStr(str keyname)
Parameter | Description |
---|---|
keyname | The name of the configuration key. |
The name of the configuration key.
Use this function instead of literal text to retrieve a string that contains the configuration key name. If the key does not exist, the function generates a syntax error at compile time. This is a compile-time function. For more information, see Overview.
static void configurationKeyStrExample(Args _args)
{
str s;
;
s = configurationKeyStr(AIF);
print s;
pause;
}
Retrieves the name of a data source of a data entity.
str dataEntityDataSourceStr(str dataEntity, str dataSource)
Parameter | Description |
---|---|
dataEntity | The name of the data entity. |
dataSource | The name of the data source. |
The name of the data source.
This is a compile-time function. For more information, see Overview.
No example.
Returns the name of the delegate.
str delegateStr(str class, str instanceDelegate)
Parameter | Description |
---|---|
class | The name of the class, table, or form. |
instanceDelegate | The name of the instance delegate. |
The name of the delegate.
This is a compile-time function. For more information, see Overview.
No example.
Returns the name of the dimension hierarchy level.
str dimensionHierarchyLevelStr(str dimensionHierarchyLevel)
Parameter | Description |
---|---|
dimensionHierarchyLevel | The name of the dimension hierarchy level. |
The name of the dimension hierarchy level.
This is a compile-time function. For more information, see Overview.
No example.
Returns the name of the dimension hierarchy.
str dimensionHierarchyStr(str dimensionHierarchy)
Parameter | Description |
---|---|
dimensionHierarchy | The name of the dimension hierarchy. |
The name of the dimension hierarchy.
This is a compile-time function. For more information, see Overview.
No example.
Returns the name of the dimension reference.
str dimensionReferenceStr(str dimensionReference)
Parameter | Description |
---|---|
dimensionReference | The name of the dimension reference. |
The name of the dimension reference.
This is a compile-time function. For more information, see Overview.
No example.
Retrieves a string that represents the name of the specified security duty.
str dutyStr(str securityDuty)
Parameter | Description |
---|---|
securityDuty | The name of the security duty. |
The name of the security duty in a string.
This is a compile-time function. For more information, see Overview.
No example.
Retrieves the number of elements in the specified enumeration type.
int enumCnt(enum enumtype)
Parameter | Description |
---|---|
enumtype | The enumeration type. |
The number of elements in the specified enumeration type.
This is a compile-time function. For more information, see Overview.
enumCnt(NoYes); //Returns 2, as the two elements are Yes and No.
Indicates whether the specified string is an element of the specified enumeration type.
\enumLiteralStr(enum enum, string str)
Parameter | Description |
---|---|
enum | The enumeration type from which to retrieve the specified value. |
The value of the str parameter if the specified string was found; otherwise, a compilation error.
This is a compile-time function. For more information, see Overview.
static void getEnumValueAsString()
{
str i;
i = enumLiteralStr(ABCEnum, "valueInABCEnum");
print i;
pause;
}
Retrieves the ID of the specified enumeration type.
int enumNum(enum enum)
Parameter | Description |
---|---|
enum | The enumeration for which to return the ID. |
The ID of the specified enumeration type.
This is a compile-time function. For more information, see Overview.
static void enumNum(Args _args)
{
int i;
;
i = enumNum(ABC);
print i;
pause;
}
Retrieves the name of an enumeration as a string.
str enumStr(enum enum)
Parameter | Description |
---|---|
enum | The name of the enumeration. |
The name of the enumeration.
This is a compile-time function. For more information, see Overview.
static void enumStrExample(Args _args)
{
str s;
;
s = enumStr(ABC);
print s;
pause;
}
Retrieves the ID of the specified extended data type.
int extendedTypeNum(int str)
Parameter | Description |
---|---|
str | The extended data type for which to return the ID. |
The ID of the specified extended data type.
This is a compile-time function. For more information, see Overview.
static void EDTNum(Args _args)
{
int i;
str s;
;
i = extendedTypeNum(AccountName);
s = extendedTypeStr(AccountName);
print int2Str(i);
print s;
pause;
}
Retrieves the name of an extended data type as a string.
str extendedTypeStr(int str)
Parameter | Description |
---|---|
str | The name of the extended data type. |
The name of the extended data type.
Use this function instead of literal text to return a string that contains the extended data type name. If the data type does not exist, the extendedTypeStr function generates a syntax error at compile time. This is a compile-time function. For more information, see Overview.
static void EDTStr(Args _args)
{
int i;
str s;
;
i = extendedTypeNum(AccountName);
s = extendedTypeStr(AccountName);
print int2Str(i);
print s;
pause;
}
Returns the ID number of the specified field.
int fieldNum(str tableName, str fieldName)
Parameter | Description |
---|---|
tableName | The name of the table. |
fieldName | The name of the field. |
The ID of the specified field.
This is a compile-time function. For more information, see Overview.
The following example prints the number of the CashDisc field in the CustTable table.
static void fieldNumExample(Args _args)
{
int myInt;
;
myInt = fieldNum(CustTable, CashDisc);
Global::info(strfmt("CashDisc has a field ID of %1 in the CustTable table.", myInt));
}
/****Infolog Display
Message (10:40:00 am)
CashDisc has a field ID of 10 in the CustTable table.
****/
Retrieves the label of the specified field.
str fieldPName(str tableid, str fieldid)
Parameter | Description |
---|---|
tableid | The table that contains the specified field. |
fieldid | The field to convert. |
The label of the field.
This is a compile-time function. For more information, see Overview.
The following example prints the label of the CashDisc field.
static void fieldPNameExample(Args _arg)
{
str myText;
;
myText = fieldPName(CustTable, CashDisc);
Global::info(strfmt("%1 is the label of the CashDisc field.", myText));
}
/****Infolog Display
Message (02:00:57 pm)
Cash discount is the label of the CashDisc field.
****/
Retrieves the field name of the specified field.
str fieldStr(str tableid, str fieldid)
Parameter | Description |
---|---|
tableid | The table that contains the field. |
fieldid | The field to convert. |
The field name of the specified field.
This is a compile-time function. For more information, see Overview.
The following example assigns the name of the CashDisc field to the myText variable.
static void fieldStrExample(Args _arg)
{
str myText;
;
myText = fieldStr(CustTable, CashDisc);
Global::info(strfmt("%1 is the specified field.", myText));
}
/****Infolog Display
Message (09:11:52 am)
CashDisc is the specified field.
****/
Causes the X++ compiler to check whether the control exists on the form, and to replace the function call with a string of the valid control name.
str formControlStr(formName, controlName)
Parameter | Description |
---|---|
formName | The name of the form, not in quotation marks. |
controlName | The name of the control that is on the form, not in quotation marks. |
A string that contains the name of the control as it appears in the Application Explorer.
A compile error is issued if the compiler determines that the control does not exist on the form. If your X++ code uses a string that contains quotation marks to supply the control name, the error cannot be discovered until run time. Use of this function enables the compiler to discover the error earlier at compile time. X++ functions such as formControlStr that are executed by the compiler are called compile-time functions or compile-time functions. That is why the input parameters are not standard strings in quotation marks. Compile-time functions are not represented in the p-code or other executable that is output by the compiler. This is a compile-time function. For more information, see Overview.
No example.
Returns the name of a data field in a form.
str formDataFieldStr(str formName, str dataSource, str dataField)
Parameter | Description |
---|---|
formName | The name of the form. |
dataSource | The data source of the form. |
dataField | The data field of the data source. |
The name of a data field in a form.
This is a compile-time function. For more information, see Overview.
str a = formDataFieldStr(FMVehicle, FMModelRate, RatePerDay);
Returns the name of a data source in a form.
str formDataSourceStr(str formName, str dataSource)
Parameter | Description |
---|---|
formName | The name of the form. |
dataSource | The data source of the form. |
The name of a data source in a form.
This is a compile-time function. For more information, see Overview.
str b = formDataSourceStr(FMVehicle, FMModelRate);
Returns the name of a method of a form.
str formMethodStr(str formName, str methodName)
Parameter | Description |
---|---|
formName | The name of the form. |
methodName | The method of the form. |
The name of a method in a form.
This is a compile-time function. For more information, see Overview.
The following example prints the name of the showDialog method.
str c = formMethodStr(Batch,showDialog);
Retrieves the name of a form.
str formStr(str form)
Parameter | Description |
---|---|
form | The name of a form. |
A string that represents the name of the form.
This is a compile-time function. For more information, see Overview.
The following example prints the name of the InventDim form.
static void formStrExample(Args _arg)
{
;
Global::info(formStr(InventDim));
}
/****Infolog Display
Message (11:04:39 am)
InventDim
****/
Converts the specified identifier to a string.
str identifierStr(str ident)
Parameter | Description |
---|---|
ident | The identifier to convert. |
A string that represents the specified identifier.
You will receive a best practice warning if you use the identifierStr function. This occurs because existence checking is performed for identifierStr. Try to use a more specific compile-time function if one is available. This is a compile-time function. For more information, Overview.
The following code example assigns the myvar variable name to the thevar variable.
static void indentifierStrExample(Args _args)
{
str myvar;
str thevar
;
thevar = "[" + identifierStr(myvar) + "]";
Global::info(strfmt(thevar));
}
/****Infolog Display
Message (09:19:49 am)
[myvar]
****/
Converts the specified index to a number.
int indexNum(str tableid, str indexid)
Parameter | Description |
---|---|
tableid | The table that contains the index. |
indexid | The index to convert. |
The index number that represents the specified index.
This is a compile-time function. For more information, see Overview.
The following example returns the index value of the Party index.
static void indexNumExample(Args _arg)
{
;
Global::info(strfmt("%1 is the index number of Party.", indexNum(CustTable, Party)));
}
/****Infolog Display
Message (11:28:03 am)
3 is the index number of Party.
****/
Converts the specified index to a string.
str indexStr(str tableid, str indexid)
Parameter | Description |
---|---|
tableid | The table that contains the index. |
indexid | The index to convert. |
A string that represents the specified index.
This is a compile-time function. For more information, see Overview.
The following example assigns the CashDisc index value to the myText variable.
static void fieldStrExample(Args _arg)
{
str myText;
;
myText = fieldStr(CustTable, CashDisc);
Global::info(strfmt("%1 is the specified index.", myText));
}
/****Infolog Display
Message (09:11:52 am)
CashDisc is the specified index.
****/
Validates that the specified license code exists in the Application Explorer; if not, a compiler error occurs.
int licenseCodeNum(str codename)
Parameter | Description |
---|---|
codename | The name of the license code to validate. |
The number of the specified license code.
This is a compile-time function. For more information, see Overview.
static void licenseCodeNumExample(Args args)
{
int i;
;
i = licenseCodeNum(SysMorphX);
Global::info(strfmt("%1 is the license code number for SysMorphX.", i));
}
/****Infolog Display
Message (01:52:35 pm)
24 is the license code number for SysMorphX.
****/
Validates that the specified license code exists in the Application Explorer; if not, a compiler error occurs.
str licenseCodeStr(str codename)
Parameter | Description |
---|---|
codename | The name of the license code to validate. |
The name of the specified license code.
This is a compile-time function. For more information, see Overview.
static void licenseCodeStrExample(Args _arg)
{
str s;
;
s = licenseCodeStr(SysMorphX);
Global::info(strfmt("%1 is the license code string for SysMorphX.", s));
}
/****Infolog Display
Message (02:33:56 pm)
SysMorphX is the license code string for SysMorphX.
****/
Validates that the specified string can be a literal string; if not, a compiler error occurs.
str literalStr(int str)
Parameter | Description |
---|---|
codename | The string to validate. |
The literal string if valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = literalStr("This is a literal str");
print s;
pause;
}
Retrieves the maximum value allowed for a variable of type date.
date maxDate()
The maximum value allowed for a variable of type date, which is 2154-12-31.
This is a compile-time function. For more information, see Overview.
static void maxDateExample(Args _arg)
{
date maximumDate;
;
maximumDate = maxDate();
print maximumDate;
pause;
}
Retrieves the maximum signed value that can be stored in an int type.
int maxInt()
The maximum value allowed value of an integer.
Any other integer will be less than or equal to the returned value. This is a compile-time function. For more information, see Overview.
static void maxIntExample(Args _arg)
{
int i;
;
print "The maximum value for type int is " + int2Str(maxInt());
pause;
}
Returns the name of a measurement.
str measurementStr(str measurement)
Parameter | Description |
---|---|
measurement | The name of the measurement. |
The name of the measurement.
This is a compile-time function. For more information, see Overview.
No example.
Returns the name of a measure.
str measureStr(str measure)
Parameter | Description |
---|---|
measure | The name of the measure. |
The name of the measure.
This is a compile-time function. For more information, see Overview.
No example.
Validates that the specified menu item action exists in the Application Object Tree (Application Explorer); if it does not, a compiler error occurs.
str menuItemActionStr(class menuitem)
Parameter | Description |
---|---|
codename | The name of the menu item action to validate. |
The name of the menu item action, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s1, s2, s3, s4;
;
s1 = menuItemActionStr(AssetCopy);
s2 = menuItemDisplayStr(Address);
s3 = menuItemOutputStr(AssetBarcode);
s4 = menuStr(Administration);
print "menuItemActionStr for AssetCopy is " + s1;
print "menuItemDisplayStr for Address is " + s2;
print "menuItemOutputStr for AssetBarcode is " + s3;
print "menuStr for Administration is " + s4;
pause;
}
Validates that the specified menu item display exists in the Application Explorer; if it does not, a compiler error occurs.
str menuitemdisplaystr(class menuItem)
Parameter | Description |
---|---|
codename | The name of the menu item display to validate. |
The name of the specified menu item display, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s1, s2, s3, s4;
;
s1 = menuItemActionStr(AssetCopy);
s2 = menuItemDisplayStr(Address);
s3 = menuItemOutputStr(AssetBarcode);
s4 = menuStr(Administration);
print "menuItemActionStr for AssetCopy is " + s1;
print "menuItemDisplayStr for Address is " + s2;
print "menuItemOutputStr for AssetBarcode is " + s3;
print "menuStr for Administration is " + s4;
pause;
}
Validates that the specified menu item output exists in the Application Explorer; if not, a compiler error occurs.
str menuItemOutputStr(class menuitem)
Parameter | Description |
---|---|
codename | The name of the menu item output to validate. |
The specified menu item output if valid.
This is a compile-time function. For more information, see Overview.
{
str s1, s2, s3, s4;
;
s1 = menuItemActionStr(AssetCopy);
s2 = menuItemDisplayStr(Address);
s3 = menuItemOutputStr(AssetBarcode);
s4 = menuStr(Administration);
print "menuItemActionStr for AssetCopy is " + s1;
print "menuItemDisplayStr for Address is " + s2;
print "menuItemOutputStr for AssetBarcode is " + s3;
print "menuStr for Administration is " + s4;
pause;
}
Validates that the specified menu exists in the Application Explorer; if not, a compiler error occurs.
str menuStr(class menu)
Parameter | Description |
---|---|
menu | The name of the menu to validate. |
The name of the specified menu item if valid.
This is a compile-time function. For more information, see Overview.
{
str s1, s2, s3, s4;
;
s1 = menuItemActionStr(AssetCopy);
s2 = menuItemDisplayStr(Address);
s3 = menuItemOutputStr(AssetBarcode);
s4 = menuStr(Administration);
print "menuItemActionStr for AssetCopy is " + s1;
print "menuItemDisplayStr for Address is " + s2;
print "menuItemOutputStr for AssetBarcode is " + s3;
print "menuStr for Administration is " + s4;
pause;
}
Validates that the specified method exists in the specified class; if it does not, a compiler error occurs.
str methodStr(class class, int method)
Parameter | Description |
---|---|
class | The name of the class. |
method | The name of the method to validate. |
The name of the specified method, if it is valid.
This is a compile-time function. For more information, see Overview.
{
#define.timeout(50)
str s;
SysHelpInitTimeOut SysHelpInitTimeOut;
;
s = methodStr(SysHelpInitTimeOut, timeout);
print s;
pause;
}
Retrieves the minimum signed value that can be stored in an int type.
int minInt()
The minimum value of an int type.
Any other integer value will be greater than or equal to the returned value. This is a compile-time function. For more information, see Overview.
static void minIntExample(Args _arg)
{
int i;
;
i = minInt();
print "minInt() is " + int2Str(i);
pause;
}
Returns the name of the privilege.
str privilegeStr(str privilege)
Parameter | Description |
---|---|
privilege | The privilege for which to return the name. |
The name of the privilege.
This is a compile-time function. For more information, see Overview.
No example.
Causes the X++ compiler to check whether the data source exists on the query, and to replace the function call with a string of the valid data source name.
str queryDataSourceStr(queryName, dataSourceName)
Parameter | Description |
---|---|
queryName | The name of the query, not in quotation marks. |
dataSourceName | The name of the data source that is on the query, not in quotation marks. |
A string that contains the name of the data source as it appears in the Application Explorer.
A compile error is issued if the compiler determines that the data source does not exist on the query. If your X++ code uses a string that contains quotation marks to supply the data source name, the error cannot be discovered until run time. Use of this function enables the compiler to discover the error earlier at compile time. X++ functions such as queryDataSourceStr that are executed by the compiler are referred to as compile-time functions or compile-time functions. That is why the input parameters are not standard strings in quotation marks. Compile-time functions are not represented in the p-code or other executable that is output by the compiler. This is a compile-time function. For more information, see Overview.
No example.
Returns the name of a method of a query.
str queryMethodStr(str queryName, str methodName)
Parameter | Description |
---|---|
queryName | The name of the query. |
methodName | The method of the form. |
The name of a method in a query.
This is a compile-time function. For more information, see Overview.
No example.
Retrieves a string that represents an existing query.
str queryStr(str query)
Parameter | Description |
---|---|
query | The query to retrieve. |
The name of the query.
This is a compile-time function. For more information, see Overview.
static void queryStrExample(Args _arg)
{
str myText;
;
myText = queryStr(AssetTable);
Global::info(strfmt("%1 is the name of the query.",myText));
}
/****Infolog Display
Message (09:45:16 am)
AssetTable is the name of the query.
****/
Retrieves a string that represents the name of the specified report.
str reportStr(str report)
Parameter | Description |
---|---|
report | The report for which to return the name. |
The name of the report.
This is a compile-time function. For more information, see Overview.
The following example assigns the name of the AssetAddition report to the MyTxt variable.
static void reportStrExample(Args _args)
{
str MyTxt;
;
MyTxt = reportStr(AssetAddition);
Global::info(strfmt("%1 is the name of the report.", MyTxt));
}
/****Infolog Display.
Message (10:46:36 am)
AssetAddition is the name of the report.
****/
Validates that the specified resource exists in the Application Explorer; if it does not, a compiler error occurs.
str resourceStr(str resourcename)
Parameter | Description |
---|---|
resourcename | The name of the resource to validate. |
The name of the specified resource, if it is valid.
This is a compile-time function. For more information, see Overview.
{
print "Str for resource StyleSheet_Help_Axapta is "
+ resourceStr(StyleSheet_Help_Axapta);
pause;
}
Retrieves a string that represents the name of the specified security role.
str roleStr(str securityRole)
Parameter | Description |
---|---|
securityRole | The name of the security role. |
The name of the security role in a string.
This is a compile-time function. For more information, see Overview.
No example.
Retrieves a string that represents the name of the specified report. Use this function when you want to specify the report that should be run by a report controller class.
str ssrsReportStr(str report, str design)
Parameter | Description |
---|---|
report | The report to return the name for. |
design | The name of the design that is associated with the report. |
The name of the report.
The ssrsReportStr function parses the two values that are passed to it, to validate whether they belong to a valid report. The report name must be set when a menu item points to a controller(), so that the controller can determine which report-design combination must be invoked. Use of the ssrsReportStr function provides the benefit of compile-time validation for the report and design name. This is a compile-time function. For more information, see Overview.
public static void main(Args _args)
{
// Initializing the object for a controller class, in this case, the class named AssetListingController.
SrsReportRunController controller = new AssetListingController();
// Getting the properties of the called object (in this case AssetListing MenuItem)
controller.parmArgs(_args);
// Setting the Report name for the controller.
controller.parmReportName(ssrsReportStr(AssetListing, Report));
// Initiate the report execution.
controller.startOperation();
}
Returns the name of a static delegate.
str staticDelegateStr(str class, str delegate)
Parameter | Description |
---|---|
class | The name of a class, table, or form. |
delegate | The name of the delegate. |
The name of the delegate.
This is a compile-time function. For more information, see Overview.
No example.
Validates that the specified static method exists in the specified class; if it does not, a compiler error occurs.
str staticMethodStr(class class, int method)
Parameter | Description |
---|---|
class | The name of the class. |
method | The name of the static method to validate. |
The name of the static method, if it is valid.
This is a compile-time function. For more information, see Overview.
No example.
Validates that the specified table collection exists in the Application Explorer; if it does not, a compiler error occurs.
str tableCollectionStr(class tablecollection)
Parameter | Description |
---|---|
tablecollection | The name of the table collection to validate. |
The name of the specified table collection, if it is valid.
This is a compile-time function. For more information, see Overview.
No example.
Retrieves the name of a field group as a string.
str tableFieldGroupStr(str tableName, str fieldGroupName)
Parameter | Description |
---|---|
tableName | The table that contains the field group. |
fieldGroupName | The field group in the table. |
The name of the field group as a string.
This is a compile-time function. For more information, see Overview.
The following example retrieves the name of the Editing field group as a string.
static void tableFieldGroupStrExample(Args _arg)
{
;
Global::info(tableFieldGroupStr(AccountingDistribution, Editing));
}
/****Infolog Display
Message (03:14:54 pm)
Editing
****/
Validates that the specified method exists in the specified table; if it does not, a compiler error occurs.
str tableMethodStr(int table, int method)
Parameter | Description |
---|---|
table | The name of the table. |
method | The name of the method to validate. |
The name of the method, if it is valid.
This is a compile-time function. For more information, see Overview.
No example.
Retrieves the table ID of the specified table.
int tableNum(str table)
Parameter | Description |
---|---|
table | The table to retrieve the table ID for. |
The table ID of the specified table.
This is a compile-time function. For more information, see Overview.
The following example sets the tableID variable to 77, which is the ID of the CustTable table.
static void tableNumExample(Args _args)
{
int tableID;
;
tableID = tableNum(CustTable);
Global::info(strfmt("%1 is the table ID for the CustTable table.", tableID));
}
/****Infolog Display
Message (11:15:54 am)
77 is the table ID for the CustTable table.
****/
Retrieves a string that contains the printable name of the specified table.
str tablePName(str table)
Parameter | Description |
---|---|
table | The table to retrieve the printable name for. |
The name of the specified table.
This is a compile-time function. For more information, see Overview.
The following example assigns the label of the CustTable table to the MyText variable.
static void tablePNameExample(Args _args)
{
str MyText;
;
MyText = tablePname(CustTable);
Global::info(strfmt("%1 is the label of the CustTable table.", MyText));
}
/**** Infolog Display.
Message (12:13:53 pm)
Customers is the label of the CustTable table.
****/
Validates that the specified static method exists in the specified table; if it does not, a compiler error occurs.
str tableStaticMethodStr(int table, int method)
Parameter | Description |
---|---|
table | The name of the table. |
method | The name of the static method to validate. |
The name of the specified static method.
This is a compile-time function. For more information, see Overview.
No example.
Retrieves a string that contains the name the specified table.
str tableStr(str table)
Parameter | Description |
---|---|
table | The table to retrieve a string for. |
A string value that contains the name of the specified table.
This is a compile-time function. For more information, see Overview.
The following example assigns the name of the CustTable table to the MyTxt variable.
static void tableStrExample(Args _args)
{
str MyTxt;
;
MyTxt = tableStr(CustTable);
Global::info(strfmt("%1 is the str output of the input of CustTable.", MyTxt));
}
/**** Infolog Display.
Message (01:21:49 pm)
CustTable is the str output of the input of CustTable.
****/
Retrieves a string that represents the name of the specified tile.
str tileStr(str tile)
Parameter | Description |
---|---|
tile | The name of the tile. |
The name of the tile in a string.
This is a compile-time function. For more information, see Overview.
No example.
Retrieves a string that contains the name of the specified variable.
str varStr(str var)
Parameter | Description |
---|---|
var | The name of the variable. |
A string that contains the name of the specified variable.
This is a compile-time function. For more information, see Overview.
static void varStrExample(Args _arg)
{
str myString;
anytype myVariable;
;
myString = varStr(myVariable);
Global::info(strfmt("%1 is the variable name.", myString));
}
/****Infolog Display.
Message (02:26:56 pm)
myVariable is the variable name.
****/
Validates that the specified web action item exists in the Application Explorer; if it does not, a compiler error occurs.
str webActionItemStr(class webactionitem)
Parameter | Description |
---|---|
webactionitem | The name of the web action item to validate. |
The name of the specified web action item, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webActionItemStr(EPFlushData);
print "webactionitem str is " + s;
pause;
}
Validates that the specified web display content item exists in the Application Explorer; if it does not, a compiler error occurs.
str webDisplayContentItemStr(class webdisplaycontentitem)
Parameter | Description |
---|---|
webdisplaycontentitem | The name of the web display content item to validate. |
The name of the specified web display content item, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webDisplayContentItemStr(EPAdmin);
print "string for webcontent display item EPAdmin is " + s;
pause;
}
Validates that the specified web form exists in the Application Explorer; if it does not, a compiler error occurs.
str webFormStr(str name)
Parameter | Description |
---|---|
name | The name of the web form to validate. |
The name of the specified web form, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webFormStr(EPAdmin);
print "String for web form EPAdmin is " + s;
pause;
}
Validates that the specified weblet item exists in the Application Explorer; if it does not, a compiler error occurs.
str webletItemStr(class webletitem)
Parameter | Description |
---|---|
webletitem | The name of the weblet item to validate. |
The name of the specified weblet item, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webletItemStr(WebFormWeblet);
print "String for WebFormWeblet is " + s;
pause;
}
Validates that the specified web menu exists in the Application Explorer; if it does not, a compiler error occurs.
str webMenuStr(str name)
Parameter | Description |
---|---|
name | The name of the web menu to validate. |
The name of the specified web menu, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webMenuStr(ECPAdmin);
print "String for web menu ECPAdmin is " + s;
pause;
}
Validates that the specified web output content item exists in the Application Explorer; if it does not, a compiler error occurs.
str webOutputContentItemStr(class weboutputcontentitem)
Parameter | Description |
---|---|
weboutputcontentitem | The name of the web output content item to validate. |
The name of the specified web output content item, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webOutputContentItemStr(EPPriceList);
print "string for weboutput content item EPPriceList is " + s;
pause;
}
Validates that the specified Web page definition exists in the Application Explorer; if it does not, a compiler error occurs.
str webpageDefStr(str pagename)
Parameter | Description |
---|---|
pagename | The name of the Web page definition to validate. |
The name of the specified web-page definition, if it is valid.
This is a compile-time function. For more information, see Overview.
No example.
Validates that the specified web report exists in the Application Explorer; if it does not, a compiler error occurs.
str webReportStr(str name)
Parameter | Description |
---|---|
name | The name of the web report to validate. |
The name of the specified web report, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webReportStr(EPCSSSalesConfirm);
print "String for web report EPCSSalesConfirm is " + s;
pause;
}
Validates that the specified web-site definition exists in the Application Explorer; if it does not, a compiler error occurs.
str websiteDefStr(str resourcename)
Parameter | Description |
---|---|
resourcename | The name of the Web site definition to validate. |
The name of the specified web-site definition, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = websiteDefStr(AxSiteDef_1033_xip);
print "string for web site definition AxSiteDef_1033_xip is " + s;
pause;
}
Validates that the specified web-site template exists in the Application Explorer; if it does not, a compiler error occurs.
str websiteTempStr(str resourcename)
Parameter | Description |
---|---|
resourcename | The name of the Web site template to validate. |
The name of the specified web-site template, if it is valid.
This is a compile-time function. For more information, see Overview.
No example.
Validates that the specified web static file exists in the Application Explorer; if it does not, a compiler error occurs.
str webStaticFileStr(str pagename)
Parameter | Description |
---|---|
pagename | The name of the web static file to validate. |
The name of the specified web static file, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webStaticFileStr(AXEP);
print "string for web static file AXEP is " + s;
pause;
}
Validates that the specified web URL item exists in the Application Explorer; if it does not, a compiler error occurs.
str webUrlItemStr(class weburlitem)
Parameter | Description |
---|---|
weburlitem | The name of the web URL item to validate. |
The name of the specified web URL item, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webUrlItemStr(EPAdmin);
print "string for web url item EPAdmin is " + s;
pause;
}
Validates that the specified web part exists in the Application Explorer; if it does not, a compiler error occurs.
str webWebpartStr(str resourcename)
Parameter | Description |
---|---|
resourcename | The name of the web part to validate. |
The name of the specified web part, if it is valid.
This is a compile-time function. For more information, see Overview.
{
str s;
;
s = webWebpartStr(AxWebParts_cab);
print "string for web part AxWebParts_cab is " + s;
pause;
}
Retrieves the name of a workflow approval in the Application Object Tree (Application Explorer) as a string.
str workflowapprovalstr(approval approval)
Parameter | Description |
---|---|
approval | The Application Explorer name of the workflow approval. |
A string that represents the Application Explorer name of the workflow approval.
Use this function instead of literal text to retrieve a string that contains the workflow approval name. If the workflow approval does not exist, the function generates a syntax error at compile time. This is a compile-time function. For more information, see Overview.
The following code example sets the variable str s to MyWorkflowApproval which is the name of the workflow approval in the Application Explorer.
static void MyWorkflowApprovalStrExample(Args _args)
{
str s;
;
s = workflowapprovalstr(MyWorkflowApproval);
print s;
pause;
}
Retrieves the name of a workflow category in the Application Object Tree (Application Explorer) as a string.
str workflowcategorystr(category category)
Parameter | Description |
---|---|
category | The Application Explorer name of the workflow category. |
A string that represents the Application Explorer name of the workflow category.
Use this function instead of literal text to retrieve a string that contains the workflow category name. If the workflow category does not exist, the function generates a syntax error at compile time. This is a compile-time function. For more information, see Overview.
The following code example sets the variable str s to MyWorkflowCategory which is the name of the workflow category in the Application Explorer.
static void MyWorkflowCategoryStrExample(Args _args)
{
str s;
;
s = workflowcategorystr(MyWorkflowCategory);
print s;
pause;
}
Retrieves the name of a workflow task in the Application Object Tree (Application Explorer) as a string.
str workflowtaskstr(task task)
Parameter | Description |
---|---|
task | The Application Explorer name of the workflow task. |
A string that represents the Application Explorer name of the workflow task.
Use this function instead of literal text to retrieve a string that contains the workflow task name. If the workflow task does not exist, the function generates a syntax error at compile time. This is a compile-time function. For more information, see Overview.
The following code example sets the variable str s to MyWorkflowTask which is the name of the workflow task in the Application Explorer.
static void MyWorkflowTaskStrExample(Args _args)
{
str s;
;
s = workflowtaskstr(MyWorkflowTask);
print s;
pause;
}
Validates that the specified workflow type exists in the Application Explorer; if it does not, a compiler error occurs.
str workflowTypeStr(str workflow)
Parameter | Description |
---|---|
workflow | The name of the workflow type to validate. |
The name of the workflow type.
This is a compile-time function. For more information, see Overview.
static void workFlowTypeStrExample(Args _args)
{
str s;
;
s = workFlowTypeStr(BudgetAccountEntryType);
print s;
pause;
}
[!INCLUDEfooter-include]