OIM Versoin 8.1
I'm reading the SDK and trying to execute some of the examples and I'm not having much luck with creating DB objects.
It looks like everything is OK, there are no errors but nothing is being saved to the database. Maybe I'm overlooking something obvious.
Steps I'm following.
- Open Designer
- Create custom script CCC_TestScript
- Paste the code from example "03 Create DB objects.vb" and change Sub name to CCC_TestScript
Public Sub Create_Objects()
Dim dbPerson As IEntity
' Create a new Person object
dbPerson = Session.Source.CreateNew("Person")
' Set all mandatory fields. They have to be set before calling Save.
dbPerson.PutValue("FirstName", "Albert")
dbPerson.PutValue("LastName", "Einstein")
' Alternative you can use following syntax to set fields
' dbPerson("FirstName").NewValue = "Albert"
' dbPerson("LastName").NewValue = "Einstein"
' Set other fields (optional)
dbPerson.PutValue("Gender", 2) ' Female
dbPerson.PutValue("Description", "Created automatically")
' Save person to database
Using uow As IUnitOfWork = Session.StartUnitOfWork()
uow.Put(dbPerson)
uow.Commit()
End Using
End Sub - Compile script
- Test script
- No errors show up and the following SQL statements get created
(1 ms) - select CentralAccount, UID_Person, InternalName, xmarkedfordeletion from Person where (((CentralAccount like N'AlbertoE%') and (UID_Person <> 'bb6a8354-7677-4784-b747-32cabd1811c6'))) order by InternalName, CentralAccount
(5 ms) - select dbo.QBM_FGIMaintenanceRunning()
Setting DB context data to: user = viadmin, id = 756374ee-d3a2-49ae-8126-d88419c19a50, level = 0
(9 ms) - insert into Person (CentralAccount, Description, EmployeeType, EntryDate, FirstName, Gender, IdentityType, Initials, InternalName, LastName, Salutation, UID_Person, xdateinserted, xuserinserted, xdateupdated, xuserupdated, xobjectkey) values (N'ALBERTOE', N'Created automatically', 'Employee', '2020-03-27 00:00:00.000', N'Alberto', 2, 'Primary', N'AE', N'Einsteino, Alberto', N'Einsteino', N'Ms', 'bb6a8354-7677-4784-b747-32cabd1811c6', GetUTCDate(), N'viadmin', GetUTCDate(), N'viadmin', '<Key><T>Person</T><P>bb6a8354-7677-4784-b747-32cabd1811c6</P></Key>')
(< 1 ms) - select 1 where exists ( /* Person - QER-D708B050ECD29CBCA561DF711360DF1E */
select 1 from Person as o2
JOIN (
select
CentralAccount
from Person
where UID_Person in ('bb6a8354-7677-4784-b747-32cabd1811c6')
) as o1
on ((o1.CentralAccount is null and o2.CentralAccount is null) or o1.CentralAccount = o2.CentralAccount)
and ((o1.CentralAccount > ' '))
GROUP BY
o2.CentralAccount
HAVING COUNT(*) > 1)
Can anybody help me find out what I'm doing wrong?
Thanks