The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Calculate next id for chosen catagory // Setting property values on metadata card BEFORE SAVING - but as a reaction to an ON-CHANGE EVENT of an other property

Original use case:

Creating a continuously numbered list of hierarchical topic entries (here: QM document categories according to a common process structure). This use case could be used also for other topic and also for non-hierarchially structures.

Sample: QMS system uses sequences for numbering SOP documents by category. BUT this is based on alphanumeric sequences where the order without leading zeros would be 1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9 - instead of 10 and 11 at the end.

I would like to solve it by using logic with will determing the value of the counter property if category property changes, e.g. like this:

- find entry having the chosen category with the highest counter value, like: SELECT MAX(ID) FROM CUSTOMER WHERE TYPE = 'Millionaire' AND GUID <> {ownGuid}

- if not entry exists then 1 will be used as counter value for the new object - otherwise the formelry max value + 1

- OLD: value will be updated while saving the entry

- NEW: value will be put into ID field if onChange event of the category will be fired

- 1st Advatange: user will see it immediately and don't has to wait until saving is completed and entry has been reloaded.

- 2nd Avantage:: user can change value before saving - e.g. if he wants to skip some numbers for later use or fill the gaps which may exist between the numbers

Reacing on onChange event is a really common feature in every software except CLI / powershell based perhapts :)

If you create an order and change the amount of units then the users are used to the autocalculation of total price etc.

Possible solution:

You can specify an IML which reacts on change of a property - but IML is just fake in my case and the value should be filled in immerdiately if needed as setting. Suggestion is only senseful if you can be sure by software / AI logic and letting the suer choose the best value.

Btw.: Do you have  a current example for that? I didn't even find an example for standard IML logic -  which existed already - unsure abort the time: some weeks ago perhaps.

Parents
  • Unfortunately there are no UIX events fired that allow third parties to react when values in the metadata card change.  The only option is metadata card configuration, but that does not provide the depth that you need in this instance.

  • Perhaps a good feature request?

    IML can be called due to onChange events which can be configured in meta data card configuration - so it should be possible to add an input field which custom event of which VAF should be invoked with a defined JSON structured object - or define an own event like StateAction etc.

Reply
  • Perhaps a good feature request?

    IML can be called due to onChange events which can be configured in meta data card configuration - so it should be possible to add an input field which custom event of which VAF should be invoked with a defined JSON structured object - or define an own event like StateAction etc.

Children