Syntax errors don't show on correct line
Hi Zoho,
I've noticed that I get "improper statement" errors with unhelpful line numbers.
E.g. try compiling some code like this:
- //send out editorial writer emails
- for each booking in input.Edition_Bookings
- {
- //check whether an email has already been sent to this writer
- writer_obj = Editorial_Writer[ID == booking.Editorial_Writer];
- writer_email_address=writer_obj.Email;
- email_sent_to=booking.Email_sent_to_editor_email;
- if(email_sent_to != writer_email_address)
- {
- //either no email has been sent to any writer, or the editorial writer has been changed
- //therefore send out email
- booking.Email_sent_to_editor_email=writer_email_address;
- //retrieve email template
- template_HTML = Email_Template[Template_Name == "Editorial Writer Assignment"].Template_Content;
- //replace shortcodes with variables
- template_HTML = template_HTML.replaceAll("<writer name>",writer_obj.Name,false);
- template_HTML = template_HTML.replaceAll("<Client Name>",booking.Advertiser_Name,false);
-
- template_HTML = template_HTML.replaceAll("<Client Contact>",booking.Advertiser_Contact,false);
- template_HTML = template_HTML.replaceAll("<Client Mobile>",booking.Advertiser_Phone,false);
- template_HTML = template_HTML.replaceAll("<Client Email>",booking.Advertiser_Email,false);
- template_HTML = template_HTML.replaceAll("<Publication Name>",booking.Publication_Name,false);
- template_HTML = template_HTML.replaceAll("<Special Instructions>",booking.Special_Instruction,false);
- template_HTML = template_HTML.replaceAll("<Copy in due date>",booking.Copy_Due,false);
- template_HTML = template_HTML.replaceAll("<Photograph Required>",booking.Photograph_required,false);
- template_HTML = template_HTML.replaceAll("<approximate word count>",booking.Approx_Word_Count,false);
-
- sendmail
- [
- From : "molly@morningtonlife.com.au"
- To : writer_email_address
- Subject : "Congrats! You've been selected to write an editorial for " + booking.Advertiser_Name
- Message : template_HTML
- ];
- }
- }
- //send out proof check email if new proof added
- for each proof_upload_id in input.Proof_21
- {
- proof_upload = Proof_Upload[ID == proof_upload_id];
- if (!proof_upload.Emailed_to_advertiser)
- {
- //get advertiser email
- client_account_obj = zoho.crm.getRecordById(("Accounts"), input.Client_Account_ID);
- advertiser_email = (client_account_obj).get("Email");
-
- //retrieve email template
- template_HTML = Email_Template[Template_Name == "Proof Check Email"].Template_Content;
- //replace shortcodes with variables
- template_HTML = template_HTML.replaceAll("<advertiser name>",input.Client_Account,false));
- proof_link = "<a href='" + proof_upload.Dropbox_Link + "'>here</a>";
- template_HTML = template_HTML.replaceAll("<proof link>",proof_link,false));
- //get publication details
- booking_obj = Edition_Booking[ID == proof_upload.Edition_Booking];
- template_HTML = template_HTML.replaceAll("<publication name>",booking_obj.Publication_Name,false));
- pub_date_obj = Publication_Date[ID == booking_obj.Publication_Date];
- template_HTML = template_HTML.replaceAll("<publication date>",pub_date_obj.Publication_Date,false));
- //add approve link using CSS button generator for format
- approve_link = "<a href=\"https://creator.zoho.com/bigbangmedia/big-bang-media-p-l-advertising-agreement/view-embed/Approve_Proof/proof_id=" + proof_upload_id + "\" class=\"approve_proof_button\">Approve Proof</a>";
- template_HTML = template_HTML.replaceAll("<approve link>",approve_link,false));
-
- sendmail
- [
- From : "molly@morningtonlife.com.au"
- To : advertiser_email
- Subject : "Please give feedback on your updated proof for publication in " + booking_obj.Publication_Name
- Message : template_HTML
- ];
- }
- }
There is a bug with the replaceAll calls. They have two closing brackets )) instead of one. The error number should thus be on line 51. But it shows at line 39 at the start of a for statement.