This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ADSaccount-->UID_ADSAccountManager manager attribute

Hi Team,

I am trying to push the value of Person-->UID_PersonHead into ADSaccount-->UID_ADSAccountManager.But I am getting below error message

Branden) could not be saved!
Could not save object Employees (Davis, Branden).
at VI.DialogEngine.DialogEngine.SaveDocument(IDocument[] documents, Schedule schedule)
at VI.MVC.Document.Save(Boolean reloadIfNecessary)
at VI.MVC.SingleDBObjectDocument.OnSave(Boolean reloadIfNecessary)
at VI.DB.Implementation.SingleDbObject.Save()
Could not save object Active Directory user accounts (asurionlab.org/Users/Branden Davis [USER]).
at VI.DB.Implementation.SingleDbObject.Save()
at VI.DB.Implementation.SingleDbObject._PropagateTemplates()
at VI.DB.Processing.SynchronousProcessingQueue.Add(IDbJob job)
at VI.DB.Processing.DbJobDynamicTemplate.Run(IConnection conn)
at VI.DB.Implementation.SingleDbObject.Save()
Error during execution of statement: update ADSAccount set UID_ADSAccountManager = N'00075c5a-a30a-46e1-9c69-798186b13419', xdateupdated = GetUTCDate(), XUserUpdated = N'viadmin' where UID_ADSAccount = N'ec07f9f6-a65e-4062-8fd9-589ef50b2f4a' and (isnull(UID_ADSAccountManager, N'') = N'' and isnull(vi_consistent, N'') <> N'D')
at VI.DB.Implementation.SingleDbObject.Save()
at VI.DB.Implementation.SingleDbObject._UpdateDB(Boolean checkRights)
at VI.DB.SqlExecutor.SqlExecuteNonQuery(String sqlStatement)
at VI.DB.SqlExecutor.SqlExecuteNonQuery(IQueryProvider provider, IDataParameter[] parms)
Database error 50000: detected in (SRV=LABONEDB701, DB=Q1IM) Procedure vi_2ADSAccount, Line 327
at VI.DB.SqlExecutor.SqlExecuteNonQuery(IQueryProvider provider, IDataParameter[] parms)
at VI.DB.SqlExecutor._SqlExecuteNonQuery(DbStatement stmt)
Database error 50000: Cannot insert object in ADSAccount because the associated object in ADSAccount does not exist. Rule R757

My Template code for ADSaccount-->UID_ADSAccountManager

Select Case ($ManageLevel:Int$)
Case 0:'Unmanaged (do not get data from employee)
Case Else:'Managed (fill all possible fields about employee)
Value = $FK(UID_Person).UID_PersonHead$
End Select

Can you please suggest how i can achieve this?

Regards,
PS

Parents
  • Hi,


    It fails because this:

    Value = $FK(UID_Person).UID_PersonHead$

    Is trying to put a UID from a Person object into a field that needs to holds the UID of an ADSAccount object.

    You want something like this:

    Value = Connection.GetSingleProperty("ADSAccount", "UID_ADSAccount", _
    f.Comparison("UID_Person", $FK(UID_Person).UID_PersonHead$, ValType.String, CompareOperator.Equal))

    HTH, Barry.

Reply
  • Hi,


    It fails because this:

    Value = $FK(UID_Person).UID_PersonHead$

    Is trying to put a UID from a Person object into a field that needs to holds the UID of an ADSAccount object.

    You want something like this:

    Value = Connection.GetSingleProperty("ADSAccount", "UID_ADSAccount", _
    f.Comparison("UID_Person", $FK(UID_Person).UID_PersonHead$, ValType.String, CompareOperator.Equal))

    HTH, Barry.

Children
No Data