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
NMNM 

record update using s-control

Hello,
I'm trying to update a field by s-control and then use the printAnything application. It doesn't work. It looks like it stops in the update request. The code is:
 
*****************************************************************************************************************
<script type="text/javascript" src="/soap/ajax/9.0/connection.js" > </script>
<script language=javascript>

var Invoice = new sforce.SObject("Invoice_Object__c");
Invoice.Id= "{!Invoice_Object__c.Id}";
Invoice.Name= "{!Invoice_Object__c.Name}";
Invoice.Amount__c= "{!Invoice_Object__c.Amount__c}";
if(sforce.connection.update([Invoice])[0].getBoolean("success"))
{
window.parent.location.href="{!URLFOR(
$SControl.PRINTANY__PrintAnythingDriver,Event.Id,
[packageId="InvoiceLines", invoiceId=Invoice_Object__c.Id, debug="1"])}";
}
else
{
alert("Problem Updating");
}
</script>
*****************************************************************************************************************
I hope someone has an idea...
Thank you.
CaptainObviousCaptainObvious
You didn't actually make the request to update in your code...
 
The following line is just waiting for the results of the update:
 
if(sforce.connection.update([Invoice])[0].getBoolean("success"))