Populate Lookup Using entity Adapter

Hi,
I need to populate(not pre-populating a lookup) a lookup code. This lookup code is attached to a lookup field in my child process form. I am thinking I have to create an entity adapter for the same. Am I correct? If yes then could someone please tell me where do I attach this adapter. I have tried attaching the adapter on the child form on pre-insert and pre-update. But the adapter gets triggered only when I already have selected a value from the lookup and click on Add. But I want the adapter to get triggered before I click on editing any field of the child form.
Thanks,
Supreetha

Be clear in what you are trying to achieve.
*1) I need to filter the data being presented in the lookup according to the organizations* -> This means the user who would be doing provisioning would be shown a list of departments (filtered) and it can select the one which is required.
*2) I was hoping that I could achieve the same using the entity adapter* -> When you say entity adapter it means something automatic (like trigger on the provisioning task), it means that you just want to automatically populate the departments from the lookup based on the organization without letting the user who is provisioning select the departments manually.
Both the above use-cases can be achieved easily:
*1) Use dynamic look-up It would be lookup query with the where clause and you would pass the organization attribute in the clause. Look for similar threads or E-Business OOTB connector for more help*
*2) Use OIM API's to fetch the departments you want to add & using a process task add these values to the child table of the user process form*

Similar Messages

  • Code to Create and Populate Lookup using Java API

    Hi All,
    I wish to write a java code to first create a lookup in OIM and then populate with some custom values.
    For creating Lookup, I used the following function and it worked:
    tcLookupOperationsIntf useLookup=(tcLookupOperationsIntf)factory.getUtility
    ("Thor.API.Operations.tcLookupOperationsIntf");
    useLookup.addLookupCode("Lookup.Custom");
    However, If I try using the following function to populate this lookup:
    useLookup.addLookupValue("value1","value2",value3",value4");
    I got this error:
    Thor.API.Exception.tcInvalidLookupException
    Please help.
    Cheers,
    Sunny

    You are using the correct API
    ("value1","value2",value3",value4");
    The values which you are providing are wrong.
    TRY THIS
    addLookupValue("Lokkup.Test", codeValue,decodevalues, "en", "US")
    Lookup.Test should be there.

  • Self Reference Model Class - How to populate using Entity Framework

    Hi,i have table in SQL Server named Employees as follows:
    EmployeeId lastName FirstName reportsTo
    1 Davolio Nancy 2
    2 Fuller Andrew NULL
    3 Leverling Janet 2
    4 Peacock Margaret 2
    5 Buchanan Steven 2
    6 Suyama Michael 5
    7 King Robert 5
    8 Callahan Laura 2
    9 Dodsworth Anne 5
    I would like to use Entity Framework to populate my Model Class .My model class looks as follows:
    public class Employees
        readonly List<Employees> _children = new List<Employees>();
        public IList<Employees> Children
            get { return _children; }
        public string FirstName { get; set; }
        public string LastName {get; set;}
    I want to use this class in ViewModel  to populate my TreeView control. Can anyone help me in order to define Linq to Entities in order to populate my model class Employees from table in SQL Server as defined. Thanks in advance.
    Almir

    Hello Fred,
    unfortunately it does not work, maybe I can be more specific about what I'm trying to get. I'm following Josh Smith's article on CodeProject related to WFP TreeView
    Josh Smith article. He has Class named Person with the following structure
    public class Person
    readonly List<Person> _children = new List<Person>();
    public List<Person> Children
    get
    return _children;
    public string Name { get; set; }
    The same is populated from Database class using method named GetFamilyTree() which look as follows:
    public static Person GetFamilyTree()
    // In a real app this method would access a database.
    return new Person
    Name = "David Weatherbeam",
    Children =
    new Person
    Name="Alberto Weatherbeam",
    Children=
    new Person
    Name="Zena Hairmonger",
    Children=
    new Person
    Name="Sarah Applifunk",
    new Person
    Name="Jenny van Machoqueen",
    Children=
    new Person
    Name="Nick van Machoqueen",
    new Person
    Name="Matilda Porcupinicus",
    new Person
    Name="Bronco van Machoqueen",
    new Person
    Name="Komrade Winkleford",
    Children=
    new Person
    Name="Maurice Winkleford",
    Children=
    new Person
    Name="Divinity W. Llamafoot",
    new Person
    Name="Komrade Winkleford, Jr.",
    Children=
    new Person
    Name="Saratoga Z. Crankentoe",
    new Person
    Name="Excaliber Winkleford",
    I'm trying to figure out how should I write
    GetFamilyTree() method using Entity Framework in order to connect to my SQL Server database and populate this Person class as it was populated manually in Joshs Example. The table I'm using in SQL Server is described in
    my first post named Employees (it's self reference table)

  • How to polulate data from lookup using request dataset in OIM 11g

    Hi,
    Using Request dataset in OIM 11g, I need to display one dropdown with the roles those need to come from Lookup.
    For Ex; I have 2 resources,i.e Resource A and Resource B. Resource A has 5 roles and Resource B has 3 Roles.
    While creating a request, If I select Resource A, then I should be able to get 5 Roles and if I select Resource B then I should be able to see corresponding 3 roles.
    Pls. note I have only one Look up definition , where I have roles for both Resource A and B.
    I have done simillar thing in OIM 10g , however I am unable to do it using OIM 11g Request dataset.
    Pls suggest.

    Hi BB,
    I am trying to follow up your response.
    You are suggestng to use prepopulate adapter for to populate respource object name, that means We have to just use an sql query from obj tabke to get the resource object name. right ?? it could be like below, what should I have entity-type value here ??
    <AttributeReference name="Field1" attr-ref="act_key"
    available-in-bulk="false" type="Long" length="20" widget="ENTITY" required="true"
    entity-type="????"/>
    <PrePopulationAdapter name="prepopulateResurceObject"
    classname="my.sample.package.prepopulateResurceObject" />
    </AttributeReference>
    <AttributeReference name="Field2" attr-ref="Field2" type="String" length="256" widget="lookup-query"
    available-in-bulk="true" required="true">
    <lookupQuery lookup-query="select lkv_encoded as Value,lkv_decoded as Description from lkv lkv,lku lku
    where lkv.lku_key=lku.lku_key and lku_type_string_key='Lookup.xxx.BO.Field2'
    and instr(lkv_encoded,concat('$Form data.Field1', '~'))>0" display-field="Description" save-field="Value" />
    </AttributeReference>
    Then I need think about the 'Lookup.xxx.BO.Field2' format.
    Could you please let me know if my understanding is correct?? What is the entity-type value of the first attribute reference value?
    Thanks for your all help.

  • OIM API - how do you get a tcUtilityFactory in an Entity Adapter?

    How does one get a tcUtilityFactory in an Entity Adapter? I thought I could map it as a parameter and pass it it as a Database Reference object, but when I go to the Mappings in Data Object Manager, the only possibilities for mappings are Entity Fields (USR_*)
    I know in a scheduled class you can do something like getDatabase(), does that exist if you extend a tcBaseEvent?

    First, I was able to resolve it by using getDatabase(), but to address what you guys are saying...
    Yes, I can create a a variable in my adapter of type Object and map it as you describe, that's all fine. But if my adapter is an Entity Adapter then, when you want to use it you have to:
    1. Go to Development Tools -> Business Rule Def -> Data Object Manager
    2. Lookup the Users form
    3. Assign the adapter to Pre-Insert (or whatever)
    4. MAP IT... this is where what i'm saying won't work... you cannot MAP to the variable you defined when you created the adapter. You have no choices there for Database References... the only choices you have are User fields.. look for yourselves.

  • Entity Adapter in infinite loop

    Hi,
    I have written code which takes userid as input and updates the user attribute using OIM API based an a criteria. I have attached this entity adapter on pre-update of the user form. The adapter is getting trigered but is going into infinite loop.
    Can anyone help me on how to avoid this ??
    Any help will be appreciated.

    Hi,
    I think don't need to update the user attribute using the OIM API. Assign the adapter return value to the UDF you want to update. So you dont have to use the API.
    When you use the API, the events are fired, so your code will go in a loop.
    If you have to update more than one field on the pre update, for example, I suggest you write an Event Handler. Below is a sample of an Event Handler code that I have assigned to the Specific Task Info dataobject:
    import com.thortech.xl.client.events.tcBaseEvent;
    public class EventHandlerSample extends tcBaseEvent {
         public NotifyTaskStatusChangedEvent(){
              this.setEventName("Event Handler Sample");
         @Override
         protected void implementation() throws Exception {
    String taskKey = this.getDataObject().getString("SCH_KEY");
         String newTaskStatus = this.getDataObject().getString("SCH_STATUS");
         String oldTaskStatus = this.getDataObject().getCurrentString("SCH_STATUS");
    System.out.println("Old Status: " + oldTaskStatus);
    System.out.println("New Status: " + newTaskStatus);
    if(this.getDataObject().isInserting()){
    if (this.getDataObject().isPostEvent(){
    //do something
    if (this.getDataObject().isPreEvent(){
    //do something
    }else if(this.getDataObject().isUpdating()){
    }else if (this.getDataObject().isDeleting()){
    Read the metalink Developing a Custom OIM Event Handler Using Eclipse [ID 604817.1]
    Renato.

  • Generate random User Alias - Entity adapter

    Hi,
    I am a newbie. Can anyone please help me in telling steps for creating an Entity Adapter which generate a random User Alias.
    TIA.
    Got few threads that tell about pre-populate adapter, none for entity adapter.

    Hi,
    Follow the below steps to create new entity adapter in OIM
    To add the new created event handler to OIM server, perform the following steps:
    1. Write a java code to perform the needed operation ("Generate random user alias" in your case).
    2. Copy the file to OIM_HOME\xellerate\EventHandlers
    3. Open Design Console and navigate to: Development Tools -> Business Rule Definition -> Event Handler Manager
    4. Create a new Event Handler and specify:
    Event Handler Name: +<give the class name of your code>+
    Package: +<give the package name of your code>+
    Pre-Insert: Checked (for this scenario)
    5. Save the event handler
    6. Navigate to Development Tools -> Business Rule Definition -> Data Object Manager
    7. Search for "Users" and add the event handler to the Pre-Insert list.
    8. Save.
    Regards,
    NS

  • Using Entity Framework with Crystal Master Detail Reporting

    My project is a WPF project connected to a SQL Server Compact Edition database.  Since Crystal does not support nullable types, I have created classes specifically for the report to consume.  This is a simplified version of what I am attempting to do.
    For example...
    class Band
    public string BandName { get; set; }
    public string BandCity { get; set; }
    public List<BandRecording> RecordingsList { get; set; }
    class BandRecording
    public string Year { get; set; }
    public string Description { get; set; }
    In my code behind for this report, I am using Entity Framework to pull the data.  Just pulling information for one band...
    using (RockEntities re = new RockEntities())
    var bandinfo = (from b in re.Band
    where b.BandName == "BT"
    select new
    b.BandName,
    b.BandCity,
    Recordings = b.Recordings.OrderBy(z => z.Year)
    }).FirstOrDefault();
    OK, now I start moving to the data to class I have defined...
    Band b = new Band();
    b.RecordingsList = new List<BandRecording>();
    b.BandName = bandinfo.BandName;
    b.BandCity = bandinfo.BandCity;
    foreach(var Recording in bandinfo.Recordings)
    BandRecording br = new BandRecording();
    br.Year = Recording.Year;
    br.Description = Recording.Description;
    b.RecordingsList.Add(br);
    Since Crystal Supports IEnumerable, I create a list to hold the main record (although I am only reporting on one band)...
    List<Band> lb = new List<Band>();
    lb.Add(lb);
    ReportDocument rd = new ReportDocument();
    rd.Load("BandReport.rpt");
    rd.SetDataSource(lb);
    I have put the Band info in the Report Header section.  This is all working fine. In the details section I would like to put the Band Recording info.  I haven't figured out how to do this.  I have put the fields in the Details section, but how do I tell the details section to use the inner List<BandRecordings>?
    Any help would be greatly appreciated.

    Only way I can see of doing this would be to place emprty formulas into the section. The populate the formula(s) with the required field;
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Public Class Form1
    Inherits System.Windows.Forms.Form
    Dim Report As New CrystalReport1()
    Dim FormulaFields As FormulaFieldDefinitions
    Dim FormulaField As FormulaFieldDefinition
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FormulaFields = Report.DataDefinition.FormulaFields
    FormulaField = FormulaFields.Item(0)
    FormulaField.Text = "[formula text]"
    CrystalReportViewer1.ReportSource = Report
    End Sub
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Disadvantages of using entity beans.

    can I know the disadvantages of using entity beans.

    sigh I guess if someone puts it on a website it must be true...
    "Forces the use of a heavy component mechanism for fine grained business objects."
    Heaviness is not some arbitrary side-effect. It is directly due to the services provided by the EntityBeans (transactions, etc). If you need those services, you pay the price. If you don't then you shouldn't be using EJB to begin with. Also with the advent of LocalInterfaces, fine-grainedness is no longer a liability.
    "More complex than JDO limiting developer productivity."
    Perhaps it has less to do with limited productivity, and more to do with limited developers.
    "More difficult to achieve good performance."
    Compared to a simple data storage mechanism, sure.
    "Inheritance not supported."
    Really? Wow, I guess all the EJB code I've written for the last 3 years doesn't really work.
    "Cannot be used for persistence in non-application server environments."
    Uhh, yeah, but seeing as how the decision to use EJBs is not limited to the persistance scheme, the non-use of an application server is moot.
    "There is no dynamic query mechanism to lookup entity beans (finders are specified at compile time)."
    And what compiled business process (i.e SessionBeans) requires dynamic lookup of arbitrary data? Humans performing search functions can be done via entity beans, but probably should not be done since a large searches do not (or very rarely) need to be transactional.
    "It is not easy to write unit tests for beans as it is not possible to use them outside of the application server."
    For a long time this was true, but there are now many unit test suites designed for J2EE.
    "No support for automatic primary key generation."
    In the spec, no. But it's fairly trivial to implement on your own.
    "Only relational databases are supported."
    If you use CMP, yes. If you use BMP, you can do whatever you want inside your ejbLoad()/ejbStore() methods. Another reason to not use CMP.

  • Entity Adapter

    1) If a new record is added into a table in OIMDB, will the entity adapter detect this change and invoke the java code?
    2)Since user is not mapped to a profile directly, I guess we need to use an API to get the profile details of a particular user. Can anyone mention which API do I need to use to get the user profile?

    In OIM 10g, we have created a entity adapter which listens to USR_STATUS attribute of USR table.When the entity adapter is invoked we need to retrieve the USR_LOGONID of that user whose USR_STATUS has changed in OIMDB. Which api am I supposed to use to retrieve this USR_LOGONID attribute?? or is there any other alternative approach in entity adapter to retrive LOGONID for an user whose status changes and triggers the Entity Adapter?

  • OIM: Entity adapter task status

    Hi there,
    Is there a way to find out if a given entity task has completed on a given user and if so successfully or with errors/exceptions? I have attached an entity task to the user's post-insert list that calls on an entity adapter.
    Thanks

    I would suggest in your code put something like "EMAIL SEND STATUS|User Login|Success/Failure" as a System.out.println or even use proper logging and just to log.error for the Failure. If you have a try statement around your email, put the Success message after your email is successful and your failure message in the catch piece.
    -Kevin

  • How to connect sound or audio to my tv using hdmi adapter. I tried to connect thru sound settings but my tv is not found.

    how to connect sound to my tv set using hdmi adapter. Im using 2009 macbook pro 13". I went to sound settings then output and it shows internal speaker built- in, it wont locate my tv set. pls. help, thanks

    You probably can't because it looks like your MacBook Pro is too old to carry audio over HDMI. You will need to run a separate audio cable from the audio out port on the MacBook Pro to the audio in port on the TV.
    Check your MacBook Pro model year against the list in this Apple tech note:
    About Mini DisplayPort to HDMI adapters
    Learn about the Mini DisplayPort in the latest Mac models that enables audio and video output for DisplayPort and HDMI.

  • Not able to get the message from Queue using MQ adapter

    HI
    Using Mq adapter am able to put the message in a queue and am able to get the message if i select the schema type as opaque, but am not able to get the message if i specify any schema type and am getting timed out exception.
    Kindly help to proceed with this issue.

    Hi,
    Am also facing the same issue.
    I would be thankful if anyone can provide the solution

  • I have a 60 inch Sony XBR TV that has DVI input but not HDMI. I am using an adapter to get the video from my Apple TV, but the screen flashes a lot. Do I have any other choices other than buying a new TV?

    I have a 60 inch Sony XBR TV that has DVI input but not HDMI. I am using an adapter to get the video from my Apple TV to the Sony, but the screen flashes a lot. Do I have any other choices other than buying a new TV?

    Is this an iphone question?
    You have posted in the iphone forum.

  • Can I use an adapter to get thunderbolt on my early 09 MacBook pro

    Can I use an adapter to get thunderbolt on my early 09 MacBook pro?

    No.  ThunderBolt is a direct connection to your systems PCI Express bus.  There is no way for your existing ports to do this with any sort of external adapter.

Maybe you are looking for