Asset resource fails to create or edit when prompt is checked on an attribute within associated editable dataclass that has a "-" in the name
search cancel

Asset resource fails to create or edit when prompt is checked on an attribute within associated editable dataclass that has a "-" in the name

book

Article ID: 257398

calendar_today

Updated On:

Products

IT Management Suite Asset Management Solution

Issue/Introduction

A customer is experiencing an issue in ITMS 8.6 RU3. When checking the "Prompt" option on an attribute within a dataclass that has a "-" in the name, the creation or edit of a Custom Editable dataclass in Asset Management, which has the dataclass attached, will fail. The error you get in the NS logs is:

HTTP Request failed:
 /Altiris/AssetContractCommon/Manager/EditCreateResource.aspx?ResourceTypeGuid=857b18cd-2603-4ac5-b8cc-b116bae5bbbe&defaultsItem=8a163ec6-5c54-42f8-93b6-40a5a638c9ed

This has been verified on several installations, including 8.6 RU2.

ISSUE REPRODUCTION

  1. Create a new editable dataclass with a "-" in the name,
  2. Add an Attribute type string and select the Prompt option.
  3. Then bind the the dataclass to a Custom Editable dataclass, e.g. Department and try to create or edit a Department.

Environment

ITMS 8.6 RU2, RU3

Cause

Known Issue. After digging in to the Profile trace captured while trying to reproduce the issue, a faulty query was found:


"SELECT DISTINCT TOP 1000 [Strukturtyp] FROM Inv_<dataclass that has a "-" in the name> WHERE [Strukturtyp] LIKE N'%' ORDER BY [Strukturtyp]".

This will fail because the table name is not included in [].

Resolution

This issue has been reported to our Broadcom Development team. A fix has been already added to our next release (ITMS 8.7).

The issue was fixed in:
Altiris.Resource.DataClassColumnPresentation.getPromptListItems(....)

SQL that used here have table name that not enclosed in square brackets:
"SELECT DISTINCT TOP 1000 [\{0}] FROM {1} WHERE [\{0}] LIKE @value ORDER BY [\{0}]",