Many to Many help

venkatkk
Tera Contributor

Hi All,

I have to custom customer table (u_customer) which has a list of companies from core_company table.

I want to create a Related Lists in the cmdb_ci form. which should have Edit option to pick up the customer from u_customer table and link to particular CI.

Can anyone please suggest.

5 REPLIES 5

Gurpreet07
Mega Sage

I have done the same but its not working.


Please see below



I have a Customer table (u_customer) which has Name (reference to core_company) , CAPS ID   (string)


Now went to sys_m2m.LIST and created M2M



find_real_file.png



System Definition --> Relationship



find_real_file.png



Added a new UI Action "Edit.." for M2M table with the below script and condition as "true"



var uri = action.getGlideURI();


var path = uri.getFileFromPath();


uri.set('sysparm_m2m_ref', current.getTableName());


uri.set('sysparm_form_type', 'm2m');


uri.set('sysparm_stack', 'no');


action.setRedirectURL(uri.toString('sys_m2m_template.do'));



BUT when i click on Edit it shows Loading......... records not coming up.


Pls suggest


gauravchoudhury
Tera Guru

Hi Venkat,



Use these steps to create a new relationship record:


  1. Click System Definition > Relationships.
  2. Click the New button.
  3. Specify the relationship record fields. Field. Description. Name. Type the name of the related list. The form configuration page displays this name in the list of available lists. Advanced. ...
  4. Save the record.


Related lists appear on forms and show records in tables that have relationships to the current record.


Users can view and modify information in related lists like any other list. Administrators can configure related lists to appear on forms and in hierarchical lists. Related lists do not have a size limit.


By default, all related lists display in List v2, even when List v3 is activated. An administrator can enable List v3 for related lists. The same List v3 compatibility rules apply to related lists as to standard lists.



Source: Link



Gurpreet07
Mega Sage

You don't need to create additional UI action for this but there's another way to enable edit button over many to many list. Configure list control for this list and click on enable Edit on top right corner.


find_real_file.png