InsertImage
Mon 01 January 2018Syntax
InsertImage([scrollpath, target_row,] [recordname.]fieldname [, max_size])
where scrollpath is:
[SCROLL.level1_recname, level1_row, [SCROLL.level2_recname, level2_row,]] SCROLL.target_recname
Description
Use the InsertImage function to associate an image file with a record field on a page. After the image file is associated with the record field, it can be saved to the database when the component is saved.
The following are the valid types of image files that can be associated with a record field:
-
BMP
-
DIB
-
JPEG
-
PNG
-
SVG
InsertImage uses a search page to enable the end user to select the image file to be used. This is the same search page used to add an attachment.
Note: To update an image field using this function, be sure that PSIMAGEVER field is also on the same record as the image field being updated.
Virus scanning can be performed on all files uploaded with the InsertImage function.
See .
Parameters
Field or Control |
Definition |
---|---|
scrollpath |
A construction that specifies a scroll area in the component buffer. |
target_row |
The row number of the target row. |
[ recordname . ] fieldname |
The name of the field to be associated with the image file. The field can be on scroll level one, two, or three of the active page. The recordname prefix is required if the function call is not on the record definition recordname |
max_size |
Specify the maximum size for this image file in kilobytes. Note: The default value is 0, which indicates that there is no maximum size. |
Returns
The InsertImage function returns either a constant or a number:
Numeric Value |
Constant Value |
Description |
---|---|---|
0 |
%InsertImage_Success |
Image was successfully associated with the record field. |
1 |
%InsertImage_Failed |
Image was not successfully associated with the record field. When the component is saved the image file will not be saved to the database. |
2 |
%InsertImage_Canceled |
User canceled the transaction so image file isn't associated with record field. |
3 |
%InsertImage_ExceedsMaxSize |
Image exceeds the maximum allowed size. |
13 |
%Attachment_ViolationFound |
File violation detected by virus scan engine. |
14 |
%Attachment_VirusScanError |
Virus scan engine error. |
15 |
%Attachment_VirusConfigError |
Virus scan engine configuration error. |
16 |
%Attachment_VirusConnectError |
Virus scan engine connection error. |