Re: Link in Incidents (467 Views)
Reply
Respected Contributor
brav0
Posts: 920
Registered: ‎12-07-2008
Message 1 of 19 (474 Views)
Accepted Solution

Link in Incidents

Experts,

One query here,
In the incidents format, SD.open.interaction, For the contact details, there is a subformat being used which is "SD.Contacts.Details.vj".

How the fields in the subformat getting filled in?

please guide.

Thanks
DEV---
I am Listening..
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 2 of 19 (471 Views)

Re: Link in Incidents

If you take a look at the form in form designer, you'll see there's an input for that subform. That input references a line in the incidents link record. That link takes the information in the contact.name (or callback.contact... I don't remember off the top of my head) and queries the contacts table to return the unique record that matches that contact name.

So all of those fields in that subform are actually using inputs from fields in the contacts table. That way, you don't have to store non-essential information in the ticket, or perform mass updates when contact information changes.
Respected Contributor
brav0
Posts: 920
Registered: ‎12-07-2008
Message 3 of 19 (471 Views)

Re: Link in Incidents

Jacob,

I had checked this and I am a bit confused here.
I had checked the format sd.open.interaction where there the subformat input is callback.contact.
Checked the incidents link record for the entry callback.contact, and inside that link entry i couldnt find the fields which is mentioned in the subformat.

So could you please tell me , from where these fields are getting populated.
The subformat is having contact.phone, email, dept etc..

I was trying to do something similar to this for a menu. I created the format ivr.format1 and a subformat called submitter.contacts.details.vj and gave the input to this format as "contact.name"

Created a link record for the format, ivr.format1 and provided the entries very similar to the incidents link record entry for callback.contact, i click on the fill button for this format, it gives me the list of contact, but when i select the contact, values are not getting populated.

Please guide.

Thanks
DEV---
I am Listening..
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 4 of 19 (471 Views)

Re: Link in Incidents

"So all of those fields in that subform are actually using inputs from fields in the contacts table. That way, you don't have to store non-essential information in the ticket, or perform mass updates when contact information changes."

What you're trying to do is called setting up a Virtual Join.

Awhile back, I wrote this little guide about Virtual Joins. The fillowing uses the Related Records on the IM.update.incident form, but the overall steps are similar.


A "Virtual Join" displays information from _one_ table on a form connected to a _different_ table. If you use Form Designer and look at the IM.update.incident form in Design mode, and look at the Related Records tab, you'll see large grey boxes on those tabs. Those "boxes" are a Form Element type called "Subform". If you look at the properties window of the Subform element, you'll see three checkboxes:

Virtual Join
Display Blank
Display Using Table

You'll also see two important properties fields:

Format
Input

"Format" is the form the system will display inside the Subform element in this form. "Input" is the field that exists in the table for this form that will be used in a link expression to determine what records in the other table should be displayed.

For example, if you look at the Properties for the Subform Element on the Related Records tab for "Interactions", you should see the following:

Format: screlate.call.vj
Virtual Join: true
Display Blank:
Display Using Table: true
Input: vj.number.1

If you exit Design Mode and from the Options Menu select "Subform Editor" you will see all the Forms that are displayed on this form in a subform element. Look at "screlate.call.vj.g" and you'll see the table the system displays in the Related Records - Interactions tab. The inputs on the fields in this form are NOT from the probsummary table... they're from a different table; they're just displayed in a form connected to the probsummary table. It is important to note, if you select the whole Table Form Element, in the properties window, you'll see:

Double Click Button ID: 8
Double Click Field: depend.call


This will be important later.

So the system displays _this_ form as part of the _other_ form. But how does it know what records to display? That's what's next....
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 5 of 19 (471 Views)

Re: Link in Incidents

A "Virtual Join" displays the contents of records from one table in a form that actually belongs to a different table. We looked at how subforms were set up in Form Designer... now we're going to cover how the system knows which records to display.

For "Virtual Joins", just like every other way the system connects the contents of two tables together, the system uses a Link record and link line to determine which records to display.

If you look at the link record for the probsummary table (the table that stores Incident tickets) you'll see the following:

Source Field Name: vj.number.1
Target File Name: screlation
Target Field Name: source
Add Query: depend.filename="incidents"
Comments: VJ ONLY

When the Incident ticket is displayed, the system checks the link record to know what it's supposed to do and display. In this case, the system is told to take the value in the "vj.number.1" field, go to the "screlation" table (the OOB table that stores relationships created by the screlation RAD application), and compare the value in "vj.number.1" to values in the "source" field in the "screlation" table. It will pull back all the records where the "source" field="vj.number.1" field and where the value in the "depend.filename" field in the "screlation" table="incidents".

So, what it does is pull back a list of records returned by the query. Thanks to the "Subform" element on the form, it displays the results of that search in the "screlate.call.vj" form.

The _next_ entry in the probsummary link record looks something like this:

Source Field Name: depend.call
Target File Name: incidents
Target Field Name: incident.id
Add Query: $query
Comments: (from the above VJ)

If you choose "Menu Option -> Select Line" with that line highlighted, you'll see in the Expression:

$query="incident.id=cursor.field.contents()"

What _this_ link line does is, when you're looking at the Incident ticket, at the Related Records - Interactions tab, and you double-click one of the records in that list, the system uses the value in the "Double-ClicK Field" on the form to run the link line associated with that field. In this case, it takes the value of the "depend.call" field your cursor is on when you double clicked, and performs a query against the "incidents" table, to "Find" (the "Double Click Button ID: 8" which is the "Find" button) the record with the same incident.id

One final thing: notice that the first link had a field vj.number.1. If you look at the probsummary table, you can see that this field is an "Alias" of the "number" field in the probsummary table. It's a good idea to create an Alias for whatever field you're going to use to join these tables together. It makes creation and maintenance of the link record and subform easier.

So... that's the overview. Now, on to the Instructions.
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 6 of 19 (471 Views)

Re: Link in Incidents

o make this work for you, we need to do the following:

Use the Database Dictionary to make an Alias of whatever field will be used to conenct records together. In mose cases, this will be the unique "number" field for your table... All the "Related Records" will be related to the _same_ number... The system uses aliases of this field for the historic Activies, the Related Records... Change tickets use an alias of this field to connect Changes and Tasks together.
- Click on whatever field you're going to make an Alias of and then click
"Edit Field/Key". You should see a "Create Alias" button on the next screen. THen you will be prompted to name your new alias field. Leave the "Type" alone; just choose a Name.

Create a Form in Form Designer that will display your record list for related records as a virtual join...
- Best practices recommend you name your new form with a .vj as the last part of the name. It makes it easier to know which tables are used as a virtual join. This is not required, but it is recommended.
- Your new form should use a Table form element.
- The inputs for the columns in that form should be the table whose records it will display (the table that has your Work Order records or your Problem Description records or whatever).
- The Double Click Button ID: 8
- The Double Click field _should_ be a unique key... how will the system know which records to return? For the Related Records that are already there, the Double Click field is the unique field in the other tables... the incident.id field in the incidents table, the number field in the cmr3 table, etc.

Create a Subform Element on whatever form is going to show your related records...
- Format: the name of the new form you just created in the last step.
- Virtual Join: true
- Display Blank: true
- Input: the name of the alias field you created in the first step.

Make a Link line to connect your forms together.
- Go to the Link record for the table that will display your subform (for example, the "probsummary" link record.
- Make two new link lines. The first connects the alias field to the unique field in the related record
Source Field Name: the name of your alias field in step 1
Target File Name: the name of the table has your related records
Target Field Name: the name of the field in the related table that has the same values as the alias field in step 1
Add query: any additional limitations to limit what results are returned. For now, just leave this blank.
Comments: VJ ONLY

- The second allows you to double click a record in the Subform and be taken to that record in the related table
Source Field Name: the double-click field of your form in step 2
Target File Name: the name of the table that has your related records
Target Field Name: The name of the unique key in the related table... this will _probably_ be the same as the Target Field Name in the above step
Add Query: $query
Comments: (from the Above VJ)
Select Line Expression: Your query should use the Source Field name and cursor.field.contents() function... so if your source field was "work.order" your query would be:
$query="work.order=cursor.field.contents()"

And that _should_ be it.
Respected Contributor
brav0
Posts: 920
Registered: ‎12-07-2008
Message 7 of 19 (471 Views)

Re: Link in Incidents

I think i understood what you have explained .
Thank you very much for the detailed explanation.

Here, I am trying to setup an IVR kind of menu for the ess users. When the ess User logs in, he click on button , to submit a ticket.

I am trying to use scripts here to achieve this.

In the first format which gets displayed am trying to capture the submitter details. I have done the below steps till now.

1. Created a format , ivr.format1 and linked to the incidents file
2. In the ivr.format1, I have put a fill field contact.name
3. Added a subform called as "sd.submitter.contact" with the input as "contact.name"

4. Created a link record for the format ivr.format1 with
source field name : contact.name
Target File Name : Contacts
Target Field Name : contact.name


-- SO i log in as ess user, click on the button which calls the script.

I see the ivr.format1 , clicks on the fill button -- it gives me a contacts qbe. Select the contact, but i dont see the fields populated in the subformat fields..

watz wrong here?

In the script format, ivr.format1, under privileges, i have put true for fill ..

Please guide.

Thanks
DEV---

I am Listening..
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 8 of 19 (471 Views)

Re: Link in Incidents

can you show screenshots of your forms, and your link records?
Respected Contributor
brav0
Posts: 920
Registered: ‎12-07-2008
Message 9 of 19 (471 Views)

Re: Link in Incidents

Jacob,

Please find the attached screenshots.

Thanks
DEV--
I am Listening..
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 10 of 19 (471 Views)

Re: Link in Incidents

Hmm... getting an error trying to download your attachment...
Respected Contributor
brav0
Posts: 920
Registered: ‎12-07-2008
Message 11 of 19 (467 Views)

Re: Link in Incidents

Jacob,

I have tried putting the screenshots in a word doc
PFA..

Thanks
DEV--
I am Listening..
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 12 of 19 (467 Views)

Re: Link in Incidents

Ok, rather than using contact.name, create an alias for that field, and use that alias field as the input and the source in the link record.
Respected Contributor
brav0
Posts: 920
Registered: ‎12-07-2008
Message 13 of 19 (467 Views)

Re: Link in Incidents

Jacob,

Thank you for the reply.
Here are the steps which I did.

Dbdict > contact.name > created an alias as "contact.name.ivr"

In the fd > ivr.format1 > in the field, instead of contact.name as input, made it as contact.name.ivr

in the input of the subformat gave > contact.name.ivr

in the link record > source is made as contact.name.ivr

Logged in as ess user >
Clicked on the fill button > qbe > selected the user > but the fields are not getting populated.

Thanks
DEV..
I am Listening..
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 14 of 19 (467 Views)

Re: Link in Incidents

Hmm... does the ess form use a different link record than the one where you're making these changes?
Respected Contributor
brav0
Posts: 920
Registered: ‎12-07-2008
Message 15 of 19 (467 Views)

Re: Link in Incidents

Not at all.

For this requirement, i have created a new menu, the user clicks on the button to submit a new ticket whcih inturn calls script.execute > start.ivr

In the next script >ivr.1> am using the format ivr.format1 , basically this format is completely a new one with link i have created with that entry alone.

Is there something which i am missing while trying to do with scripts here?

Thanks
DEV---

I am Listening..
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 16 of 19 (467 Views)

Re: Link in Incidents

When you created your format - the ivr.format.1 - did you associate this form with your incidents database definition?

In Form Designer, from the Detail Options list, select the "Filename" option, and enter "incidents" in the field and save your form. Then try.
Respected Contributor
brav0
Posts: 920
Registered: ‎12-07-2008
Message 17 of 19 (467 Views)

Re: Link in Incidents

I had done that initially itself.
I believe that there is nothing wrong in the way in which I have created the formats, vj, link records.

Is there some adjustments which needs to be done while trying to use VJ in scripts?

please guide.

Thanks
DEV---
I am Listening..
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 18 of 19 (467 Views)

Re: Link in Incidents

Now that part I don't know, but I wouldn't think it would be different. But from here, I can't tell what's not set up to make this work.
Respected Contributor
brav0
Posts: 920
Registered: ‎12-07-2008
Message 19 of 19 (467 Views)

Re: Link in Incidents

Thanks for the replies nd all the help Jacob..
i will work on this and if I reach somewhere here, i will post here.

Thanks
DEV---
I am Listening..
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.