Sharing Sections across Forms

General Add comments
by:

If a customer uses a lot of different forms for one extended table (for instance cmdb_ci), it is possible to share sections across these forms.
The instructions below describe how to set this up.

Please remember: when you create an extended table, the layout of this table will be an exact copy of its parent. As long as you don’t change anything on the form layout, this will remain the case. By following the steps below, you force the system to create a separate instance for that form, so any modifications to the parent will not be propagated to the extensions anymore.

Step 1: Create table if needed.

Step 2: Create the section you need to share.
Do this at the highest level that contains all the attributes.
This is needed because the section will only be available for the extensions of the form where you created it.
Example:

Top left, in the Application Navigator header, type “cmdb_ci.do” to get to the Configuration Item form.

Create a new Section (Personalize -> Form Layout) “CI Relationships”:

Add the CI Relations and Save the section:

(steps 2 and 3 are there to make sure your main section doesn’t disappear when executing this action)

Step 3: Make sure all the Forms are “registered”. To do this, go to the Forms module and see if your Form is there.
(If the form is not there, it is probably because you didn’t define any sections for it yet. SNC seems to determine the form layout dynamically then).

If it is not there, press New:

Select Table and View and Save it, because you also need to add a related record:

In the Form Sections tab, press New:

Set Position to 0 and Press Submit to secure your main section.

Step 4: In the Form Sections module, you will have to do similar:

Create a new Form Section:

Populate the Table and View and save the record.

Again, under the Form Sections tab, press new:

Populate the Form and the position and submit.

Step 5: Under Form Sections, find the Form Section you created in the cmdb_ci form (table=cmdb_ci will probably take you there. Look for the caption).
In this form Section, in the tab Form Sections, press New to add the cmdb_ci_server table:

Make sure to select a higher position than the previous one.

Step 6: Check your work.
Go to cmdb_ci_server.list and open a server. (make sure the class is really server and not some subclass).
You will see that the section is added:

 

Once your form is “registered”, only step 5 is needed to add other forms to the section.

If you have any questions you can contact me on martijn.odijk@2e2.nl

Leave a Reply