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

  • 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.

  • Thanks for reply.

    I tried below code in template(ADSaccount-->UID_ADSAccountManager)

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

    But still Manager is not pushing.I have changed user manager from manager tool but still same value is not pushed in ADSaccount table

    User Overview screen shot

    User AD profile

    Can you suggest please?

    Regards,

    PS

  • Hi Pankaj,


    My first question would be .... does "Bell, Iris" have an ADSAccount?

    If they do, my second question would be ..... Have you set the custom template to be an overwriting template?

    If yes, then my third question would be .... Have you changed anything on the account to make the template fire?

    If not, open the target ADSAccount in ObjectBrowser and run 'Target > Execute templates' ..... if the template is correct and the manager has an ADSAccount you should see UID_ADSAccountManager get a value .... then 'Save'.


    HTH, Barry.

  • I wrote a blog for this, since we flow manager from D1IM to ActiveDirectory for every customer.

    nafejeries.wordpress.com/.../