How to add new Line to Button Action

How to add new Line to Button Action

Hey  guys,

Got a very  simple function that looks at an account and returns a basic stack of information for that account that we need to keep our vendor's happy.

The function is simple, it goes into the Account, finds all the data and returns a string.

The only issue is the "\n" (Newline) is not being encoded to <br> on when the button is actioned. I tried \r but that actually returns the string "\r".
Is this a bug or is there another way to implement line breaks?

  1. accountId = accID.toLong();
  2. rec = zoho.crm.getRecordById("Accounts",accID);
  3. str = "Customer Name: " + rec.get("Account_Name") + "\nCustomer Address: " + rec.get("Shipping_Street") + " " + rec.get("Shipping_City") + "\nCustomer Postcode: " + rec.get("Shipping_Code") + "\nCustomer State: " + rec.get("Shipping_State") + "\nCustomer Country: " + rec.get("Shipping_Country");
  4. contact = zoho.crm.getRelatedRecords("Contacts","Accounts",accountId);
  5. if(contact.isEmpty())
  6. {
  7. return "Error: Please link a contact!";
  8. }
  9. for each  con in contact
  10. {
  11. str = str + "\nContact Name: " + con.get("Full_Name") + "\nContact Number: " + con.get("Phone") + "\nContact Email: " + con.get("Email");
  12. break;
  13. }
  14. return str;