Base href references in the body of emails is causing the application to stop responding correctly once the source is read.

Version 1

    Details

    base href references in the body of emails is causing the application to stop responding correctly.


    The offending tag will be <base href="{address}">

    This will present itself with errors that have issues with Getformvalidationlistdata, GetFormDefAndData,  and other function errors.

    Looking at the browsers console, you will see many 404 errors pointing to the address listed in the href attribute.


     


    Resolution

     

    Correcting existing incidents that have this behavior can be accomplished with an 'Update Object' quick action on the target object.
    These instructions are specific to Incident#, but can be applied to any field that this html tag is adversely affecting use of the product.

    1. Open the Action Center for Incident#
    2. Create a new quick action using 'Update Object'
    3. Add the description field and use the following function:

    $(ReplaceRegex(Symptom,  /(<)(base\shref=.*?\")(>)/ig,  "$1!--$2--$3"))

    This function looks for <base href="">, ignoring case, and turns the tag into a comment by adding !-- and --.
     
    4. Mark the option to 'Auto-save' the changes.

    5. You can now run the action on any incident that is has the base href tag.
    You may have to select multiple incidents to run the action on as directly selecting the affected item may prevent you from running the action if the base href tag is pulled up in the bottom preview. If the description in the preview only shows the source HTML, then you should be able to run the action on the item directly.

    Description field showing tag with comments added.



    To prevent this from happening on incoming emails and and the target object (Incident#), the same expression needs to be used in both Journal.Email and the target object (Incident#)

    Journal.Email

    1. Open the business rules for the business object Journal.Email.
    2. Add a new triggered rule by clicking on 'Add Trigger'

    3. Provide a name for the triggered
    4. Set the event to trigger the action to be 'On Insert'


    5. Select 'Configure new action' and select the action type of 'Update Object'
    6. Add the following expression to the field 'Email Body':
    $(ReplaceRegex(EmailBody,  /(<)(base\shref=.*?\")(>)/ig,  "$1!--$2--$3"))


    7. Save the Triggered Action.

    Target Object (Incident#)

    8. Open the business rules for the target object (Incident#)
    9. Add a new triggered rule by clicking on 'Add Trigger'
    10. Provide a name for the triggered action
    11. Set the event to trigger the action to be 'On Insert'
    12. Select 'Configure new action' and select the action type of 'Update Object'
    13. Add the following expression to the field that will hold the email source that is being read. For Incident, it's the Description field, which is saved in the database as Incident.Symptom:
    $(ReplaceRegex(Symptom,  /(<)(base\shref=.*?\")(>)/ig,  "$1!--$2--$3"))

    14. Save the Triggered Action.

    Incoming emails will now auto-comment any base href tags and the target object will also do the same.