Add Object Record

Add Object Record

The Add Object Record command adds a specified object to the database. The class of the object may be either an instance of a folder or an attached document. Optionally, the object field values may be specified with a list of field name and value pairs.

Add Object Record
of type object_type

[with fields list_of_field_values]

 

Result: object_identification

 

Arguments

Type

Description

object_type

String

The name of the object type to be added (e.g. Job).

list_of_field_values

Record

List of object field labels and values. Record: {|field_name_1|: field_value_1, |field_name_2|: field_value_2, ...}. If the object type is not serialized, a value must be specified.

object_identification

Record

Record containing identification information for the object. Record: {|object_type|: object_type, |id_field|:id_field}.

Example: Add a folder type document to Virtual Ticket.

tell application "Virtual Ticket 8.0"
if (not (Exists Object of type "Catalogs" with id "Nature")) then
set fields to {¬
Catalog_Title:"Photo Disk No. 38 - Objects of Nature"¬
,Source:"PhotoDisk"¬
,Created_By:"Sarah McDonnely" }
set objectIdRecord to Add Object Record of type "Catalogs"¬
with fields {|ID|:"Nature"} & fields
end if
end tell

 

Example: Add an attached document to Virtual Ticket.

tell application "Virtual Ticket 8.0"
-- Adds a document of type Change_Order to the Job 100
set m to "Customer authorizes changes and agrees to pay $500.00"
Add Object Record of type "Change_Order"¬
with fields {Folder_ID:100, Change_Order_Note:m}
end tell


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.