model condition issue: field value in another model not updating

  • 2
  • Problem
  • Updated 4 years ago
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Pat,

I've experienced the same behavior. As a work around, I change the condition to single (or multiple) specified value(s), and then use Activate and Set before the query. Not sure if that will work in your use case.
(Edited)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I wish I could set a dynamic set of multiple values for the condition, but alas I the option is not possible.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Pat,

I'm pretty sure that you can pass your values into a string with semicolons between, and it will work. Something like this:

conditionValue = 'value1;value2;value3;'
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
The problem is that these need to be based on what is in another model. These are to be the Opp Id's.

I'm sure I can make this work in javascript, but I'm not certain it's necessary to do so. I think that the current should work "out of the box".

I don't want to say to the client that I need to charge additional time for something I think should work. I hate putting together a work around at the clients expense.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Yep. I'm with you there.

Not that I have clients... I'm just working on the same massive implementation for the non-profit I work for.
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Unfortunately as things stand right now, the referenced model must be queried in the same transaction as the dependent model.  In your case, this would cause an infinite loop.  The workaround for now would be to manually set the condition values with Javascript.

I'm hoping we can move to having Skuid take care of this for you, or have some way of preventing the infinite loop.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
My beef is that the Opportunity model has the ID's but there aren't being used dynamically.

My beef is that Opportunity__c is a value I'm checking to see matches the ID field in the opps model. There is no need to go to the server for these. Why can't we set the condition and evaluate based on what's in the opps model when querying the related model? Why is it that querying the models together or separately makes a difference? It's as if the list of opp ID's on the related table is only updated on page load and when the two models are queried together.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Can you convert this to an idea? 
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Good news! it's already fixed in the next major release.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Sweet.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Sweet!!! Really really looking forward to that. This is my one big gripe on the model conditions.