Information Catalog Manager Programming Guide and Reference

FLGDeleteInst

Deletes a single, specified object instance of an object type.

Authorization

Administrator or authorized user (all object types); user (Comments object type only)

Syntax



APIRET  APIENTRY    FLGDeleteInst( PSZ              pszFLGID,
                                   PFLGEXTCODE      pExtCode );

Parameters

pszFLGID (PSZ) -- input
Points to the 16-character, system-generated unique identifier of the instance to be deleted.

Characters 1-6 of this ID identify the object type of this instance.

Characters 7-16 of this ID are the system-generated unique instance identifier.

pExtCode (PFLGEXTCODE) -- output
Points to an extended code associated with the reason code. See Appendix D, Information Catalog Manager reason codes to see if a meaningful extended code is associated with the returned reason code.

Reason code (APIRET)
Represents the execution result of this API call.

See Appendix D, Information Catalog Manager reason codes for an explanation of the returned reason codes.

Usage

Prerequisites

The value specified for the pszFLGID input parameter must exist.

Restrictions

If you are a user who has not been authorized to perform object management tasks, you can only delete Comments instances for which the value of your logged-on user ID is the same as the value of the Creator property.

Rules for object instances with relationships

For instances participating in Attachment relationships:

  • If the instance has one or more associated Comments instances, then all the Comments instances and all such relationships are deleted when the object instance itself is deleted.
  • If the instance is a Comments instance in an Attachment relationship, then all such relationships are deleted when the Comments object instance itself is deleted.

For instances that are contained or containers:

  • If the instance is a container, you must delete all relationships with contained object instances before deleting the instance using FLGDeleteInst. If you want to delete an instance that is a container and all relationships with contained object instances, you can use FLGDeleteTree instead (see FLGDeleteTree).
  • If the instance is contained by another object, you can delete the instance without first deleting the relationship with the container object. Both the relationship and the instance itself are automatically deleted.

For instances participating in Contact relationships:

  • If the instance participates in any Contact relationship, then all such relationships are deleted when the object instance itself is deleted.
  • If the instance is a Contact in a Contact relationship, then all such relationships are deleted when the Contact object instance itself is deleted.

For instances participating in link relationships:

If the instance participates in link relationships, then all such relationships are deleted when the object instance itself is deleted.

For Programs instances associated with non-Program object types:

A Programs instance can be deleted at any time without affecting any associated object types.

Controlling updates to your information catalog

To keep your program as synchronized as possible with your information catalog, you should include a call to FLGCommit (see FLGCommit) after FLGDeleteInst completes successfully. If FLGDeleteInst does not complete successfully, you should include a call to FLGRollback (see FLGRollback).

Examples

Figure 56 shows the C language code required to issue the FLGDeleteInst call. This sample code deletes an object instance.

Figure 56. Sample C language call to FLGDeleteInst

 
 APIRET        rc;                         // Declare reason code
 UCHAR         pszFLGID[FLG_ID_LEN + 1];   // Unique instance identifier
 FLGEXTCODE    ExtCode = 0;            // Declare extended code
   .
   .  /* Get FLGID for object instance using FLGSearch. */
   .
 strcpy (pszFLGID,"0000330000001234");
 rc = FLGDeleteInst (pszFLGID,             // Instance ID
                     &ExtCode);
 


[ Top of Page | Previous Page | Next Page ]