AX1390
GetFileGroupID function
Returns the ID of the current file group, or of a specified file group (given the file group name). This function should be used to obtain the file group ID for subsequent use in the functions GetFileGroupVariable and GetFileGroupProperty.
Syntax
GetFileGroupID("FileGroupName")
Parameter | Description |
---|---|
FileGroupName |
Optional. The name of the file group for which you want to return the ID. A file group alias name can also be used.
|
All non-numeric entries must be placed in double quotation marks, unless you are using cell references to reference the text held in another cell.
Remarks
-
When using this function within a file that belongs to a file group, it is best to leave the FileGroupName parameter blank so that you are always returning the ID for the current file group. If you provide the function with the name of the current file group, it is possible that the function will get out of sync with the file group if the name changes (for example, when cloning the file group for a rollover).
-
The file group name corresponds to the File Group Name property for the file group, not the display name. If a variable is used in the name, you must resolve the variable to its current value. For example, if the name is defined as
Budget {FileGroupYear}
, you must specifyBudget 2020
in the function (or whatever year the variable currently resolves to). -
GetFileGroupID is a non-volatile function.
Examples
=GetFileGroupID()
This example returns the ID for the current file group, assuming the function is used within a file that belongs to a file group. For example: 89.
=GetFileGroupID("Budget 2020")
This example returns the ID for the specified file group. For example: 89. The file group name should only be specified when the function is used in a report file that does not belong to a file group (or if you are deliberately referencing a file group that is not the current file group).
=GetFileGroupID("Current Budget")
This example uses a file group alias name to return the ID for the file group assigned to the alias. When the file group assignment is changed for the alias (such as for a rollover), then the function will return the ID for the newly assigned file group.