How would I check to see if my SKU text field is unique and that no other values SKU of that value is in the table?
Hi there,
I have a table called Product with a Text Field called SKU how would i check that the value of the new or updated SKU is unique and does not already exist within the table?
On a second note would there be anyway of randomly generating an SKU of six digits i.e 123456 that odes not already exist in the SKU field?
Any help appreciated
Regards
Paul
4 replies
-
One simple way to check for duplicates (formula field)
let d := SKU;
cnt((select Product where SKU = d).SKU)
Where the result is 2 it's double...
-
Many thanks Nick I will give it a try.
-
I have used the following code in both trigger on create and update but no warning is displayed, is there something i am doing wrong?
let d := SKU;
let countSKU := cnt((select Product where SKU = d).SKU);
if countSKU > 1 then alert("Duplicate!") end
Content aside
- 5 yrs agoLast active
- 4Replies
- 2070Views