Link to Customer record creates customer portfolio crash

I have written a custom .NET application which is integrated within the iMIS framework and is placed in the Events module. In this application there is a datagrid with a column containing iMIS ID's. When you you click on the ID it loads the record in the Customers module.

The URL being used is "imisnet:contact/1234/85a3ab83-7fe3-417f-af85-61f4d29d30e8-key_contact" where 1234 is an example iMIS ID. The GUID is just hardcoded.

When I click on this link, it creates a customer portfolio error. Here is what it shows in the error log:
17:05:29 Type: 'Error' Source: 'Customer Portfolio.ctlHistory.AddToSearchHistory' Desc: Rowset not available
17:05:29 Type: 'Error' Source: 'Customer Portfolio.ctlExecScreen.IMIS_nNewId' Desc: Rowset not available
17:05:31 Type: 'Information' Source: 'Customer Portfolio.EPWAbort' Desc: Aborting EPW.

This worked fine in iMIS 10.6. Since moving to iMIS15 it is having these problems.

I ran a trace, and one of the queries it was running was:
Select Name.ID, Name.CO_ID, Name.COMPANY_RECORD, Name.CITY, Name.STATE_PROVINCE, Name.FULL_NAME, Name.MEMBER_TYPE, Name.TITLE, Name.COMPANY,
Name.ID,Name.LAST_NAME,Name.FIRST_NAME,Name.MIDDLE_NAME,Name.SUFFIX,Name.TITLE,Name.COMPANY,Name.CITY,Name.STATE_PROVINCE,Name.MEMBER_TYPE,Name.CATEGORY,Name.COMPANY_SORT from
Name inner join IQA_Query_Cache on ID = Value where QueryId = '85a3ab83-7fe3-417f-af85-61f4d29d30e8-key_contact'

This is not returning anything because I am not inserting anything into the "IQA_Query_Cache" table.

This was not required before. Is it now a requirement to insert into the IQA_Query_Cache table before you can load a customer record?
I tried removing the GUID and just having the ID in the URL, but that didn't work (record did not load at all).

Now I have the issue of having to insert the ID which was clicked on into the "IQA_Query_Cache" table.
Any ideas on this?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

The IQA_Query_Cache table is

The IQA_Query_Cache table is used to provide the full list of results to Customer Portfolio -- so that you can use the "find" grid to move around among results without returning to/rerunning the IQA query, just like with an ad-hoc search.

The following INSERT statement will create the required rows in IQA_Query_Cache. You don't need to worry about cleaning them up, CP will automatically do it for the current customer when it exits.

INSERT INTO IQA_Query_Cache (UserId, QueryId, Value)
VALUES ([current user logon], [the Guid you're passing in your link], [the contact, event, or order ID for the row])

If you want the results grid to be populated with all of your returned rows (not just the one the user clicked), then do an insert for each result row, placing its ID in the Value column.

Current user logon

Is there anyway to get the current user logged in to the iMIS Desktop? We used ID tracker for this in 10.6, but was wondering if there was an easier way to do it in iMIS 15.
This .NET application is selected in the side navigation of the events module.

If it's .Net code running on

If it's .Net code running on the app server, try HttpContext.Current.Identity.Name.

Current user logon

I need to know how to do this in T-SQL. I'm trying to build a change log for the certification module. Any clue?

Unfortunately in iMIS 15 and

Unfortunately in iMIS 15 and later I can't really think of any good way to do so, because we only use two DB logins (one for SysAdmins and one for non-SysAdmins) in iMIS Desktop and a single one for the .NET application server.

The only thing I could really think of would be to write an Xtender that, when someone logs in to iMIS Desktop, captures the current user and writes it to some sort of database table, along with the current connection ID; you could then add some triggers or something that looks up the login for the connection ID that executed the trigger and use that as your audit information. That's a little complex and possibly fragile, though.