Highlighted
al4 Absent Member.
Absent Member.
14727 views

How to submit new Item using sbm AppScript???


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???
0 Likes
4 Replies
mobermaier Absent Member.
Absent Member.

Re: How to submit new Item using sbm AppScript???


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
0 Likes
Smith1 Absent Member.
Absent Member.

Re: How to submit new Item using sbm AppScript???

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
Guadalupe12 Absent Member.
Absent Member.

Re: How to submit new Item using sbm AppScript???

PM Thompson Outstanding Contributor.
Outstanding Contributor.

Re: How to submit new Item using sbm AppScript???

*** SPAM. ***
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.