My UBAQ Help Desk custom-code customization worked in E10 and now it does not in Kinetic 2023. I just get the error: Object reference not set to an instance of an object.
It has come to my attention via two Epiuser posts that it may involve RowMod ’ U"; or the fact I’m using Update instead of what I may need to use now which would be UpdateExt. I will attach those two posts at the bottom. Here is my custom code that is causing issues. Not even UpdateExt using widgets it getting it to stick to the database
It’s weird that it worked fine on E10 but not on Kinetic. Just a simple GetByID, Change a fields value, and Update doesn’t work now
try
{
var ISSUETEXT = (string)queryResultDataset.Results[0]["Calculated_IssueText"];
var ISSUESUMMARY = (string)queryResultDataset.Results[0]["Calculated_IssueSummary"];
var CASENUM = (int)queryResultDataset.Results[0]["Calculated_Case"];
using (Erp.Contracts.HelpDeskSvcContract helpDeskSvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.HelpDeskSvcContract>(Db))
{
// Check if CASENUM is valid
if (CASENUM > 0)
{
// Retrieve HelpDeskTableset with HDCaseNum filter equals CASENUM
Erp.Tablesets.HelpDeskTableset helpDeskTableset = helpDeskSvc.GetByID(CASENUM);
// Check if HelpDeskTableset is not null and contains rows
if (helpDeskTableset != null && helpDeskTableset.HDCase.Count > 0)
{
// Update the existing HDCase with new values
helpDeskTableset.HDCase[0].IssueText = ISSUETEXT;
// Ensure ISSUETEXT is not null and truncate if necessary
helpDeskTableset.HDCase[0].IssueSummary = ISSUETEXT.Length > 60 ? ISSUETEXT.Substring(0, 60) : ISSUETEXT;
helpDeskTableset.HDCase[0].ResolutionText = ISSUESUMMARY;
// Call the Update method to save changes
helpDeskTableset.HDCase[0].Priority = 1;
helpDeskTableset.HDCase[0].RowMod = "U";
helpDeskSvc.Update(ref helpDeskTableset);
}
else
{
// Handle the case when HelpDeskTableset is null or empty
PublishInfoMessage("HelpDeskTableset is null or empty", Ice.Common.BusinessObjectMessageType.Error, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
}
}
else
{
// Handle the case when CASENUM is invalid
PublishInfoMessage("Invalid CASENUM", Ice.Common.BusinessObjectMessageType.Error, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
}
}
}
catch (Exception ex)
{
// Log the exception
PublishInfoMessage($"Error: {ex.Message}", Ice.Common.BusinessObjectMessageType.Error, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
// Rethrow the exception if needed
throw;
}