How to update keyed_name of relationship item reliable after new related item was added?

Hi community,

I have a custom Document item type that is connected to the regular Part like this:

Part  (Source ItemType)
- MyPartDoc  (Relationship ItemType)
--- MyDocument    (Related ItemType)

It´s important for me that keyed_name of "MyPartDoc" relationship item is set to the Document number of "MyDocument".

To achieve this, I use "Keyed Name Order =1" for the property "related_id" in ItemType "MyPartDoc"

Problem: In my case the keyed_name is not set reliable. When user add Documents to Parts, the keyed_name property isn´t set to the correct Document item_number. Most of the time the Document id is used.
But soometimes the keyed_name is set correct. But I so far haven´t figured out the reason.

When I take a look at Relationship ItemType "MyPartDoc", I get a list where both variants are used in a obscure mix:

So sometimes the keyed_name seems to be set correct. 

In my Innovator 12SP7 the former Action to rebuild the keyed_name is no longer available. And the keyed_names are not updated when I save the ItemType.

Does anyone have an idea how to set the keyed_name more reliable?

Thanks for any hint!

Best regards

Angela

Parents
  • I don't know where it is located and what the code looks like that updates the keyed_name according to the Keyed Name Order. At least I did not find anything similar among the SQL stored procedures. I think that this code has nowhere to take information but only from the AML request passed to it.

    It can receive AML like this from the browser for example

    <Item type='Part' action='update' id='AAA...AAA'>
      <Relationships>
        <Item action='add' type='MyPartDoc'>
           <related_id keyed_name="DOC-100001" type="MyDocument">
              <Item type="MyDocument" typeId="BBB...BBB" id="CCC...CCC">
                <config_id keyed_name="DOC-100001" type="MyDocument">CCC...CCC</config_id>
                ...
              </Item>
          </related_id>
        </Item>
      </Relationships>
    </Item>

    or something like this generated by code

    <Item type='Part' action='update' id='AAA...AAA'>
      <Relationships>
        <Item action='add' type='MyPartDoc'>
           <related_id>CCC...CCC</related_id>
        </Item>
      </Relationships>
    </Item>

    Both variants are valid and will work. Maybe in the first case this code can fill MyPartDoc keyed_name with the MyDocument keyed_name and in the second it can't.

  • 0 オフライン in reply to alaxala

    Hmm.. But after I EDIT exisiting relationship

    <Item type='Part' action='update' id='AAA...AAA'>
      <Relationships>
        <Item action='edit' type='MyPartDoc'>
           <related_id>DDD...DDD</related_id>
        </Item>
      </Relationships>
    </Item>

    the keyed_name became correct.

    I don't know how useful this information is, but for some reason that's how it works

Reply Children
No Data