Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Index for checkbox with empty value

(0) ShareShare
ReportReport
Posted on by 250

Hi guys,

I have a table which allows multiple Items, but only one record can be primary.

I created an index which consist in Item and PrimaryItem field. However, the PrimaryItem field is a checkbox, and even when the value is No 

it will trigger preventing the user to create a new record. Only one Primary Item field can exist.

How can I accomplish this? Is it validatedWrite() the only way? 


Example:

Table

ItemId | Info1 | Info2 | PrimaryItem (Checkbox No::Yes)
Item1  | info   | info    | Yes

Item 1 | info   | info    | No

Item 1 | info   | info    | No

  • Verified answer
    MuthukumaranAX Profile Picture
    MuthukumaranAX 2,901 on at
    RE: Index for checkbox with empty value

    Hi - adding field to index which has default value (in your scenario No) is not suggested, but it is requirements then you can achieve this through  validatewrite method

    Thanks

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Index for checkbox with empty value

    Hi bois0155,

    Yes. Modifying validateWrite looks like the only way out here. You can't create an index using any of the fields to achieve this requirement.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans