Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Audrey H. Acclaimed Contributor.
Acclaimed Contributor.

Caption for Attachment section



I'm not sure which version this was introduced in, since we always use custom forms with custom captions, but in our current version (SM9.33.0035), when I added an Attachment section to a form where I didn't have one before, there was an automatic OOB caption which also includes a count of the attachments (only visible through Web client).


In the past I have always added a count query to the formatctrl to count the attachments, added a calculation to use the results of that count in an expression to produce a variable to contain the string I wanted in my caption.  I would then add my variable to the caption condition of the Attachment section of my form.  I don't know how they are inserting this new OOB caption, since there is nothing in the Caption or Caption Condition of the Attachment section of my form , but however they are doing this count and producing this caption, I was hoping to re-use it for my purposes.  Does anyone know where the count of attachments is being produced and stored?  Is there a new OOB variable that contains the count of attachments on display of the ticket through the web client?



4 Replies
Absent Member.. John Stagaman Absent Member..
Absent Member..

Re: Caption for Attachment section

In a 9.33 application with PD4 applied, it appears that the captions are generated by a JavaScript call from the displayscreen:

var $ = lib.c.$;
vars.$incident_caption = system.functions.scmsg("caption","probsummary",$.createSCArray(vars.$L_file.number));
vars.$attachmentCaption = system.functions.scmsg("caption.1","SYSATTACHMENTS", $.createSCArray($("#sysattachmentsService").countAttachment(vars.$L_file.number)));
vars.$screlation_caption = system.functions.scmsg("caption.1","screlation", $.createSCArray($("#screlationService").countRelatedRecords(vars.$L_file.number)));


However, this code was added in the PD content pack, and I think the 9.33 release may actually calculate the attachment counts at the binary level (9.33 introduced the new attachment object). I don't have a non-PD 9.33 system to check at the moment.

Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
Audrey H. Acclaimed Contributor.
Acclaimed Contributor.

Re: Caption for Attachment section

Hi John,


Thanks for the response.


We aren't using PD, and the JavaScript you posted from a displayscreen is not present in any of our displayscreens, or in any from OOB 9.33.0035 without PD.


Although the caption doesn't actually appear when logged in through the Windows client, so the rendering of the string is happening through the web tier only, I would agree with you that the count of the attachments seems to be done at a binary level.  It must be stored, if only temporarily, in order to be used by the web tier, so I hope I can find out where it is stored so I can re-use it.  It's certainly not critical, but since the count is already being done by the system, it would be nice to eliminate the additional overhead my queries and formatctrl calculations are adding at every presentation of a ticket.



Piku Absent Member.
Absent Member.

Re: Caption for Attachment section

Hi Audrey,

Not having the answer but just I am not able to see the count on existing attachment panel.
Do we need to replace the panel with new one or it will show in existing one.
However properties are exactly same for both.

Assign Kudo, if found post useful and mark it accepted if solves the issue.
Audrey H. Acclaimed Contributor.
Acclaimed Contributor.

Re: Caption for Attachment section

Hi Piku,


Do you have your own Caption Condition for you attachment sections, because yours will override the OOB one.  We never used Attachments in Interactions but are going to start doing so, therefore I added a new section with a Caption of Attachments and then added an attachment container object in the section.  I did not put a Caption Condition or anything like that, but when I look at the new attachment section in an Interaction ticket through the Web Client it has a caption of "Attachments - 1 file(s) attached". Of course the value changes to match the number of attachments .  If I look at the same ticket through the Windows client the section just says "Attachments".  When I removed my own Caption Conditions from the attachment section of one of my other existing ticket forms this new caption was then there on display of the ticket.


We are on SMv9.33.0035 for both Windows and Web Tier.



The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.