Multiple Locations in a form

snowuser111
Kilo Guru


Hi Experts,

 

I want to create a related list for locations so that we can select multiple locations. Can anyone help me suggesting this please.

 

Thanks

1 ACCEPTED SOLUTION

It sounds like you want the many-to-many functionality based on your earlier requirement. - The ability to add multiple locations to a CI, and use those locations on multiple CIs (not exclusive to one.) Putting a field on the cmn_location won't get you where want to go. It was a simple example how to relate two records together. Here's what you'll need to do:


  1. Create a new table (e.x: CI Location [u_ci_location])
  2. Add two fields to the new table
    1. CI [u_ci] - reference field to table cmdb_ci
    2. Location [u_location] - reference to table cmn_location
  3. Add the related list to your CI form(s) and it will show locations
  4. (optional) Add the related list to your Location table, and it will show CIs

Hope that helps


View solution in original post

9 REPLIES 9

Chuck Tomasi
Tera Patron

A related list is simply a list of records that has a reference field back to the original table (e.g. the task field on cmdb_ci allows you to create a related list of CIs on an incident form.)



In your case, Option 1: add a field to cmn_location to point to your target table (e.g. task) then right click on the specific task form header, and select Personalize> Related Lists. Locate the list (Location->Task) in the list collector and move it from the left to the right. Done. This results in a one-to-many relationship. One task can have many locations.



Option 2: Create a new table with a reference field to cmn_location and another to your table. This would allow you to create a many to many relationship allowing many tasks to have many locations. Same procedure to place the list on the form.


Hi,



I was looking to select multiple locations . So that in a change If a CI belongs to multiple region can be selected in the form.



Thanks


@snowuser11,   Sounds like the second option is what you are looking for. Good luck!



Hi Ctomasi, Thanks for the instant help. New   to Service Now so if you can describe will really be helpful.



If I understoosd correctly.


1. Need to create a new field say "Loc" in table "cmn_location".


2. Now   open a change and in header   personalize-->related lists--> select   ?



Can you suggest plz.



Thanks