Hi,
I am having an alternate key with a combination of two fields.Its working fine.If i am getting unique combination each time, record is created else duplicate doesn't get create.
But, if one of the field is empty , then duplicates are getting created.So, how can i have a check that if that particular field is null, then the other field act as an alternate key..Is this possible?
Thanks
*This post is locked for comments
Here is the link for exception handling
Thanks for the replies..One more help required..
If i am using Alternate Keys, based on that i am creating a record like-:
id = service.Create(entity);
once this record is created, next time if it finds same pair of attribute values , exception is thrown..How to catch that exception using C# code?
Hi,
When you define multiple keys in entity , its basally works internally checking AND condition in background.Null value can not consider in the key to validate. The key will work or consider only when you set the value to the field. So using key its not possible,
You can implement custom rule using plugin.
Its not possible OOB. To make it work, instead of null always assign some default value to the field.
Hi,
I don't think it is possible with alternate keys. Is it possible for you to atlease have some default value in that field?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156