Expose data from Active Directory using method Initializing

  • 18 October 2017
  • 2 replies
  • 45 views

Badge +6

I would like a form to populate data based on current user, but pull data from that person's AD entry as well.  I am able to have the form load with current user's Employee ID, but does anyone know a way to have the rest of the form expose information from Active Directory based on the Current User (taken from System Value)? Or is the GetUserDetails method only activated by a parameter input?  I am THINKING the rule should be something like "If Employee ID (from System Value) =MarkL, then GetUserDetails (List from Active Directory) for MarkL and list in View2"...?

 

 


2 replies

Userlevel 5
Badge +18

Is this perhaps applicable?


 


OOTB there is an AD Service2 broker that connects to Active Directory and exposes the 'AD User' SmartObject.


https://help.k2.com/onlinehelp/k2blackpearl/userguide/4.7/default.htm#ServiceBrokers/ActiveDirectory2/Active_Directory2.htm


 


The 'AD User' SmartObject it will have a 'Get User Details' method.


You can call this SmartObject on View initialize and pass it the current user and output the fields available from AD:




Badge +6

Hello and Thank you-

 

Yes, that is the ServiceObject Instance I was trying to use to populate the rest of the table. OOTB it requires one field as an input field (as far as I can tell?). I was hoping to get the rest of the form to populate using that ServiceObjectInstance after the Name is input from the System Value: Current User. So I was pulling Current User from System Values, then was trying to get the rest of the form to populate based on which current user.

 

Name: (from System Value: Current User) MarkL

 

   then>

 

GetUserDetails from ActiveDirectory for MarkL to populate:

 

Email: markl@*****.com

Pay Date:  11/23/2017

 

etc. for the rest of the form without having to input anything. The Form just generates all of this info based on the Current User.

 

(and there's a very good chance I'm making no sense with my level of experience in K2 :b)

 

 

 

 

Reply