I have…
- [x] Read the following guideline: https://docs.squidex.io/01-getting-started/installation/troubleshooting-and-support. I understand that my support request might get deleted if I do not follow the guideline.
I’m submitting a…
- [ ] Regression (a behavior that stopped working in a new release)
- [ ] Bug report
- [ ] Performance issue
- [x] Documentation issue or request
Current behavior
I need to have a unicity check for the combined value of 2 fields. E.g. field1 and field2. The combination should be unique.
To achieve this i’ve added a third field (field3) which is configured to be unique. I use a script to fill field3 on add/change edit.
The script works and properly fills field3. Only the unicity check is wrong. When i add a duplicatie value i can save this item without a problem. The correct (and duplicate) field3 is generated and saved. The second time i save this record i do get the error message that this field should be unique.
The docs state that the check on e.g. unique values is after running the script (see: https://docs.squidex.io/02-documentation/developer-guides/scripting). But this behaviour seems to indicate that this check is done before running this script.
Expected behavior
I would expect this check to run after updating conting using a script.
Minimal reproduction of the problem
- Create new schema with field1, field2, field3
- Configure field3 to be unique
- Add script that updates field3 with the value of field1+field2
- Add 1 content item with a chosen content for field1, field2. Should store properly
- Add new content item with same value for field1 and field2. Stores item without error
- Try to save the second content item. Gives validation error on duplicate items.
Environment
App Name:
- [ ] Self hosted with docker
- [x] Self hosted with IIS
- [ ] Self hosted with other version
- [ ] Cloud version
Version: 6.4.0
Browser:
- [x] Chrome (desktop)
- [ ] Chrome (Android)
- [ ] Chrome (iOS)
- [ ] Firefox
- [ ] Safari (desktop)
- [ ] Safari (iOS)
- [ ] IE
- [ ] Edge
Others:
Any clue what’s happening here? Or other way to solve this problem?