Hi
I have say 10 items in a record and if in any one row the value in U_Item = 'MT' then all 10 items must hace "MT" in u_item else it should not allow to save record.
Thanks
Hi
I have say 10 items in a record and if in any one row the value in U_Item = 'MT' then all 10 items must hace "MT" in u_item else it should not allow to save record.
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Eliana BlakePosted Mar 16, 2025, 6:11 AM
It sounds like you are looking to enforce a validation rule in a record where if one item has a certain value, all items must have the same value. This can be achieved through validation logic in your application or database.
For example, if you are working with a database system like SQL, you can define a validation trigger or constraint that checks if the condition is met before allowing the record to be saved. Here is a simple pseudo-code representation of such a validation logic:
In this trigger, before inserting a new record into `YourTable`, it checks if `U_Item` is 'MT'. If it is, then it verifies that all Item fields (Item1 through Item10) also have the value 'MT'. If any Item field does not have 'MT', the trigger raises an error preventing the record from being saved.
This is just a simplified example, and the actual implementation may vary based on your specific database system and requirements. If you are working in a different environment or with specific software, let me know so I can provide more targeted guidance.