AX2364
GetPlanFileAttachment function
Opens the Browse Attachments dialog so that a user can open a plan file attachment, or opens a specified plan file attachment directly. This function can be used in an Axiom file to provide an alternate method of opening plan file attachments.
The function can also be used to write the name of a selected plan file attachment to a specified target cell.
NOTE: GetPlanFileAttachment is not for use in Axiom forms. If you want to open plan file attachments from within an Axiom form, you must use either GetFormResourceLinkTag or GetFormResourceURL. For more information, see Using hyperlinks in Formatted Grids.
Syntax
GetPlanFileAttachment("DisplayText", "FileGroupName", PlanFileCode, OpenReadOnly, "AttachmentNameorTargetCell")
Parameter | Description |
---|---|
DisplayText |
The text to display in the cell. This text displays as normal text in the cell. If you want the text to appear like a hyperlink on a web page, you must manually apply the font formatting to the cell. This parameter supports use of the variable |
FileGroupName |
The name of the file group that the plan file belongs to. A file group alias name can also be used. |
PlanFileCode |
The plan file code for which you want to open an associated file attachment, such as 21000. |
OpenReadOnly |
Optional. Boolean value to determine whether the file is opened read-only. By default, this is This option only applies to Excel-compatible spreadsheet attachments that are opened within the Axiom Software session. It is ignored for all other types of attachments because those attachments cannot be edited directly within Axiom Software. |
AttachmentNameor TargetCell |
Optional. If this parameter is omitted, then the Browse Attachments dialog opens so that the user can select an attachment to open. This parameter can be used to enable special behavior for the function as follows:
|
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. However, the Boolean values TRUE and FALSE do not need to be in quotation marks.
Remarks
-
The second parameter of this function also accepts a file group code. However, use of file group code is being phased out. If you have existing functions that use the file group code, these functions should eventually be migrated to use the file group name.
-
Users cannot manage plan file attachments using this function, they can only open existing plan file attachments. If users need to add or delete plan file attachments, they must open the plan file and use the File Attachments command on the ribbon, or use the ManagePlanFileAttachments function.
- GetPlanFileAttachment is a non-volatile function. This means that if the
{count}
variable is used, it will not automatically update when the count changes—the sheet must be refreshed in order to update the function.
Examples
=GetPlanFileAttachment("Open Attachments for Dept 21000","Budget 2020",21000)
This example opens the Browse Attachments dialog so that the user can open any attachment for plan file 21000 in file group Budget 2020.
=GetPlanFileAttachment("Open supporting schedule","Budget 2020",21000,,"Schedule.xlsx")
This example opens the specified file attachment for plan file 21000 in file group Budget 2020. The attachment is an Excel file so it will be opened in the current Axiom Software session, using the level of access rights that the user has for plan file 21000 (either read-only or read/write).
=GetPlanFileAttachment("Open supporting schedule","Budget 2020",21000,TRUE,"Schedule.xlsx")
This example is the same as the previous example, except this time the Excel file will be opened as read-only, regardless of the user's access rights to the plan file.
=GetPlanFileAttachment("Open proposal","Budget 2020",21000,,"Proposal.docx")
This example opens the specified file attachment for plan file 21000 in file group Budget 2020. The attachment is a Word file so it will open in Word, assuming that program is present on the user's computer.
=GetPlanFileAttachment("{count} attachments","Budget 2020",21000)
This example uses the {count}
variable to display the count of attachments for the specified plan file within the display text. For example, the display text will read as "3 attachments".
=GetPlanFileAttachment("Select attachment","Budget 2020",21000,,"G27")
This example uses a target cell for the fifth parameter. This example opens the Browse Attachments dialog so that the user can view the attachments for plan file 21000 in Budget 2020. When the user selects an attachment, the attachment name is written to the target cell instead of opening that attachment, such as "Schedule.xlsx".