guides:programming:programmers_reference_manual:write_method

WRITE Method

Method to create new entities, or overwrite existing entities.

Note: The difference between using Repository('WRITE') and writing directly to a system table (such as SYSREPOSWINS for windows) using a BASIC+ program is that using the Repository('WRITE') 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.

retval = Repository('WRITE', entID, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11)

The WRITE method has the following parameters.

ParameterDescription
Message'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.
param1the 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
param10For APPROW entities: the subkey

For other entities: the row to write
param11For APPROW entities: the row to write

For other entities: unused

Null. Note: Always call the Get_Status function after calling Repository.

Repository() function, NEW Method, Get_Repos_Entities(). Also, Stored Procedures chapter in the Guide to Application Development.

/*  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|Msg()]] for complete message row to write */

* write the record

retval = Repository("WRITE", EntID, "", 1, 1, "", "", "", "", "", "MSG", MsgRec)

/*  check if write completed correctly */

If Get_Status(ErrCode) then

  call msg(@window, 'Error Message returned: ' : ErrCode)

end
  • guides/programming/programmers_reference_manual/write_method.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1