function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Beth WalterBeth Walter 

Visual Force Page Errors

This is all new to me. I don't know why I am getting error messages. Can someone please help fix the issue. 

Error: Send_Email line 37, column 17: The element type "apex:page" must be terminated by the matching end-tag "</apex:page>"
Error: The element type "apex:page" must be terminated by the matching end-tag "</apex:page>".

<apex:page>

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}

{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}

{!REQUIRESCRIPT("/js/functions.js")}

 

sforce.debug.trace=true;

 

var records = {!GETRECORDIDS( $ObjectType.Ticket__c )};

 

if(records[0] == null)

{

alert("Please select at least one record.")

}

else

{

 

try

{

for(var i=0; i</records.length>; i++)

{

var objTicket = new sforce.SObject("Ticket__c");

objTicket.Id = records[i];

objTicket.Email_Ticket__c=true;

var saveRes=sforce.connection.update([objTicket]);

}

if (saveRes[0].success=='false')

{

alert(saveRes[0].errors.message);

}

}

catch(error)

{

alert("Error while Sending Email:=="+error);

}

}

</apex:page>
NagendraNagendra (Salesforce Developers) 
Hi Beth,

Sorry for this issue you are facing.

May I suggest you please give a try by using below code and let us know if it works for you.
<apex:page>
{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}
{!REQUIRESCRIPT("/js/functions.js")}
sforce.debug.trace=true;
var records = {!GETRECORDIDS( $ObjectType.Ticket__c )};
if(records[0] == null)
{
alert("Please select at least one record.");
}
else
{
try
{
for(var i=0; i</records.length>; i++)
{
var objTicket = new sforce.SObject("Ticket__c");
objTicket.Id = records[i];
objTicket.Email_Ticket__c=true;
var saveRes=sforce.connection.update([objTicket]);
}
if (saveRes[0].success=='false')
{
alert(saveRes[0].errors.message);
}
}
Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra
 
Beth WalterBeth Walter
I put your exact code in the page and it came up with this error again. 

Error: Send_Email line 14, column 17: The element type "apex:page" must be terminated by the matching end-tag "</apex:page>"
Error: The element type "apex:page" must be terminated by the matching end-tag "</apex:page>".
v varaprasadv varaprasad
Hi Beth

Add following tag end of the page </apex:page>

After this : 

alert(saveRes[0].errors.message);
}
}
</apex:page>

I have one doubt regarding this functionality this page you are calling in any button or completely vf page.
Please let me know your requirement so that we can help you accordingly.

Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

Thanks
Varaprasad
@For Salesforce Project Support: varaprasad4sfdc@gmail.com

Salesforce latest interview questions  :
https://www.youtube.com/channel/UCOcam_Hb4KjeBdYJlJWV_ZA?sub_confirmation=1
Beth WalterBeth Walter
Varaprasad, I want to create a button that allows me to email a Ticket to a customer.  

This is what I have now. I am still getting error messages. 

Error: Send_Email line 15, column 16: The element type "apex:page" must be terminated by the matching end-tag "</apex:page>"
Error: The element type "apex:page" must be terminated by the matching end-tag "</apex:page>".


<apex:page>
{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}
{!REQUIRESCRIPT("/js/function.js")}
sforce.debug.trace=true;
var records = {!GETRECORDIDS($ObjectType.Ticket__c)};
if(records[O]==null)
{
alert("Please select at least one record.");
}
else
{
try
{
for(var i=O;i</records.length>;i++)
{
var objTicket = new sforce.SObject("Ticket__c");
objTicket.Id = records[i];
objTicket.Email_Ticket__c=true;
var saveRes=sforce.connection.update([objTicket]);
}
if(saveRes[O].success=='false')
{
alert(saveRes[O].errors.message);
}
}
</apex:page>