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.

  • Ok - I also don't know what would be the best solution regarding all perspectives - I just can throw my ideas here and hope that some of them are useful to make M-Files better Slight smile

    Perhaps it's a general idea to allow UIX technology also to snap into the standard metadata card - e.g. for inluding onChange logic or include an explanation between the fields or include a table with a list of position data or to use own input components for some special fields where JavaScript allows a lot.

    Of course, it would be some kind of risky but changing server logic via VAF is also within the responsibility of the implementing system partner or add-on vendor.

    An orientation could be the Microsoft AddIn policies where also add-ins are possible which change UI-logic.

  • Hi Falk and Craig,

    I agree completely with Falk. I have already stumbled on many use cases where having OnChange event would be very usuful. I have then ended up implementing solution in VAF where whole metadata card must to get reloaded. It works but it is definitely not any more state-of-the-art.

    I think it would be worth investing into improving UIX framework and enabling easier integrations for developers. I really appreciate M-Files API and VAF but miss often features and depth on UIX framework (also often unstandardized JavaScript functions, missing hookup events). We usually use it for client-side validations (to give users better look&feel even though pop-up validations are really not user-friendly, inline errors would be much better), disabling certain features. We have also tried to implement our own web based metadata card but came to the limit when we have started to deal with permissions (missing/limited APIs in this area).

    Long story short, I believe it would be worth improving/re-architecting UIX framework if possible.

    Dejan

Reply
  • Hi Falk and Craig,

    I agree completely with Falk. I have already stumbled on many use cases where having OnChange event would be very usuful. I have then ended up implementing solution in VAF where whole metadata card must to get reloaded. It works but it is definitely not any more state-of-the-art.

    I think it would be worth investing into improving UIX framework and enabling easier integrations for developers. I really appreciate M-Files API and VAF but miss often features and depth on UIX framework (also often unstandardized JavaScript functions, missing hookup events). We usually use it for client-side validations (to give users better look&feel even though pop-up validations are really not user-friendly, inline errors would be much better), disabling certain features. We have also tried to implement our own web based metadata card but came to the limit when we have started to deal with permissions (missing/limited APIs in this area).

    Long story short, I believe it would be worth improving/re-architecting UIX framework if possible.

    Dejan

Children
  • Hi both,

    We do constantly evolve the UIX but, as yet, unfortunately, this feature has not been able to be implemented. 

    The next big update to the UIX focuses on its long-term compatibility with the New Web interface.

    Your comments are well taken but, unfortunately, I don't have anything specific that I can promise around it.

    Regards,

    Craig.