5 Replies Latest reply: Mar 1, 2013 6:25 AM by Jiri.Machotka-Oracle RSS

    Tree metadata dependent field

    hfolguera
      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:
      +Department1
      --Area1_1
      --Area1_2
      ----Area1_2_1
      ----Area1_2_2
      +Department2
      --Area2_1
      ----Area2_1_1

      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!

      hfolguera.
        • 1. Re: Tree metadata dependent field
          Jiri.Machotka-Oracle
          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
            hfolguera
            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.

            hfolguera
            • 3. Re: Tree metadata dependent field
              Jiri.Machotka-Oracle
              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
                hfolguera
                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?

                hfolguera
                • 5. Re: Tree metadata dependent field
                  Jiri.Machotka-Oracle
                  Sounds like a client-side customization to me, so, it will be some Javascript...