Forms. How to use the Select files field in the form

You can add the file Selection field to the form. 

To do this, do the following: 

  1. Add the file Selection column. And implement the stored procedure dict - it must specify the resource Manager code to load (as-resourceManager).   
  2. Specify this field In GetItem (a certain Guid that will identify the relationship with files - it will go to the data-itemID in ResourceManager). If this field is omitted, the Guid will be generated automatically. 
  3. In CheckItem and SaveItem, you must pass the field, as well as other fields (type nvarchar (64)), and save this field for the entity (add a column to the SQL table of the entity, if necessary)
  4. Create a resource Manager with the code specified in the dict procedure for the field. 
  5. When you output a resource to the form of an already created entity in data-ItemID, you must use the saved guid

Example of a dict procedure: 

select '' Text, 'testFormAttach' Value, 0 Selected

Note: 

  • If you don't have this type of field (file Selection), you can add it to as_dataTypes (with the code files)
  • If the file Manager is not output, make sure that you have set the dict procedure.
  • Do not use this field on modal forms. The fact is that file selection also uses a modal window, and a new window for selecting files will close the window of your form.

Uploading a file from an external resource

If we need to get a file from a URL in SQL for processing, we use the File type on an external resource (remoteFile).

This will be the input field where the URL is specified. as a result, the procedure passes the content downloaded at this address.

Passing the contents of the downloaded file to the SaveItem procedure

This is relevant when you need to process a certain XML file that the user loads directly in sql

To do this, use the column type of the file Content form (fileContent). 

We also configure it as the files type (in dict, we pass the resource type, itemID is set as a Guid or Itemid of the entity, and we configure the passed resource type). The main difference is that SaveItem eventually passes the contents of the file, not the itemID.

Falcon Space Platform

This is a reduction in the cost of ownership

at the expense of fewer people to support

This is a quick change

while using the program

This is a modern interface

full adaptation for mobile devices

 
Note