You can use an OnObjectSave(or Exit)[you can even use on OnObjectModify as you are using a popup/dropdown list] script trigger to Set Field for the Subcategory field to "" You could even add a Show Custom Dialog box with a single button reminding them to set a new subcategory.
You could encapsulate this logic in an If script step to check to see a subcategory had already been selected so that it doesnt do anything if it hasnt been set.
You could then setup validation rules to ensure that a new value is entered into the field.
A simple script performed via an OnObjectModify script trigger set up on the Category Pop up menu should do the trick:
Set Field [Product::SubCategory ; "" ]
This can also be made selective so that the field is cleared only if the current value is not a member of the current subCategory value list:
Set Field [ Product::SubCategory ; If ( IsEmpty ( FilterValues ( ValueListItems ( get ( FileName ) ; "SubCategory value list name in quotes" ) ; Product::Subcategory ) ) ; "" ; Product::SubCategory ) ]
Thanks for your fast replies, it works like expected.
I'm trying to do the same thing as far as categories, and I have a working system, it just doesn't seem to be very elegant, if anyone wanted to comment on this I would appreciate it... I definitely follow along with the OP as far as needing another table occurance to filter the sub category value list (devices for value list) when adding new device (product).
However, my question is then how do you choose a product (device in my case) from another table, in my case signals. So I'm on a Signal layout, I have popup menues for category, sub category and device with value lists of sub categories and devices populated as seen from the signal table occurances, is this the simplist method? It seems like a lot of extra table occurances and I don't know if it costs anything in database size or processing. Many thanks in advance,