3 Replies Latest reply on Jan 29, 2019 11:55 AM by xili

    UI Actions - Creating an Email Record

    MattH Apprentice

      As a bit of a backstory (and to try and avoid the XY problem), I've been asked to create some form emails our SDAs can send from Incidents. One of the key requirements is that the SDA needs to review the email before it is sent, so using a Send Email quick action is out. Templates for Journal#Email are unfortunately also out because you don't seem to be able to access templates for an extended business object from a view of the group business object. Our Incident layout uses the Activity History child panel, which shows the group BO Journal#, and we don't want to split the Notes and Emails into separate child panels. I know this has been solved by users in the past by using an intermediate object, but this feels like a 'messy' solution to me. My current solution is to use a UI Action.

      UIAction.png

      Unfortunately, I've run into a few niggling issues with this.

       

      1. NewObject command opens in a new tab

      The preference for the new email would be to view it in the same tab as the Incident. However, the documented example for creating a new object will open it in a new tab. Meanwhile, the example for creating a child business object will open it within the current tab.

      The example for Command ID = NewObject uses Scope = ObjectWorkspace, while the example for CommandID = NewChildObject uses Scope = CurrentTab:ObjectWorksspace:ObjectView.

      I've tried using the Scope for NewChildObject in NewObject, however this doesn't work and the Email tab is opened but without a new record. Is it possible to have the NewObject command open within the current tab? Is further documentation available on possible values for Scope with each command?

       

      2. NewChildObject doesn't allow for the passing of fields

      The NewObject command allows for passing values from the current BO to the new BO via the 'Fields' attribute, which is an array of Name/Value pairs. I have tried including a Fields attribute in the NewChildObject command data, but the values were not passed to the newly created business object. Is there an equivalent field in the NewChildObject command?

       

      3. Expression evaluation in CommandData

      The examples of passing data from the current BO to a new BO via the NewObject command include references to the fields of the current BO, e.g. {'Name': 'ParentLink_RecID', 'Value': '$(RecId)'}. The $() syntax suggests that this is being evaluated as an expression, however using anything but a field name results in the expression being unprocessed, e.g. '$(CurrentUserDisplayName())' produces $(CurrentUserDisplayName()). Is it possible to use expressions within the CommandData of a UI Action?

      In particular, our Symptom field is stored as Unicode and I'd want to replace some of the special characters with HTML entities for the body of the email, e.g. replacing line breaks with <br>.

        • 1. Re: UI Actions - Creating an Email Record
          Jonathan.Schmidt SupportEmployee

          Hi MattH,

           

          First off, thanks a bunch for giving us such a detailed write-up of your situation.  It's great to not have to guess at what you want!  Unfortunately I think you are just a step ahead of what the product is capable of at this moment.

           

          Item 1:

          All possible values of Scope for each Command ID are referenced in the help file.  If you don't see a scope value there for a commandID, it can't be expected that it would work.  If you'd like a scope from one method available for another, you can certainly log a feature request as such (details on the enhancement portal are at the end of this post).

           

          Item 2:

          I'm not aware of any such syntax for NewChildObject and cannot find any reference to such in the documentation.  Much like item 1, I think you are assuming the two similar methods should hold the same logic.  They do not.  Again an enhancement request is probably your best route forward here.

           

          Item 3:

          The fields section only understands Fields.  If you need a function to pull data here you MIGHT be able to make a field to hold the CurrentUserDisplayName() on the "source" object (it wouldn't even need to be a stored field), use a calculation rule to load the value from the function, and then pass that field to the UI command.

           

          With all that said, I think the intermediate object with templates method might be the best way to go with what you have available in the product today.  Either that or use "NewObject" and educate your users about the new tab that it will open.

           

          If you do decide to create one or more enhancement requests, please leave us the links so others can place their votes if they come upon this thread.

           

          My last thought is that you also MIGHT be able to make templates on the base journal object that you could add to the activity history child panel.  They'd need to specify the JournalType field = Email, but it's got a chance of working that way as well.

           

          Hope this clarifies your options or gives you a better idea how you'd like to move forward!

           

          Jon

           

           

          ================================================================================================================================================================

          The functionality that you are looking for is not currently available in the product.  Our product management teams are always looking for new ideas to help us improve our products and we know the best ideas come from customers that use our products every day.

           

          We would therefore encourage that you consider submitting a suggestion in our Feature Request portal via the Ivanti Community Ideas homepage

           

          You can submit ideas and show support for ideas that other customers have submitted by voting for them. The more votes an idea receives, the more visibility it receives with our Product Management team. The Product Management team will evaluate all ideas that reach a voted point threshold. When there is an update on the status, an Ivanti product manager will reply to the idea or update the status so that all interested parties are notified. It is therefore key that you as a customer raise new or vote on exiting ideas to be kept looped in with future progress.

           

          When you create an idea, please describe both the problem or pain you're experiencing as well as your suggested solution to that problem. It can also be useful to describe specifically how you would use the new feature if it were built, as well as how you are dealing with the problem today. The better your explanation and logic, the better your chances of attracting positive votes from other users and ensuring a response from Product Management.

          Thanks in advance for your feedback.

          Kind regards,


          Ivanti Community Ideas Homepage: https://community.ivanti.com/community/enhancementrequests

          • 2. Re: UI Actions - Creating an Email Record
            MattH Apprentice

            Hi Jonathan,

             

            Thanks for your response. My questions were mostly in the hope that there was something in the documentation that I'd missed, but for now I'll work within the limitations of the current functions and communicate the expected behaviour with users.

            Rather than raise a new enhancement request, I've found an existing suggestion asking if Current User functions could be supported in UI Action Command Data: Ability to pass a Current User Function in the command data (URL) in a UI Action.

             

            As a note on your last thought, a most of the key fields for Email records do not exist on the base Journal object (e.g. ToAddrList, EmailBody). However, even though they're not available in the drop-downs of the Template designer, they do appear to be valid choices when manually entered. Something else to experiment with!

            • 3. Re: UI Actions - Creating an Email Record
              xili Apprentice

              Interesting topic. I have the same request from my users as well; and having the same issue of retrieving values from parent, Incident BO (the new email form would be popped up from a task drop-down menu).

               

              What I plan to do is to add a few preparation quick actions at the top of the Composite Action to retrieve values from incident parent and some other business object and save the values in some task fields so that these values can be used in the command data segment.

               

              It seems to be working so far in some simple case, but there would be a lot of other details and testing. Wish me a good luck :-)