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?
- accountId = accID.toLong();
- rec = zoho.crm.getRecordById("Accounts",accID);
- 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");
- contact = zoho.crm.getRelatedRecords("Contacts","Accounts",accountId);
- if(contact.isEmpty())
- {
- return "Error: Please link a contact!";
- }
- for each con in contact
- {
- str = str + "\nContact Name: " + con.get("Full_Name") + "\nContact Number: " + con.get("Phone") + "\nContact Email: " + con.get("Email");
- break;
- }
- return str;