Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Show Value Vist based upon a Condition


mkohler28

Recommended Posts

I have three value lists which are all showing data related to the previous list. What I'm trying to do is if a previous value list is empty then show all records, but currently the it shows no data because of the relationship. Before I build a script to perform a complex action, is there anyway this can be done using a different relationship technique?

 

Example

 

-ContactGroup

--ContactID

---Contact

Link to comment
Share on other sites

Do you mean to say that you've got a conditional value list, where Value List 2 which is attached to Field B shows related values only based on what you put in Field A? And that you wish to have all values show instead of related values only if you leave Field A blank?

 

Create calc field, call it "ValueListDriver:", result type text, unstored, Case (isempty (Field A), "tuvwxyz", ValueListItems(get(FileName), "YourFirstFieldValueListName"))

 

Create calc field in table that your current value list of related values draws its values from. Let's say the relationship used in "related values" for that value list is a relationship that links current table to the other table via a field name "Field X" in the foreign table. Create calc field, result type text, stored, defined as: Field X & "¶" & "tuvwxyz"

 

Relate the first calc field to the second calc field. Use related values only via that relationship, not the original relationship you were using. If there's something in Field A, you're effectively showing related values only based on Field A = ForeignTable::Field X. If, on the other hand, Field A is empty, you're effectively getting all values by way of getting "tuvwxyz" = ForeignTable::(all records also have "tuvwxyz").

 

You don't have to use "tuvwxyz" of course but use some string your'e not going to encounter as an actual field value of Field A.

Link to comment
Share on other sites

I tried this and I am getting strange results in Field B, when Field A is blank no problems it shows all values, but when there is a value in Field A then the Field B value list shows all values where Field X is present but not by the relationship.

 

So I have 10 records in the source file, out of the 10, 3 records have group ID "123" and 3 have group ID "XYZ", the remainder 4 records have no group ID.

 

In my data file when I choose group ID "123" (in Field A) I get all the related values for group "123" but also all the values for "XYZ" (in Field B Value List).

Link to comment
Share on other sites

When you do indeed have something in Field A, are you getting the same unabridged show-everything value list for Field B as when Field A is empty?

Link to comment
Share on other sites

Nope, when there's something in Field A, Field B value list displays only the values where Field A is not empty, but shows all values related to a non-empty field rather than the field value instead. Just like my example if I choose "123" in Field A, I don't get just values ralted to "123" I get "123" and "XYZ" values in the same list.

Link to comment
Share on other sites

Change your field definition for the calc field "ValueListDriver" that I had you create, to this:

 

Case (isempty (Field A), "tuvwxyz", Field A)

 

 

Sorry about that.

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use