• claudio
  • NEWBIE
  • 35 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hi there, I've created a public class called SponsorshipMaintenance that has a public method UpdateSponsorshipCountry. Looks like this:

public class SponsorshipMaintenance {
   
    public void UpdateSponsorshipCountry(List<Sponsorship__c> Sponsorships, List<Id> ChildIds){
          // .... some code here
   }

}

The class compiles with no errors. When I try to compile a trigger that has a call to the UpdateSponsorshipCountry method, I get the message "method does not exist or incorrect signature" on the line that calls the method. The trigger looks like this:

trigger SponsorshipSetCountry on Sponsorship__c (before insert, before update) {   
    //get list of sponsored child Ids of new sponsorships
    Id[] SponsoredKids = new Id[]{};
    for (Sponsorship__c spons : Trigger.new){
        SponsoredKids.add(spons.Child__c);   
    }
   
    //call method to set the correct country on the sponsorship objects
    SponsorshipMaintenance.UpdateSponsorshipCountry(Trigger.New,SponsoredKids); //this is the line that's generating the error. If I comment it out, the trigger compiles.
}

Any guidance would be most appreciated. Thank you!

  • October 21, 2007
  • Like
  • 0
Hi,

Using the Flex Toolkit we can call any Apex class/method exposed as a web service, using a single execute() method. Like the following example:

<salesforce:Connection id="apex" />

apex.execute("ClassName", "methodName", [param], asyncResponder);

Is it possible to do something similar in Java, without having to generate the WSDL and Java client code for each Apex Class?

Thanks,

Claudio
Hi,

I developed a Trigger and a test method using a sandbox org (the test method gave me 90% of code cover). After that I retrieved the trigger and test class using the ant tool. But when I  try to deploy to the "production org", I get the error:

BUILD FAILED
/home/claudio/deploy/sample/build.xml:25: Failures:

        at com.salesforce.ant.DeployTask.handleResponse(DeployTask.java:88)
        at com.salesforce.ant.SFDCMDAPIAntTaskRunner.runTask(SFDCMDAPIAntTaskRunner.java:107)
        at com.salesforce.ant.DeployTask.execute(DeployTask.java:37)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
 
If I try to deploy to a "developer org" it works fine.

Any help?

Thanks,

Claudio
Hi there, I've created a public class called SponsorshipMaintenance that has a public method UpdateSponsorshipCountry. Looks like this:

public class SponsorshipMaintenance {
   
    public void UpdateSponsorshipCountry(List<Sponsorship__c> Sponsorships, List<Id> ChildIds){
          // .... some code here
   }

}

The class compiles with no errors. When I try to compile a trigger that has a call to the UpdateSponsorshipCountry method, I get the message "method does not exist or incorrect signature" on the line that calls the method. The trigger looks like this:

trigger SponsorshipSetCountry on Sponsorship__c (before insert, before update) {   
    //get list of sponsored child Ids of new sponsorships
    Id[] SponsoredKids = new Id[]{};
    for (Sponsorship__c spons : Trigger.new){
        SponsoredKids.add(spons.Child__c);   
    }
   
    //call method to set the correct country on the sponsorship objects
    SponsorshipMaintenance.UpdateSponsorshipCountry(Trigger.New,SponsoredKids); //this is the line that's generating the error. If I comment it out, the trigger compiles.
}

Any guidance would be most appreciated. Thank you!

  • October 21, 2007
  • Like
  • 0
I've created a class which will be instantiated multiple times in the trigger I'm working on, and I want to create a list or map of those custom objects.

In order to do that do I need to turn my class into an implementation of an interface?

That seems to be what the language reference is saying, but then on pg. 120 it says:

"Lists and maps can be used with classes and interfaces, in the same ways that lists and maps can be used with SObjects"

This is somewhat vague, but it seems to be hinting that perhaps there's a way to make a collection of instances of a standard class, as opposed to an interface-implementing class?  I could use some help grokking the whole "Classes and Collections" section on that pg.

If I do need to use an interface, does this add overhead to all of the apex code in my enviornment?  Since there's no equivalent of an import or include statement, I would assume that any class defined as an interface is included in every piece of code compiled?  Or does it only compile it in as needed?

Thanks much!
  • October 16, 2007
  • Like
  • 0
I want to install the APEX/AJAX toolkit for eclipse.  Which is the correct Eclipse IDE download for use with Version 10.0 of the API.  I was looking on the eclipse website under the download section, but isn't very clear to me, which download I need.  The eclipse classic download shows the 3.3.1 SDK, but the APEX toolkit shows the requirement as 3.2.2 and I do not see that version as a download on the Eclipse site unless I just don't see it?
Unable to install the Apex Toll kit for my Eclipse Version: 3.3.1
 
I did it as per the step by step procedure provided in the salesforce ADN page on eclipse toolkit..
But I get the following error message:
 
"Network connection problems encountered during search.
  Unable to access "
http://www.adnsandbox.com/eclipsetoolkit/10.0/".
    Error parsing site stream. [Premature end of file.]
    Premature end of file."
    
 
Also I get a message:
 
"No features found on the selected sites. choose a different site or site catogory"
 
Could you please provide me a solution....
Thanks in advance,
Krishna