i have a form and i want to check if the item selected on the dropdown already exist in the database.
I have a dorpdown on the form:
I want to check if the selected option (= UserId) already exist in the table CaseConsultant:
so the userId is the selected option on the dropdown. CaseConsultant is a association class. So there can be multiple users on 1 specific CaseConsultant, however duplicate user must not be possible
Hi sam, You can create a server action that takes UserId and CaseId as input, and inside the action, add an aggregate that fetches data from CaseConsultant with filters on UserId and CaseId. If the result is empty, that means they don't already exist, which you can set as the output. Use this function to check before creating or updating a record in the database, or you can call it in the OnChange event of the dropdown.Also for safety you should create a unique index with UserId and CaseId together so there can't be a duplicate entry.ThanksGitansh Anand