Highlighted
Acclaimed Contributor.
Acclaimed Contributor.
709 views

set the condition for creating relationship between tables

In DisplayOptions for INTERACTION there is ability to set relation between tables (incidents-probsummary)

Where should i set the condition wich should not allow to link the interactions with the closed incident ?

0 Likes
7 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: set the condition for creating relationship between tables

If I understand your request correctly, you would like to prevent Interactions to be associated to closed Incident tickets, when using the "Related/Incidents/Associate" option.

If this is correct, you can update the "screlate.get.association" link record for field "problem", and add a query definition. If the limitation is only from INT to INC, you'd want to use expressions to define $L.query, and use $L.query as the Query statement.

This will prevent searching for closed incidents. If someone types the inicdent ID in directly, without searching, they would still be able to associate to a closed incident.

The only "cleaner" way of preventing that is to update the screlconfig record for problem, and update the "Query" line to include some new global variable (e.g. $G.custom.pm.limit) that gets manipulated in the Display Option for associnc (most likely GUI 680 for cc.edit.incident) using the "pre rad expressions" to set it to something like "status=\"open\"" and reset in the post rad expressions (as: "cleanup($G.custom.pm.limit)"). The Query for screlconfig then would be something like:

"number isin "+str($L.unique.array)+" and "+str(nullsub($G.custom.pm.limit, "true"))

 

Untested, so syntax might be incorrect.

Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: set the condition for creating relationship between tables

Yes, i would like to prevent Interactions to be associated to closed Incident tickets, when using the "Related/Incidents/Associate" option.

Why for Interaction (incidents table) must use  "screlate.get.association" link record for field "problem" ?

Or this is like in screlation - problem mean for probsummary ?

-------

1)

a) For DO for cc.edit.incident for 680 code set in PreRAD

"status=\"open\""

b) And in AfterRAD

cleanup($G.custom.pm.limit)

2) Then add to screlconfig for problem into query:

"number isin "+str($L.unique.array)+" and "+str(nullsub($G.custom.pm.limit, "true"))

 

about 1) - don't understand how it works

about 2) - what else could it affect (except conditions for association interaction with incident) ?

 

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: set the condition for creating relationship between tables

The link record is for the "target" - so in this case the "problem" line is used by all calls from other modules to Incident Management. And yes, "problem" is the older reference to "probsummary".

On 1)
In the display option for "Incidents/Associate" (which belongs to Display Screen "cc.edit.incident", and most likely had GUI ID 680, which has the action "associnc") you can add a line to the pre-rad expressions stating:

$G.custom.pm.limit="status=\"open\""

 

In the post-rad expressions, you can add:

cleanup($G.custom.pm.limit)

 

On 2)

This line is generically called from all modules that want to relate to Incident Management. Using the statement as suggested (with a nullsub) should prevent any impact on other modules.

Hope it helps!

Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: set the condition for creating relationship between tables

I do not see in this scheme, where is checking status of the incident (probsummary) ?

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: set the condition for creating relationship between tables


The first statement value holds the limit (in my example: status="open"). If you want to align it to the OOB definition of open, you can just change that to:

$G.custom.pm.limit="flag=true and problem.status<>\"Resolved\" and problem.status<>\"Closed\""
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: set the condition for creating relationship between tables

How must i chabge this query if status in mos.status field and if need compare with glabollist value (like $G.mos.probsummary.st.resolved and $G.mos.probsummary.st.closed) wich contain value of status.

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: set the condition for creating relationship between tables

If both are regular arrays (global lists), you can look for the negative (this is pretty slow, but straightforward):

$G.custom.pm.limit="flag=true and index(mos.status, $G.mos.probsummary.st.resolved)=0 and index(mos.status, $G.mos.probsummary.st.closed)=0"

or possibly this (with better performance):

$G.custom.pm.limit="flag=true and (mos.status~=$G.mos.probsummary.st.resolved) and (mos.status~=$G.mos.probsummary.st.closed)"
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.