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
LosintikfosLosintikfos 

External Service

Hi Experts,

I am using a button which is using a javascript to invoke an apex class. Basically i want to update my external database using the Apex class. But if click on the button i get an exception: args not specified.

JavaScript
=========
try{
var con = confirm("Are you sure you want to create Northstar account for this user?")
if (con)
var action = sforce.apex.execute("APiNorthstar","addAccount");
}
catch (exception)
{
alert ("Failed : " + exception);
}

Apex Class
=========
public class APiNorthstar {

public static void addAccount(){

//Get new Account
Account accs = new Account();

comNorthstarApi.NorthstarServiceHttpSoap11Endpoint stub = new
comNorthstarApi.NorthstarServiceHttpSoap11Endpoint();
String Id = accs.Id;
String name = accs.name;
String acc = accs.Account_Alias__c;
Boolean setName = stub.setNa(name);
Boolean setAccountAlias = stub.setAcca(acc);
}
}

Do anyone know why this? please help!



Message Edited by Losintikfos on 07-31-2008 07:09 AM
ShamSham
I guess you must specify an empty args array.
Try this
var action = sforce.apex.execute("APiNorthstar","addAccount",args:{});