Ok, admittedly this one probably wouldn’t be used much but I actually have a specific need for this currently and the solution I’ve come up with just doesn’t scream “obvious to the untrained eye.”
Would be great to be able to define a condition on a model that evaluates a dynamic value against something other than a field value.
Here’s my current use case:
I have a page that has 3 models. On clone, I only want to clone Model #1 & Model #2. This works perfectly by setting those models to ‘yes, if clone parameter is specified in URL’. However, for Model #3, not only do I not want it cloned but I don’t want it populated at all. My page handles New & Existing records so even if I set Model #3 to clone = ‘no’, the model contains the records of the id in the url parameter.
Ask:
Add the ability to specify a condition where the “left side” of the operation can be something other than a model field (e.g. Param value). If this existed, I set Model #3 to “clone=no” and include a condition where “Clone in URL parameter is blank”. This would give me a cloned #1 & #2 and an empty #3.
Current Workaround
Define a condition on Model #3 evaluating against "Id’ field using the URL Parameter “clone” and deactivating condition if parameter doesn’t exist. When “clone” is in URL, this will result in the where clause evaluating "Id = ‘clone’) which will return no results and an empty model.
Thanks!
Model Condition Enhancement - Condition on something other than field value
This topic has been closed for replies.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.