web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

OnDelete property in foreign key relation not working as expected

(1) ShareShare
ReportReport
Posted on by 54
Hello,
 
I have a requirement to create table for Ledger allocation group and group name is a private Index here. Then, created the LedgerAllocationGroupName field in the LedgerAllocationRule Table and its lookup field, allowing selection of records from the LedgerAllocationGroup table. If I delete the records in the Ledger Allocation group table, it should not allow it if there are related records in the Ledger Allocation Rule table.
 
Have created the foreign key relation in the Ledger Allocation Rule table and added the ondelete to restricted. I used the foreign key as groupname . but Its not restricting the deletion still allowing.
 
Simple one but it is not working tried multiple ways. Any one have idea or suggestion on this?
 
I have the same question (0)
  • Layan Jwei Profile Picture
    8,097 Super User 2025 Season 2 on at
    Hi,
     
    I think it's because the relation is not based on the unique index which is groupId. If it was groupId then it would have worked.
    Why did u do it on group name?
  • SC-25021032-0 Profile Picture
    54 on at
    Sorry I mentioned wrongly in post . group name is unique index and relation also created with group name only
  • Layan Jwei Profile Picture
    8,097 Super User 2025 Season 2 on at
    Ok, so just to make sure
     
    You added the relation on the child table(not parent) and you put the onDelete property as restricted on that relation
     
    Did you sync?
  • SC-25021032-0 Profile Picture
    54 on at
    yes. I did .But i dont see any FK created in SQL table.
     
     
    Also i tried to create delete action also in parent table that is also not working and it is allowing to delete even after adding delete action.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans