- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 03:03 PM
I know this question has been asked before but I couldn't find a solution. Is it possible to create a many to many definition on the same table? When I try, I get the error "M2M from field and M2M to field must be different". Changing the field names doesn't create a correct many to many table. Thanks for any help with this.
Christine
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 01:30 PM
Thank you.
I was eventually able to do this by creating a list field and related list relationship by following the steps here: https://www.servicenow.com/community/itsm-forum/many-to-many-on-same-table/m-p/440044
And then creating a database view using the list field by following the steps here: https://www.servicenow.com/community/developer-forum/database-view-with-list-field/m-p/2432202
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 03:27 PM
Hi @Christine30,
Unfortunately, it's not possible using the same table.
Using the same table we can only configure parent/child type relationship.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 03:29 PM
Thanks. Can you suggest any sort of work around? On a custom table, we have current year records that point to many prior year records, and vice versa.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 04:22 PM
As per my understanding, if current year records are pointing to previous year records then there must be column which have this reference data ( same like parent column in many table , task or Group ).
For reporting purpose, you can create a database view on this custom table, use the same table twice with different prefix and use the matching condition to get desire data, not sure about your data model but you can try with DB view.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 01:30 PM
Thank you.
I was eventually able to do this by creating a list field and related list relationship by following the steps here: https://www.servicenow.com/community/itsm-forum/many-to-many-on-same-table/m-p/440044
And then creating a database view using the list field by following the steps here: https://www.servicenow.com/community/developer-forum/database-view-with-list-field/m-p/2432202