related list edit button is not showing correct slushbucket

runtianliu
Kilo Explorer

I have two tables let's say A and B. There is a ralationship table C. A and B is many to many relationship.

I have a related list of B under A's form. But there is no edit button for this related list so I clicked the enable edit. After I clicked the enable edit button, the edit button shows up. However, the slushbucket in the list is not correct. It's showing all the records in table C. I want records from table B actually. How can I fix this?

1 ACCEPTED SOLUTION

Zach Biewend1
Giga Expert

I ran into the exact same issue. I wanted a clean, intuitive solution for my end users. After I created my own many-to-many table and tried creating a custom 'edit' UI action (unsuccessfully) I found this:



http://wiki.servicenow.com/index.php?title=Creating_a_Many-to-Many_Relationship#gsc.tab=0



This is out-of-box functionality and it does all the work for you. You add a 'to' and 'from' table and customize the labels, and the system does all the rest. You need to add a related list (has the same name as the label you assigned, not the '>' separated names that most related lists have) and the Edit button is there. It will open a slushbucket of the A or B records, and the C record is created behind the curtains.



Hope this helps! Took me about a day of dev to stumble across it.


View solution in original post

6 REPLIES 6

bcronrath
Kilo Guru

Greetings,



What does your scripts for relation look like?   For reference:   http://wiki.servicenow.com/index.php?title=Creating_Defined_Related_Lists#Notes_and_Limitations



It sounds like you just need to make sure your script is using the lookup table C just as logic to pull the end result out of table B.



Best regards,


Brian


Zach Biewend1
Giga Expert

I ran into the exact same issue. I wanted a clean, intuitive solution for my end users. After I created my own many-to-many table and tried creating a custom 'edit' UI action (unsuccessfully) I found this:



http://wiki.servicenow.com/index.php?title=Creating_a_Many-to-Many_Relationship#gsc.tab=0



This is out-of-box functionality and it does all the work for you. You add a 'to' and 'from' table and customize the labels, and the system does all the rest. You need to add a related list (has the same name as the label you assigned, not the '>' separated names that most related lists have) and the Edit button is there. It will open a slushbucket of the A or B records, and the C record is created behind the curtains.



Hope this helps! Took me about a day of dev to stumble across it.


Hi Zachary,



Thank you very much for your answer. It really helped a lot. The problem is fixed.



Thanks,


Runtian


Mudabir
Tera Contributor

@Zach Biewend1  The shared link does not work anymore. Would you be able to explain it?