Community

Connect with us and enhance your M-Files experience using Unitfly Toolkit for M-Files. Here’s how to get started.

Notifications
Clear all

Related Object on Metadata Card

1
Topic starter

Hello,

I'm trying to configure Property Operations to update a Related Object metadata card to reference the source object.

 

Example: On Object A metadata card we have a property that is a value list for Object B.  When filling out that property we would like the metadata card on Object B to automatically fill out the property that is pointing back to Object A.  This would be similar to Managed Properties in the Compliance Kit.

 

So far what I have that is kind of working is this.

image

The issue that I'm having is if I delete out the property on Object A it doesn't deleted out the other property in Object B.  This would be if we had a mistake and deleted out that property then we wouldn't want them attached anymore.

Not sure if the Dynamic Value is what's causing the issue.  I'm not sure what other value to put in.

Hopefully this kind of makes sense.

 

Thanks

 

Jeff 

5 Answers
0

@jwittkopf 

Hello Jeff,

 

your question makes a lot of sense 🙂

 

For a use case like this, I would like to recommend using 2 different rules:

1. Rule will be just like yours, but just with added filter where the monitored property is not empty

image

In your case, it would be "Attached Agronomy Invoices" is not empty

2. Rule would be set up to delete the value of the property "Choose Object A"  from your "Object B".

You can find "Object B" using the INDIRECT reference direction. The "Indirect" reference direction is searching for object that are referencing your source object.

image

 

I hope I explained it well.

Please feel free to ask if the explanation was not fully clear.

jwittkopf Topic starter 16/11/2023 10:01 pm

@viktorzagajski Thanks for the write up Viktor.  I might be doing something wrong though. I have tried multiple combinations to try getting it to work but I'm sure I'm missing something simple.

 

I have Rule 1 setup like I posted before which works great.  I then created Rule 2 from what you posted.  This is what the settings are looking like.  Object A would be the class Agronomy Payables and Object B would be Agronomy BOL class.

 

image

 

The Attached Agronomy Invoices property is on the Agronomy BOL class that points to the Agronomy Payables class for documents.  

 

Hopefully I'm just missing an option or a configuration somewhere.  

 

Thanks for you help!

0

@jwittkopf

First step would be to add filter "Attached Agronomy BOL is not empty" on your first rule.

For the second rule, you need to set Target > Reference as "Attached Agronomy Invoices" and then again use this property in Target > Properties > "Attached Agronomy Invoices"

 

So the logic for the second rule (if we have Object A and Object B) would be:

"Find an object that has the indirect reference to trigger source".

The rule is then searching for other objects in the vault that are referencing the trigger source "Object A" via the property "Choose Object A" and then on that found object (Object B) remove the value from that same property you used for finding the other object (Choose Object A).

 

I hope I explained it better this time.

jwittkopf Topic starter 22/11/2023 5:30 pm

@viktorzagajski I'm finally getting back to this project. 

Here is what I have for Rule 1.

image

And here is Rule 2 which should delete the Attached Agronomy Invoices on the Agronomy BOL class if the Attached Agronomy BOL was deleted off the Agronomy Invoices class.

image

I'm sure I'm missing something simple as I try to understand some of the logic of extension kits.  It seems like a pretty powerful tool with all the option.

Thanks for the help.

0

Hey @jwittkopf,

can you please tell me is the "Attached Agronomy BOL" multi-select or just a single value drop-down? And how did you test it?

Firstly, can you please deleted the "Monitored properties" conditions from the rule?

          - the easiest way to delete something from the configuration is to right-click on the line and select "Remove Value"

image

 Secondly, can you please create the rules from scratch? If you change a configuration a lot and do not use "Remove Value" some of the older configuration can be saved in the background (in the "Advanced" tab JSON)

If that does not help, the last resort would be to try to debug it using verbose logs 🙂 

 

jwittkopf Topic starter 22/11/2023 6:41 pm

@viktorzagajski "Attached Agronomy BOL" is a multi-select property.

 

I deleted out the "Monitored Properties" from both rules.

 

How I'm testing is on the Agronomy Invoice(Payables) class I have a Attached Agronomy BOL property where I'm either adding the Agronomy BOL class which when adding it works, it just takes a few seconds to update the Agronomy BOL class to attach the Agronomy Invoices, but when I delete out that field to blank it out then that is when it won't go on the Agronomy BOL class to take out the Attached Agronomy Invoice field.

 

This is the property on the Agronomy Invoice(Payables)

image

This is the property on the Agronomy BOL class

image

Maybe it is the multi-select that is messing with this?

0

@jwittkopf,

Multi-select should not mess with the execution. Also, everything from the rules seems fine.

Can you please send me the full configuration of the rules (in JSON format)?

And also, please send me the verbose logs from when you executed the rules and they did not work.

 

 

jwittkopf Topic starter 27/11/2023 5:52 pm

@viktorzagajski Well, this is embarrassing.  It is working now.  For some reason I had the module disabled which I probably had my production vault and test vault switched around for a little bit.

Another question, what would be the best way to reverse this process?  Say they want to edit Object B and either add Object A in the drop down and have it attach the Object A metadata card?  Pretty much the same setup but reverse on what action starts the process.  Would that be just adding two more rules and just reverse the properties around or would that impact the original rules?  Not sure if that could cause a loop or if there is a setting in the original two rules?

0

@jwittkopf, since the reversed process would be triggered from the different object, you would need new rules with the same logic for other object.

I would just recommend to restrict rule triggering with monitored properties and search filters as much as possible. To avoid looping.

Answer

WATCH THE WEBINAR

Introducing AI Document Kit: Add-on for AI-driven Document Management