- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2017 10:58 AM
Hi all,
we have an issue with the Edit Button in a Related List.
First of all, I have to describe you the situation as it is.
We have two custom tables, table Component and table Blueprint. In the form of the Component we have a List Field with the blueprints that are associated to that Component. In the form of the Blueprint, we have a Related List of the components that are associated to that Blueprint. When we are on the form of the Blueprint, we want to add components to that Blueprint and we use the Edit Button to accomplish it.
We actually can add more components to the blueprint with the Edit Button, but the issue is that if a specific component is present in another blueprint, the component will be moved from the old blueprint to the new one, and not being added to, as we want. We tried to configure the Edit Button in the List Control but we didn't figure out how to append the new blueprint to the List Field without replacing the old one. Can you please help us?
Solved! Go to Solution.
- Labels:
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2017 11:50 PM
Hi Gabriele
Yes, the List also reference to a table. It also behaves similar way. your both tables are connected via a single field. Whenever you add the new values from edit then it will override the old value.
You will be required to setup a m2m table for your solution.
Check the below link to know how to create m2m table.
Creating a Many-to-Many Relationship - ServiceNow Wiki
Regards,
harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2017 04:44 PM
Hi Gabriele
Yes , the behavior you have mentioned in your query is correct. Need to understand how the related list are working and how both tables are linked together.
In your case you have two tables and in both table there is a field referencing to the other table. Your tables are connected together with a reference field. When you create a reference field(referencing to Table2) in first table then on the Table2 a related list becomes available showing the list of the Table1. Now, when you are referencing a record of Table2 in first Table 1 , Then in the corresponding record of Table2 the related list shows the list of the Table1 record.
The same thing happening on the Edit button in this case. You are adding more records via edit button then you are actually changing the reference of the records and it show the impact accordingly.
This makes a One to Many relationship of the records or many to one relationship
For your requirement you need to have a many to many relationship of the records.You need to setup a m2m table which will have reference of both tables. Then add this as a related list in both the tables.
Check the below link to know how to create m2m table.
Creating a Many-to-Many Relationship - ServiceNow Wiki
Regards,
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2017 12:28 AM
Actually my tables are connected by a List Field, not a Reference Field.
The Relation is already N-to-N (many to many😞 actually I can add more blueprints to my components, and more components to my blueprint, if I do it manually (through the Component record, adding more Blueprints in the List Field).
I should need an "Add Button" that allows me to append more blueprints in the List Field of the Component Form, instead of overwrite all of them with the new blueprint.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2017 11:50 PM
Hi Gabriele
Yes, the List also reference to a table. It also behaves similar way. your both tables are connected via a single field. Whenever you add the new values from edit then it will override the old value.
You will be required to setup a m2m table for your solution.
Check the below link to know how to create m2m table.
Creating a Many-to-Many Relationship - ServiceNow Wiki
Regards,
harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 08:49 AM
Yes, ServiceNow confirmed me that there is no OOTB solution for my problem. If i don't want to create a M2M table, I have to build a custom slashbucket.