Alexandr
Alexandr
Offline
0
I need to create 3 new Items, during my script work, and additional question is how to set required fields, if they are exist on my default submit transition???
Responses (3)
  • Accepted Answer

    Michael
    Michael
    Offline
    Thursday, August 18 2011, 08:55 AM - #Permalink
    0
    Should be fairly straight forward:

    Set scrRec = Ext.CreateAppRecord(Ext.tableID("Your Primary Table name here"))

    'set PROJECT DEFAULTS

    Call scrRec.SetFieldValue("OWNER", projectDefaultOwner)

    ' set ALL MANDATORY FIELDS

    Call scrRec.SetFieldValue("MANDATORY1", someValidValue)

    Call scrRec.Add()

    ' if you need to internal id for that new item

    returnSCR = scrRec.GetID()

    ' In my script I have also the following lines

    Call scrRec.Lock()

    Call scrRec.Update()

    Call scrRec.UnLock()

    the trickier part is to determine VALID default values for the required fields depending on the project you want to submit into, you can read the ts_properties table for that

    ' Build an App Record To the Properties table, And search it to find the default value for

    ' the Field we are searching for, for the given Project we are currently In

    ' make sure transition id = 0

    ' Field id can be retrieved from ts_fields

    Set apprecord = Ext.CreateAppRecord(Ext.TableID("TS_PROPERTIES"))

    whereclause = "TS_FLDID = " & fieldID & " And TS_PROJECTID = " & dest_project & " And TS_TRANSID = 0"

    If apprecord.ReadWithWhere(whereclause) Then

    ' for fields that are of base type integer (all internal ids, etc.)

    Call apprecord.GetFieldValue("INTVAL", defValue)

    End If

    you may want to refer to the data dictionary sbm_schema_doc.pdf for further information.

    HTH, Michael
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, October 07 2017, 12:34 AM - #Permalink
    -1
    Title and Description copied from Widget Change Request • Item Type to Task • Task Owner to the Asse.. ... Submit Date to now ... in the Assessors multi-user ' field and create a new Task item in the Issues table the assessor. Mount the volume once, then open System Preferences->Accounts->Login Items and drag ... Send iMessages from the Finder · Quick Look with a three-finger tap ... visit college paper writing service
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, October 17 2017, 02:04 PM - #Permalink
    -1
    The reply is currently minimized Show
Your Reply

Recent Tweets

Twitter response: "Invalid or expired token."