| Contents: | Main | Chapter | See Also: | Getting Started Manual | Advanced User Manual | |||
| Reference Type | Category | ICR # |
|---|---|---|
| Supported | Database Server (DBS) | 2055 |
The $$ROOT^DILFD extrinsic function resolves the file root when passed file or subfile numbers. At the top-level of the file $$ROOT^DILFD returns the global name. When passing a subfile number, $$ROOT^DILFD uses the IENS to build the root string.
$$ROOT^DILFD(file[,iens][,flags][,error_flag])
| file |
(Required) File number or subfile number. |
| iens |
(Optional) If the file parameter equals a file number, the Lister ignores the iens parameter. If the file parameter equals a subfile number, the Lister needs the iens parameter to help identify which subfile to list. In other words, files can be specified with the file parameter alone, but subfiles require both the file and iens parameters. When the iens parameter is used, it must equal an IENS that identifies the parent record of the exact subfile to list. Since this parameter identifies the subfile under that record, and not the subrecord itself, the first comma-piece of the parameter should be empty. If the first comma-piece of the iens parameter is not empty, that first comma-piece is ignored. REF: For more information on the IENS, see the discussion in the "IENS: Identify Entries and Subentries" in the "Database Server (DBS) API" section. For example, to specify the Menu Item subfile under option number 67, you must pass FILE=19.01 (the subfile number for the Menu subfile) and IENS=",67," (showing that record number 67 holds the Menu subfile you want to list). Defaults to empty string. |
| flags |
(Optional) If set to 1 (true), returns a closed root. The default is to return an open root. |
| error_flag |
(Optional) If set to 1 (true), processes an error message if an error is encountered. |
Figure 204: $$ROOT^DILFD API—Example 1: Input and Output
>S DIC=$$ROOT^DILFD(999000.07,"1,38,") <Enter>
>W DIC <Enter>
^DIZ(999000,38,2,
Figure 205: $$ROOT^DILFD API—Example 2: Input and Output
>S DIC=$$ROOT^DILFD(999000) <Enter>
>W DIC <Enter>
^DIZ(999000,
Figure 206: $$ROOT^DILFD API—Example 3: Input and Output
>S CROOT=$$ROOT^DILFD(999000,"",1) <Enter>
>W CROOT <Enter>
^DIZ(999000)
Table 68 lists the possible error codes returned with the $$ROOT^DILFD API:
Table 68: $$ROOT^DILFD API—Error Codes Returned
| Code | Description |
|---|---|
| 200 | Invalid parameter. |
| 205 | The File and IENS represent different subfile levels. |
Reviewed/Updated: May 2026