Form Search for find records related IM in SM 9.40

Hello everyone! I am requesting your help to configure the following:

Is there a function to search for related records ?, when I perform a search on the incident form, if this incident has a related record, then when writing the related record may be a change, an interaction, a problem, and so on. , find that record.

Can you help me?, please.

Add two images of example.



  • Hi ,

    There is no OOB functionality to search for related records via the OOB Search functionality.

    But you can do the following (just as inspiration ;) )

    Create a new wizard:

    First Panel: Form with some fields:

    1. Dropdown, which defines the target module, with the Options "Incident", "Interaction", "Change", "Problem"
    2. Text field, which will be used as Search Parameter

    Second Panel: Start a search against the table "screlation"
    The script will check if there is a relation between your target module (selected option from your dropdown)
    and the entered ID.

    The query is then something like this (based on your example):

    source="<entered search id>" and depend.filename="<targettable"
    //example for incident management
    source="SD12345" and depend.filename="problem"

    You will get an result from 0 to X records. 

    Third panel: Show the found records
    I think the easiest way is to show the result as table. Then the user has to choose one record from the list and click next to get the details from the related record.


    I know some details are missing, but as first idea it should be enough :)

  • Hi MarcusReinhardt!,

    Thanks for reply,

    It's a good idea, but, the request is very specific with the search criteria, the client wants everything in the form.

    Other way functional is:

    Create a field in the form of IM, with input and the condition title "select( depend, screlation, source, [number])"


    Then, in the form search IM, added the field Related with input and I search the records.

    Search related.png

    But this way is not always fuctional.


  • Hi,

    ok, I have a new idea :)

    What about manipulating the search query.

    After running the normal search, which creates the query like:

    open=true and status="Work in Progress" and open.time>='01/01/2017 00:00:00'

    You can modifing the query and running a script which returns all incident records, which are related to the Interaction (or whatever you want).

    In the search form, you can define a fields which has a variable as input.
    In the search process you can check the variable. If filled --> Run the JS Script.

    I hope i find some time tomorrow, then I can check, if it's working or not.

    Variables for the queries are

    • $L.sql
    • $

    If I'm not wrong.

    Greets & have a nice sunday.


  • Hi MarcusReinhardt!

    Okay, I check it out and then write my comments about the proposal.
    Thanks for the support.

    Have a good sunday too.