Name

sn_uibtk_api.AppRoute

Description

No description available

Script

const AppRoute = Class.create();
AppRoute.prototype = Object.extendsObject(BuilderToolkitAPIBase, {
  TABLE: 'sys_ux_app_route',
  FIELDS: ['name', 'route_type', 'fields', 'optional_parameters', 'parent_macroponent_composition_element_id', 'icon', 'extension_point', 'screen_type', 'order', 'app_config', 'sys_policy'],

  /**
   * @param fields {string[]}
   */
  initialize: function(fields) {
      BuilderToolkitAPIBase.prototype.initialize.call(this, this.TABLE, fields || this.FIELDS);
  },

  /**
   * @param appRoute {object} a object with keys in camel case and values
   */
  updateRecord: function({
      sysId,
      optionalParameters = null,
      fields = null,
      ...otherFields
  }) {
      const recordGR = this.getRecordById(sysId, true);
      if (recordGR && recordGR.canWrite()) {
          const uniqueOptionalParameters = [...new Set(optionalParameters?.split(',') ?? [])];
          const uniqueFields = [...new Set(fields?.split(',') ?? [])];
          this.setFieldValues(recordGR, {
              ...otherFields,
              optionalParameters: uniqueOptionalParameters,
              fields: uniqueFields
          });
          return recordGR.update();
      }
      return {
          error: true,
          reason: !recordGR ? BuilderToolkitConstants.ERRORS.NO_RECORD_FOUND : BuilderToolkitConstants.ERRORS.WRITE_ACCESS_ERROR_MESSAGE
      };
  },

  type: 'AppRoute'
});

Sys ID

c23b043585321110f877e10cffeb7b38

Offical Documentation

Official Docs: