Integration in a WebForm (Developer-oriented)

The SharinPix WebForm component is useful in situations where external users need to upload files as it ensures monitoring over what is being uploaded. This can be done by providing album constraints written in a JSON format. These constraints are added to the token.

The concept used by SharinPix WebForm is as follows:

  • A URL is made available to the external user which gives them access to a temporary album. This temporary album provides a platform to enable the validation of the images being uploaded.

The above example shows the URL format. AlbumId refers to the Id of the album and TokenGenerated refers to the generated token containing the restrictions.

  • If the uploaded files do not match the constraints, appropriate error messages will be displayed. For example, if a file with an incorrect extension is uploaded to the album and submission is attempted, an error message will pop-up, stating that the extension is incorrect.

  • If the uploaded files are valid, the user can submit them by clicking on the Submit button.

  • The files are then submitted to the album found on the corresponding record. This album will be referred to as the target album throughout this article.

Implementation of a Visualforce Page containing a WebForm.

To use the SharinPix WebForm, create a Visualforce Page containing the WebForm component as demonstrated in the code snippet below:

The WebForm component is included in the SharinPix package and consists of the following attributes:

  • constraints: This attribute refers to the restrictions applied to the album. The constraints should be written in a JSON format. In this example, the restrictions are:

    1. min_files : The minimum number of files that need to be uploaded.

    2. file_extensions : The file extensions allowed.

  • targetAlbumId : This attribute refers to the ID of the targeted album. Here, the target album ID refers to the current record ID.

  • permissionId : The ID of the SharinPix Permission which defines the WebForm album abilities.

  • submitButtonLabel: This attribute is used to set the label of the submit button.

  • height: To set the height of the component.

circle-check

Note: In the following section, we will be using the Opportunity object.

Once the Visualforce page is ready, you can add the same to the desired record page. To do so:

  • Go to the desired record page.

  • Click on alt text: Setup Icon then on Edit Page.

  • In Lightning App Builder, drag the Visualforce component onto the page.

  • Choose the appropriate Visualforce Page component.

  • Click Save then Back.

You can now access the WebForm Component on the record page.

Last updated

Was this helpful?