0
<force:recordData aura:id="recordLoader" recordId="{!v.recordId}" targetFields="{!v.simpleRecord}" fields="CaseNumber" />
{!v.simpleRecord.CaseNumber}
{!v.recordId}
<center>
    <lightning:button label="Attach file">
        <a href="{!'/p/attach/NoteAttach?pid='+{!v.recordId}+'/parentname='+{!v.simpleRecord.CaseNumber}+'/'+'&retURL=%2F'+{!v.recordId}}" target="_blank">Attach file</a>
    </lightning:button>
</center>

Failed to save CustomAttachmentRelatedList.cmp: c:CustomAttachmentRelatedList:17,118: ParseError at [row,col]:[18,118] Message: The reference to entity "retURL" must end with the ';' delimiter.: Source

I'm getting the above error not sure what is wrong in my URL.

My Expected URL looks like:

https://garvitasb2bsc--4hdev.cs60.my.salesforce.com/p/attach/NoteAttach?pid=5003C000003bdmt&parentname=0114054744&retURL=%2F5003C000003bdmtQAA where ‘500..’ is case id, ‘001’ is the case number.

1 Answer 1

1

You cannot nest the merge fields. URL must be generated inside the single merge field {!}, and inside you can concatenate the variables and string. Following would be the psuedo code and the query parameters must be separated by ampersand sign (&):

{!'/p/attach/NoteAttach?pid=' + v.recordId + 
    '&amp;parentname=' + v.simpleRecord.CaseNumber + 
    '&amp;retURL=%2F'+ v.recordId }

Note the ampersand (&) is probably reserved character, replace that with &amp;.

3
  • still i'm getting this error 'Failed to save CustomAttachmentRelatedList.cmp: c:CustomAttachmentRelatedList:17,75: ParseError at [row,col]:[18,75] Message: The reference to entity "parentname" must end with the ';' delimiter.: Source' @Raul
    – garvi
    Commented Aug 6, 2020 at 16:21
  • The compiler complains about use of ampersand (&) in string, replace it with &amp;, edited the answer to reflect the same
    – Raul
    Commented Aug 6, 2020 at 16:23
  • thanks! working
    – garvi
    Commented Aug 6, 2020 at 16:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .