How to fix Attached By issue in the SCSM Problem form
Recently I’ve met on the TechNet Service Manager forum a request about an issue with ‘Attached By’ field in the SCSM Problem form. After you attach a file and then click on Apply or OK button in the SCSM Problem form, you cannot see who is attached the file. I’ve never put any attention for that but a quick check proved the issue in the Microsoft System Center 2012 Service Manager SP1 and R2.
After some time, I remembered the similar issue happened when I developed an add-on to add Related Items for Manual Activities. I fixed that issue by changing an alias in a type projection. Maybe the same trick would help again?
Using the SCSM Authoring Tool I created a custom Problem form with no customization. All I need was a new form with a new projection for this custom form. The Authoring Tool copied the default type projection of the default Problem form.
As you see on the screenshot the alias for the relationship System.FileAttachmentAddedByUser is “CreatedBy”. My previous experience told that “FileAttachmentAddedBy” alias could solve the issue.
So I replaced “CreatedBy” with “FileAttachmentAddedBy”, saved the form, and imported the management pack.
Voila!
You can download a slightly improved management pack using a link below.
If you already customized the Problem form, you have to edit manually the customization’s management pack to change the required alias.
Comments (4)
Oliver
can you Show your Code behind your "Add"-Button?
I brauche the function "AddFileToListView"?
Thank, Oliver
reply
Marat Kuanyshev
Here we just fixed the issue by changing the type projection. The rest of the magic the SCSM console does.
reply
Oliver
it would be nice if it works so easily. ;-)
We have a custom SCSM management pack and added the FileAttachment there. In our xaml.cs file we had to create a "CreateProjectionInstance" of "System.FileAttachmentProjection" and "System.FileAttachment". Also we added the // fileAttachment["FileAttachmentAddedBy"] // in our function.
Now it runs.
Greeting from Berlin, Germany
Oliver ;-)
reply
Marat Kuanyshev
reply