This documentation supports the 9.1 version of Remedy Action Request System.

To view the latest version, select the version from the Product version menu.

ARCreateSchema

Note

You can continue to use C APIs to customize your application, but C APIs are not enhanced to support new capabilities provided by Java APIs and REST APIs.

Description

Creates a new form with the indicated name on the specified server. The nine required core fields are automatically associated with the new form.

Privileges

BMC Remedy AR System administrator.

Synopsis

#include "ar.h"
#include "arerrno.h"
#include "arextern.h"
#include "arstruct.h"

int ARCreateSchema(
   ARControlStruct *control,
   ARNameType name,
   ARCompoundSchema *schema,
   ARSchemaInheritanceList *schemaInheritanceList,
   ARPermissionList *groupList,
   ARInternalIdList *admingrpList,
   AREntryListFieldList *getListFields,
   ARSortList *sortList,
   ARIndexList *indexList,
   ARArchiveInfoStruct *archiveInfo,
   ARAuditInfoStruct *auditInfo,   
   ARAssociationsToFollowInfoStruct *assocToFollowInfo,
   ARNameType defaultVui,
   char *helpText,
   ARAccessNameType owner,
   char *changeDiary,
   ARPropList *objPropList,
   char *objectModificationLogLabel,
   ARStatusList *status)

Input arguments

control

The control record for the operation. It contains information about the user requesting the operation, where that operation is to be performed, and which session is used to perform it. The user and server fields are required.

If a valid overlay group is specified in the control record, the ARCreate* function creates a custom object that belongs to that group. If no group is specified, the function creates an origin object. To specify an overlay group, use the AR_SESS_CONTROL_PROP_DESIGN_OVERLAYGROUP variable of the ARSetSessionConfiguration function (see ARGetSessionConfiguration).

name

The name of the form to create. The names of all forms on a given server must be unique.

schema

The type of form to create. The information contained in this definition depends on the form type that you specify.

1:

Indicates a base form (AR_SCHEMA_REGULAR). All other structure information is ignored if you specify this type.

2:

Indicates a join form (AR_SCHEMA_JOIN). If you specify this type, you must identify the underlying member forms and how to join them.

3:

Indicates a view form (AR_SCHEMA_VIEW). You must identify the underlying table and key field names if you specify this type.

4:

Indicates a display-only form (AR_SCHEMA_DIALOG). The getListFields, sortList, and indexList parameters are ignored if you specify this type.

5:

Indicates a vendor form (AR_SCHEMA_VENDOR). You must identify the underlying vendor and table names if you specify this type.

schemaInheritanceList

This is reserved for future use. Specify NULL.

groupList

A list of zero or more groups who can access this form. Specify an empty group list to define a form accessible only by users with administrator capability. Specify group ID 0 (Public) to provide access to all users. The permission value that you assign for each group determines whether users in that group see the form in the form list:

1:

Users see the form in the form list (AR_PERMISSIONS_VISIBLE).

2:

Users do not see the form in the form list (AR_PERMISSIONS_HIDDEN).

admingrpList

A list of zero or more groups who can administer this form (and the associated filters, escalations, and active links). Users must belong to both a specified group and the Subadministrator group to obtain these privileges. Specify an empty administrator group list to define a form that can be administered only by users with administrator capability. Specify group ID 0 (Public) to provide administrator capability to all members of the Subadministrator group.

getListFields

A list of zero or more fields that identifies the default query list data for retrieving form entries. The list can include any data fields except diary fields and long character fields. The combined length of all specified fields, including separator characters, can be as many as 128 bytes (limited by AR_MAX_SDESC_SIZE). The query list displays the Short-Description core field if you specify NULL for this parameter (or zero fields). Specifying a getListFields argument when calling the ARGetListEntry function overrides the default query list data.

sortList

A list of zero or more fields that identifies the default sort order for retrieving form entries. Specifying a sortList argument when calling the ARGetListEntry function overrides the default sort order.

indexList

The set of zero or more indexes to create for the form. You can specify from 1 to 16 fields for each index (limited by AR_MAX_INDEX_FIELDS). Diary fields and character fields larger than 255 bytes cannot be indexed.

archiveInfo

If a form is to be archived, this is the archive information for the form. Specify NULL for this parameter if you do not want to create or set the archive information. These are the values for archive type:

0:

Deletes the archive settings for the selected form. The selected form is not archived (AR_ARCHIVE_NONE).

1:

Entries on the selected form are copied to the archive form (AR_ARCHIVE_FORM).

2:

Entries on the selected form are deleted from the source form (AR_ARCHIVE_DELETE).

32:

Attachment fields are not copied to the archive form. (AR_ARCHIVE_NO_ATTACHMENTS).

64:

Diary fields are not copied to the archive form. (AR_ARCHIVE_NO_DIARY).

In addition to the archive type, archiveInfo also stores the form name (if archive type is AR_ARCHIVE_FORM ), time to trigger the archive, and the archive qualification criteria. For an archive form, only the name of the source form is maintained, and none of this archive information can be set.

auditInfo

If a form is to be audited, this is the audit information for the form. Specify NULL for this parameter if you do not want to create or set the audit information. These are the values for audit type:

0:

The selected form is not to be audited. (AR_AUDIT_NONE).

1:

Audit fields and copy fields on the selected form are copied to the audit shadow form (AR_AUDIT_COPY).

2:

Audit fields and copy fields on the selected form are copied to the audit log form (AR_AUDIT_LOG).

In addition to the audit type, auditInfo also stores the form name (if audit type is AR_AUDIT_COPY or AR_AUDIT_LOG) and the audit qualification criteria.

assocToFollowInfo

During the data archiving process, if the you want to specify the list of associations to be followed, use this schema. Specify NULL for this parameter if you do not want to retrieve the AssociationsToFollowForArchive information.

The following are the values for AssociationSelectionType:

0

 NONE. If you want to follow parent forms association selection type information. (AR_ASSOCIATION_SELECTION_TYPE_NONE)

1

SPECIFIC_ONLY. Only Associations selected/specified in this structure will be considered during archive process.

(AR_ASSOCIATION_SELECTION_TYPE_SPECIFIC_ONLY)

2

ALL_ENFORCED. All the associations, in which this form is used as parent form and enforcement as ENFORCE_YES, will be considered during data archiving process.

(AR_ASSOCIATION_SELECTION_TYPE_ALL_ENFORCED)

3

ALL. All the associations, having this form as primary form, will be considered during data archiving process.

(AR_ASSOCIATION_SELECTION_TYPE_ALL)

In addition to the Association selection Type, assocToFollowInfo also stores, association name list. This will be applied when association selection type is SPECIFIC_ONLY or ALL_ENFORCED.

defaultVui

The label for the default view.

helpText

The help text associated with the form. This text can be of any length. Specify NULL for this parameter if you do not want to associate help text with this object.

owner

The owner for the form. The owner defaults to the user performing the operation if you specify NULL for this parameter.

changeDiary

The initial change diary associated with the form. This text can be of any length. The server adds the user making the change and a time stamp when it saves the change diary. Specify NULL for this parameter if you do not want to associate change diary text with this object.

objPropList

A list of server object properties. If this parameter is set to NULL, a properties list with zero properties is associated with the form, and a list of zero properties is returned when an ARGetSchema is performed. See Server object properties.

objectModificationLogLabel

The version control label that the API function must apply to the object. If the label name does not exist on the server, the function creates it.

Ripple actions

Rename and Delete operations typically change multiple objects in addition to their primary target object. The Rename or Delete function must apply the version control label to all the objects that it affects.

Multiple API calls for a single user action 

Some user actions trigger a sequence of API calls. In that situation, the last API call in the sequence applies the version control label to the object. Thus, clients that create forms (like BMC Remedy Developer Studio does) should provide the label only to the last call. For example, when a form is created, a client might issue these calls:

  • ARCreateSchema
  • ARCreateMultipleFields
  • ARSetVUI
  • ARSetVUI
  • ARSetSchema

In this case, the objectModificationLogLabel value should be passed only to the last call, ARSetSchema, even though the user provides the label during the ARCreateSchema operation.

Operations on label-related forms

Version control labels cannot be applied to these forms:

  • AR System Version Control: Label
  • AR System Version Control: Labeled Object
  • AR System Version Control: Object Modification Log

Return values

status

A list of zero or more notes, warnings, or errors generated from a call to this function. For a description of all possible values, see Error checking.

See also

ARCreateField, ARDeleteSchema, ARGetSchema, ARGetListEntry, ARGetListAlertUser, ARSetField, ARSetSchema. See FreeAR for: FreeARCompoundSchema, FreeAREntryListFieldList, FreeARIndexList, FreeARInternalIdList, FreeARPermissionList, FreeARPropList, FreeARSortList, FreeARStatusList.

Was this page helpful? Yes No Submitting... Thank you

Comments