Jump to content
Sign in to follow this  
Enigma20xx

Multi-criteria relationship. Calc field involved.

Recommended Posts

Using a multi-criteria relationship I want to accomplish a conditional value list.

 

pk_ID (not equal) fk_ID

cTotalAmount (greater) gZero

 

but as cTotalAmount is a calculation field it doesn’t work properly.

 

I’ve tried with a calculated numeric field (=cTotalAmount), but this doesn’t updates automatically as a calculated field.

 

Any suggestion?

Share this post


Link to post
Share on other sites

How often does the calculation change?

Could you run a scheduled script to populate the field every hour / whenever?

Share this post


Link to post
Share on other sites

pk_ID (not equal) fk_ID

cTotalAmount (greater) gZero

 

Your explanation is not clear, esp. the context. Please name the tables involved and explain [a] which table is supposed to be the source for the value list, and how exactly are the matchfields defined - for example, is gZero a global field?

 

 

 

How often does the calculation change?

Could you run a scheduled script to populate the field every hour / whenever?

 

That's not a good idea: you want your data to be correct at all times - not just on the hour or "whenever".

  • Like 1

Share this post


Link to post
Share on other sites

 

 

That's not a good idea: you want your data to be correct at all times - not just on the hour or "whenever".

That makes sense.

Would it still be a bad idea if the script was triggered whenever the relative record or field was updated?

 

It will be interesting to see how this relationship is going to be used!

Share this post


Link to post
Share on other sites

Would it still be a bad idea if the script was triggered whenever the relative record or field was updated?

 

It depends on whom you ask. I would rather not depend on a script trigger (i.e. a layout-level device), if the data can be made to self-organize using calculations and relationships (i.e. data-level devices). But Wim's answer may be different ...

 

And, after all, a conditional value list is a layout device itself - so this may work even if the field is updated by the action of the user wishing to use the value list, just before doing so. However, you must also consider the possibility of record locking by other users.

  • Like 1

Share this post


Link to post
Share on other sites

As my ability to explain myself (only in English :yep:) is quite bad, using the some of the Estimates starter solution structure, I’ve made a sample file to try to throw some light on it.

 

The example goes about people and their bets.

 

My goal is to make a value list that shows only Bettors with balance enough to bet, then, only the ones that are not already betting.

 

But writing this down I realized that there’s another problem.

 

At first, Bettors can have a positive balance (so the VL will show them), but the amount they have to face, depends on the number of bettors, so that positive balance could not be enough to cover the bet :shocked: , and this could become a vicious circle :logik: .

 

Thanks for all your answers.

BetsDB.zip

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Jonathan Myrah
      After completing an initial sync to my test iPad (starting with an empty clone) none of my value lists that reference fields are working. Instead I get a message saying "No Matches Found". Value lists with custom values still work.
      According to the email I received after the sync completed, all of the records required for the values lists were successfully synced.
      Has anyone seen this before?
    • By Ponderosa
      Totally not sure if I've put this thread in the right topic category, as I'm not even sure how to go about this. First, I'd like to be very clear on the fact that, if possible, this will be done without scripting. I'm hoping for some kind of calculation. IDK. Anyway, I'm trying to copy or Calc one field from an older record to its newest match (using BatchNum field to match). The two fields are different fields (FormNum is the ID number field) (RefID is the the reference field for FormNum ). RefID would allow the user to find the last time the same arrangement of data (FormNum being its ID number) was used. It's meant as sort of a skipping stone effect, if that makes sense.
      My thought was to create a filtered value list of some kind and just set RefID with the highest ID number from FormNum, prior to the newest entry. Or organize by newest Date Created, prior to the newest entry. Again, IDK.
      I'm quite stumped and hope this rambling makes sense to you very helpful people. Thanking you in advance....
    • By Lea Alexander
      I have 3 tables: Person, Session, and Contract where Contract is a join table.  
      I am in the Session table layout, in a Contract portal.  I have a field – Trainer Name in the Contract table – where I want to select the name of a person from a list of people in the Person table.  The Trainer Name field is a dropdown list using values from the Trainer value list “Person::__k_p_Person and Person::Name_Full”. I have tried numerous configurations with table instances and I either cannot alter the Trainer Name field at all, or I get a “?”.  
      After the Contract record is created, I want it to show up in a Contract portal on the person’s record in the Person table.  
      Each person will teach multiple sessions.
      Each session has multiple trainers.
      I have foreign keys in the Contract table for Person and Session. 
       
       


    • By iroc_mxrider
      Hello,
      Full disclosure: I am very new to scripting in FM.
      I am trying to hide an object based on 2 criteria:
      Leads::IsOnlineProposal = "No" and PatternCount (  $$Permissions ; "ViewOnlineProposal" ) = 0
      When the Value for Leads::IsOnlineProposal is "Yes" I wanted my object ( just a big square to hide the customer data on the screen ) to hide everything on the screen. That part works great. But I wanted to give some users permission to still view the customer info ( or continue hiding the object ) when the permission is checked even if the value for Leads::IsOnlineProposal = "Yes". Thus the second part of the hide scripting in the hide section of the inspector. I cannot seem to figure out what to input into inspector to achieve this. Can anybody point me in the right direction? Any help is much appreciated. Hope it all makes sense! Thank you in advance, sorry if I posted in the wrong section!
    • By sal88
      Hi all
      I've created a value list that serves as an email autocomplete drop down (like the sort in an email client). This VL looks to a single text field in a single record table which currently has 3000 lines. The field is updated every 15 minutes by a scheduled server script.
      The 'auto complete using value list' option is applied on the field that refers to this VL.
      The old method was to not have a VL but to just tick the 'auto complete using existing values' option on the field. This was not ideal because existing values might be incorrectly spelled email addresses (and the user would not be able to remove them).
      Since switching to the new method it is slower to retrieve the values from the VL. It is not the type of slowness that locks up filemake; rather it just means the user has to wait 1-4 seconds for values to pop up when letters are typed - before this is was instant in the way it is instant in normal email clients.
      Does anyone have any ideas as to how to speed it up? Or whether this is expected from a single field VL?
       
      Thanks
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.