5 Replies Latest reply on Mar 1, 2013 12:25 PM by Jiri.Machotka-Oracle

    Tree metadata dependent field

      Hi guys,

      I have a problem creating a new metadata field. It's a custom metadata field, which is a tree based on a recursive table. I'm able to build it, but the problem is that the client wants that it has to be dependent on other field.
      When I'm configuring this tree, the option "Dependent field" is enabled, so I can create a relationship between the tree and the dependent field. In this screen, the relation doesn't appear until I click "use view" option and then click "use tree" again. Once I have configured the dependence, the field behave as normal, I mean...there is no filter.

      A short example:
      Option List field: Departments with values (Department1, Department2, ...)
      Tree field: Areas with values:

      I would like that when user (in check-in form) selects a department and then clicks the select button for areas...the resulting tree should be filtered only for the selected department. Client doesn't have predefined levels, so we can't use simple dependent option lists!

      Can anyone help us?? Thanks in advance!

        • 1. Re: Tree metadata dependent field
          See here: http://docs.oracle.com/cd/E23943_01/doc.1111/e10978/c04_metadata.htm#sthref141

          For dependency search for Dependent Choice List, then check if you can present it in a form of a tree and if so how it behaves.
          • 2. Re: Tree metadata dependent field
            Thanks for your reply Jiri,
            but what we need is the mix of both options. We're able to build dependent simple option lists, but we need a tree which can be filtered (pruned) by other field. Is it possible?
            In the Configuration Manager, when you select the "use tree" option, the "is dependent field" is enabled, so I understand that it is possible to do.

            • 3. Re: Tree metadata dependent field
              I have just checked it in the system, and unfortunately, the result is negative.

              The reason seems to be that as soon as you 'Use Tree' for an option list, the system is unable to recognize relationship between the dependent field and the field on which the field should depend.

              What have I tried?

              a) defined two tables Countries (CountryID, CountryName), Cities (CityId, CountryId, CityName)
              b) define two views for the tables above
              c) defined a relationship binding the two tables on the CountryId column

              Now, I defined two new metadata fields, Country and City.
              - Country uses the CountryView (as 1st level of the tree),
              - City is also defined as 'Use Tree'. I tried two options:
              a) CountryView for Level1, CityCountryRelationship for binding Level1 and Level2, CityView for 2.
              It works fine only as soon as I try to define the field as 'Dependent' on Country it tells me that 'You need to define a relationship for a dependent field'.
              (This is understandable - the system will store value like 'CZ/Prague' or '1/2' and now such value exists in any column)

              b) CityView for Level1
              This even auto-selected the relationship for me, lets me to save my configuration, but when I open the definition, the relationship field is blank (!!!) again, and indeed, the system does not use the relationship.

              Besides, b) is not exactly a tree, is it?

              So, I conclude, the OOTB Tree-like fields cannot be made dependent.
              • 4. Re: Tree metadata dependent field
                I've made the same conclusion...so I think it's a kind of bug, or maybe the "is dependent field" shouldn't be enabled when you use a tree-like field.

                Now, I'm thinking in doing some kind of customization...like changing the Root for the tree dynamically. Do you know if I can pass this as a paramenter on the service call? Or change the template SCHEMA_BROWSE_POPUP?

                • 5. Re: Tree metadata dependent field
                  Sounds like a client-side customization to me, so, it will be some Javascript...
                  1 person found this helpful