Description

Method to create new entities. This includes entities that are inherited from another application.

The difference between using Repository('NEW') and writing directly to a system table (such as SYSREPOSWINS for windows) using a BASIC+ program is that using the Repository('NEW') function records the event to the repository history log, while the direct WRITE statement does not record the event. Using the Repository() functions is recommended.

Syntax

retval = Repository("NEW" entID, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10)

Parameters

The NEW method has the following parameters.

ParameterDescription
Message"NEW"
paramthe state flag for the entity
param2the publishable flag for the entity
param3the shareable flag for the entity
param4a field mark delimited list of entities super (parents) of this entity
param5a field mark delimited lists of entries sub (children) of this entity
param6a field mark delimited list of documents related to this entity
param7a value mark delimited list of users having access rights to this entity
param8a value mark delimited list of users having update rights to this entity
param9the entity title
param10the row to write
entIDentID consists of four elements, which are '*' (asterisk) delimited:
 
  • Application name
  • Type ID
  • Class ID
  • Entity name
 Methods are executed as follows: if class specific, execute at the class level; if type specific, execute at the type level; otherwise, execute the method.

Returns

Null.

Note: Always call the Get_Status function after calling Repository.

See also

Repository() functionWRITE MethodGet_Repos_Entities().

Example

/*  Write a message called SAMPLE_MESSAGE to the repository, making it SHAREABLE and PUBLISHABLE */
declare function repository, get_status
AppID = @APPID<1>  ;* current application
TypeID = "MSG"  ;* OpenInsight message
ClassID = ""  ;* Not Applicable
Message_Name = 'SAMPLE_MESSAGE'
entid = AppID : '*' : TypeID : '*' : ClassID : '*' : Message_Name
MsgRec = 'This is a test message'
/*  MsgRec contains the text of the message.  See Msg() for complete message row to write */
* write the record
retval = Repository("NEW", EntID, "", 1, 1, "", "", "", "", "", "MSG", MsgRec)
/*  check if write completed correctly */
If Get_Status(ErrCode) then
  call msg(@window, 'Error Message returned: ' : ErrCode)
end
  • No labels