The same code works in one of two different libraries and does not work in the other. In the vbscript code written for the object to be created automatically, all the property values of the object come as desired in one of the library. It does not return property values for the same code in another library as desired. The employeeNameSurname property value to be copied from another object can be taken as a value for one library, but not for another library.
The codes are as follows.
Dim ObjClass: ObjClass = Vault.ObjectOperations.GetObjectInfo(ObjVer,true).Class
Const objType =211
if ObjClass = 102 then
AutoEducation
end if
Public Function AutoEducation
Dim typeOfEducation: typeOfEducation = 1311
Dim formOfEducation: formOfEducation = 1112
Dim educationOption: educationOption = 2113
Dim educationSubject: educationSubject = 1068
Dim educationTime: educationTime = 1067
Dim educationStartDate: educationStartDate = 1065
Dim educationStartTime: educationStartTime = 1127
Dim educationEndDate: educationEndDate = 1066
Dim educationEndTime: educationEndTime = 1128
Dim educationOfficer: educationOfficer = 2049
Dim allDay: allDay = 1463
Dim educationBudget: educationBudget = 2060
Dim educationContent: educationContent = 1461
Dim educationLocation: educationLocation = 2053
Dim objEducation: objEducation = 106
Dim clsEducation: clsEducation = 8
Dim propVals: Set propVals = CreateObject("MFilesAPI.PropertyValues")
Dim onePropVal: Set onePropVal = CreateObject("MFilesAPI.PropertyValue")
Dim arrayListEducationSubject: Set arrayListEducationSubject = CreateObject( "System.Collections.ArrayList" )
arrayListEducationSubject.Add 1
arrayListEducationSubject.Add 3
arrayListEducationSubject.Add 12
onePropVal.PropertyDef = 100
onePropVal.TypedValue.SetValue MFDatatypeLookup, clsEducation
propVals.Add -1, onePropVal
onePropVal.PropertyDef = typeOfEducation
onePropVal.TypedValue.SetValue MFDatatypeLookup, 1
propVals.Add -1, onePropVal
onePropVal.PropertyDef = formOfEducation
onePropVal.TypedValue.SetValue MFDatatypeLookup, 1
propVals.Add -1, onePropVal
onePropVal.PropertyDef = educationSubject
onePropVal.TypedValue.SetValue MFDatatypeMultiSelectLookup, arrayListEducationSubject.ToArray()
propVals.Add -1, onePropVal
onePropVal.PropertyDef = educationContent
onePropVal.TypedValue.SetValue MFDatatypeMultiLineText, "Oryantasyon Eğitimi"
propVals.Add -1, onePropVal
onePropVal.PropertyDef = educationOption
onePropVal.TypedValue.SetValue MFDatatypeLookup, 1
propVals.Add -1, onePropVal
onePropVal.PropertyDef = educationLocation
onePropVal.TypedValue.SetValue MFDatatypeLookup, 2
propVals.Add -1, onePropVal
onePropVal.PropertyDef = allDay
onePropVal.TypedValue.SetValue MFDatatypeLookup, 1
propVals.Add -1, onePropVal
'onePropVal.PropertyDef = educationTime
'onePropVal.TypedValue.SetValue MFDatatypeText, ""
'propVals.Add -1, onePropVal
onePropVal.PropertyDef = educationStartDate
onePropVal.TypedValue.SetValue MFDatatypeDate, DateAdd("d",0,Now())
propVals.Add -1, onePropVal
onePropVal.PropertyDef = educationEndDate
onePropVal.TypedValue.SetValue MFDatatypeDate, DateAdd("d",0,Now())
propVals.Add -1, onePropVal
onePropVal.PropertyDef = educationStartTime
onePropVal.TypedValue.SetValue MFDatatypeTime, "08:30"
propVals.Add -1, onePropVal
onePropVal.PropertyDef = educationEndTime
onePropVal.TypedValue.SetValue MFDatatypeTime, "18:30"
propVals.Add -1, onePropVal
onePropVal.PropertyDef = educationBudget
onePropVal.TypedValue.SetValue MFDatatypeInteger, 0
propVals.Add -1, onePropVal
Dim employeeNameSurname : employeeNameSurname = PropertyValues.SearchForProperty(0).TypedValue.Value
onePropVal.PropertyDef = educationParticipant
onePropVal.TypedValue.SetValue MFDatatypeText, employeeNameSurname
propVals.Add -1, onePropVal
onePropVal.PropertyDef = 22
onePropVal.TypedValue.SetValue MFDataType.MFDatatypeBoolean, false
propVals.Add -1, onePropVal
Dim objectVersionAndProperties: set objectVersionAndProperties = Vault.ObjectOperations.CreateNewObject(objEducation, propVals , nothing, nothing)
Call Vault.ObjectOperations.CheckIn(objectVersionAndProperties.ObjVer)
End Function
Many Thanks.