Organization Utils Methods

This article presents our organization's Utils methods, which are utility methods that modify the organization-wide SharinPix settings.

Organization Utils Methods Example

The organization Utils methods include:

getMobileAppConfig

global Object getMobileAppConfig() 

  • Fetches your organization's SharinPix Mobile app configuration
System.debug(sharinpix.OrgUtils.getMobileAppConfig());
Click to copy

Example mobile app config on the SharinPix Admin dashboard:

Example output from the getMobileAppConfig():

{
  "annotation_config": "https://app.sharinpix.com/o/bc40/annotation_configs/5c9a7083-15a5-4027-a652-2e7b94e742c6",
  "checklists": {
    "Handbags": {
      "form": [
        {
          "default_option": "",
          "label": "Status",
          "optional": false,
          "options": [
            "OK",
            "N/A",
            "Uncertain"
          ],
          "type": "select",
          "value": "status"
        }
      ],
      "tags": [
        "Zipper**5",
        "Logo**2",
        "Color**0"
      ]
    }
  }
}
Click to copy

updateMobileAppConfig

global Object updateMobileAppConfig(Map<String, Object> config)

  • Updates your organization's SharinPix Mobile app configuration 

Using the updateMobileAppConfig method to update the mobile app configurations.

Below an Apex Map<String, Object> is initialized and used as parameter for the updateMobileAppConfig method. The update will provide the Checklist1 to be used in the mobile app with its available tags and other parameters.

Map<String, Object> config = new Map<String, Object> {
     'Checklist1' => new Map<String, Object> {
        'tags' => new List<String> { 'Middle', 'After', 'Fill Material' },
        'await_upload' => true
    }
};
    
sharinpix.OrgUtils.updateMobileAppConfig(config);
Click to copy

Example Mobile app config on the Sharinpix Admin dashboard after update: 

Using the updateMobileAppConfig method to clear the mobile app configurations.

The example below resets the organization's mobile app configuration.

Map<String, Object> config = new Map<String, Object>();

sharinpix.OrgUtils.updateMobileAppConfig(config);
Click to copy

Example Mobile app config on the Sharinpix Admin dashboard after reset: 

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.