View Full Version : unterminated string literal

10-06-2008, 12:03 PM
This is the actual case!

This code is behind a button, therefore using an OnClick event the instance of the present Account (i mean Account currently load to view), can be extracted using the script and passed on to another method for further processing.

I can pass all the fields indicated in the script apart from street. To be honest, dont knw if it is break or the lenght i am meant to control, am getting this error;

A problem with the OnClick JavaScript for this button or link was encountered:
unterminated string literal

Below is the original Code;

if (con == true){
var Account = sforce.Xml();

var IDC = "{!Account.BillingStreet}";
var IDC = "{!Account.Id}";
var naC = "{!Account.Name}";
var cityC = "{!Account.BillingCity}";
var pcodeC = "{!Account.BillingPostalCode}";
var stateC = "{!Account.BillingState}";
var countryC = "{!Account.BillingCountry}";

var action = sforce.apex.execute("APiBilling","createBill", {ID: IDC, na: naC, street: streetC, city: cityC, pcode: pcodeC, state:stateC, country: countryC});

{alert("Successfully Cancelled");}
catch (ex)
alert ("Failed : " + ex);

Need your help experts! like i said the issue is around Street! Do i need to do anything to it?