• A.V.
  • NEWBIE
  • 5 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
I first added this as a comment to the Toolkit main page on the Wiki, but then removed thinking that it is a critical comment and I do not want to offend people that are working hard on the toolkit. I still want to address this question and therefore posting here for discussion.

Regarding the last edition of the Toolkit:
I feel that it is a bit perplexing when Apex Toolkit is declared mandatory tool in order to publish Apex code to production instances and at the same time is unsupported "try and your own risk" type tool. I have used it before, and found it a very good tool. However, it does have bugs and I feel it is lacking transparency and well defined processes to support it. We had issues with new release when due to modified behavior of the toolkit, undesired changes have been pushed into production. That may have been also an overlook in part of our admin, but I feel that better communication, documentation and release notes could help avoid potentially serious production issues. As this tool is becoming a must have for any development it must evolve to become more reliable, well-documented and supported.

Any comments or disagreements on this?

  • September 14, 2007
  • Like
  • 0
Is it possible to leverage lead conversion process in Apex? I did not find any relevant information on this in the documentation.

This is how conversion is done via API, can I do this with Apex Code?

sforce.LeadConvert leadConvert = new sforce.LeadConvert();
...
...
lcr = binding.convertLead(new sforce.LeadConvert[] {leadConvert});
  • August 15, 2007
  • Like
  • 0
I am interested to find out what approaches people have used for handling large recordsets with Apex where the number of rows returned by SOQL and a number of DML statements may hit the current limits.

My use case:
I need to copy child records from one object to another. In 99% of times there is no problem, but occassionally there may be a case when a number of child records exceeds 10,000, which is the current limit.

Right now my code looks something like this (just an example):
Code:
public static void cloneNotes(Id idFrom, Id idTo)
{
Integer counter = 0;
for ( Note[] sourceObjs : [Select Body, Division, IsPrivate, OwnerId, ParentId, Title from Note where ParentId = :idFrom])
{
Note[] targetObjs = sourceObjs.deepClone(false);

for(Note targetObj : targetObjs){
targetObj.ParentId = idTo;
counter++;
}

insert targetObjs;
}

System.debug('DEBUG - Total number of notes copyied: ' + counter);
}

 One solution I can think of is to add a custom field to a child object (Child.AlreadyCloned__c) and set to true for each batch of copied records. Then call the  cloneNotes() as  an anonymous block  until  all records have been cloned.  When done - reset all flags back false. This, however will  require some additional  work to avoid overlappinf if multiple  users are cloning same  records, also this is not efficient due to extra updates....



Any  alternative suggestions  on this one?

  • July 30, 2007
  • Like
  • 0
Is Apex Toolkit for Eclipse supposed to work with API 10.0?

I have Eclipse Toolkit version 8.0.2002 and I get an error when I attempt to use 10.0 API.

It works fine when I specify API version 9.0.  My problem, however, is that for summer 07 release orgs, I am unable to run unit tests within eclipse.

This is the error:

Code:
Failed to send request to https://tapp0-api.salesforce.com/services/Soap/s/9.0
  com.appexchange.plugin.actions.RunTests$1.run (RunTests.java 53)
  org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java 369)
  org.eclipse.jface.operation.ModalContext.run (ModalContext.java 313)
  org.eclipse.jface.dialogs.ProgressMonitorDialog.run (ProgressMonitorDialog.java 479)
  org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run (ProgressMonitorJobsDialog.java 265)
  org.eclipse.ui.internal.progress.ProgressManager.run (ProgressManager.java 1107)
  com.appexchange.plugin.actions.RunTests.run (RunTests.java 69)
  org.eclipse.ui.internal.PluginAction.runWithEvent (PluginAction.java 254)
  org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java 539)
  org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java 488)
  org.eclipse.jface.action.ActionContributionItem$5.handleEvent (ActionContributionItem.java 400)
  org.eclipse.swt.widgets.EventTable.sendEvent (EventTable.java 66)
  org.eclipse.swt.widgets.Widget.sendEvent (Widget.java 928)
  org.eclipse.swt.widgets.Display.runDeferredEvents (Display.java 3348)
  org.eclipse.swt.widgets.Display.readAndDispatch (Display.java 2968)
  org.eclipse.ui.internal.Workbench.runEventLoop (Workbench.java 1930)
  org.eclipse.ui.internal.Workbench.runUI (Workbench.java 1894)
  org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java 422)
  org.eclipse.ui.PlatformUI.createAndRunWorkbench (PlatformUI.java 149)
  org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java 95)
  org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java 78)
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication (EclipseAppLauncher.java 92)
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start (EclipseAppLauncher.java 68)
  org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java 400)
  org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java 177)
  sun.reflect.NativeMethodAccessorImpl.invoke0 (null -2)
  sun.reflect.NativeMethodAccessorImpl.invoke (null -1)
  sun.reflect.DelegatingMethodAccessorImpl.invoke (null -1)
  java.lang.reflect.Method.invoke (null -1)
  org.eclipse.core.launcher.Main.invokeFramework (Main.java 336)
  org.eclipse.core.launcher.Main.basicRun (Main.java 280)
  org.eclipse.core.launcher.Main.run (Main.java 977)
  org.eclipse.core.launcher.Main.main (Main.java 952)

 



  • July 30, 2007
  • Like
  • 0
What is the best appoarch to execute Apex code asynchronously?

I have a scenario where I am copying attachments (with Apex Code) as a result of an Account record update. I would like to perform this in an asynchronous manner so that the UI response is not slowed when processing large attachments...

One way I can think of is with Workflow rules. I have not tried it yet, but I suppose it is possible to specify a time delayed workflow that would update some flag field, which in turn will trigger the code that will execute the code.

Is there a better way to do this?  Once again, my objective is to kick off some code in a trigger but not having to wait for it to complete...

Thank you.
  • July 26, 2007
  • Like
  • 0
I first added this as a comment to the Toolkit main page on the Wiki, but then removed thinking that it is a critical comment and I do not want to offend people that are working hard on the toolkit. I still want to address this question and therefore posting here for discussion.

Regarding the last edition of the Toolkit:
I feel that it is a bit perplexing when Apex Toolkit is declared mandatory tool in order to publish Apex code to production instances and at the same time is unsupported "try and your own risk" type tool. I have used it before, and found it a very good tool. However, it does have bugs and I feel it is lacking transparency and well defined processes to support it. We had issues with new release when due to modified behavior of the toolkit, undesired changes have been pushed into production. That may have been also an overlook in part of our admin, but I feel that better communication, documentation and release notes could help avoid potentially serious production issues. As this tool is becoming a must have for any development it must evolve to become more reliable, well-documented and supported.

Any comments or disagreements on this?

  • September 14, 2007
  • Like
  • 0
Is it possible to leverage lead conversion process in Apex? I did not find any relevant information on this in the documentation.

This is how conversion is done via API, can I do this with Apex Code?

sforce.LeadConvert leadConvert = new sforce.LeadConvert();
...
...
lcr = binding.convertLead(new sforce.LeadConvert[] {leadConvert});
  • August 15, 2007
  • Like
  • 0
Hi, I'm a PHP developer tasked with creating an app for Salesforce.  I've got my work cut out for me. 

First off, I'm going through the language reference and the quick start in particular but there's a problem.  Page 15 hsa instructions for creating my first Apex code program, but it causes an error: "Error: Compile Error: expecting "package", found 'global' at line 1 column 1"

Any help here?

Secondly, I am on my own trying to cobble together an application and it's going OK.  I have a field which is a lookup-relationship with the User object.  I want the choices in that field to be restricted to a subset of users, and I am just not sure where to begin to do this sort of thing.  I'd also like to have a multi-select field related to the User object, in the same way (i.e. a subset of the user object).

If someone can point me in the write direction (like, oh, just write an s-control or put a trigger on it or whatever) I will go through the docs until I figure it out.  I'm just not sure where to start!

thanks,
MB
  • July 31, 2007
  • Like
  • 0
Is Apex Toolkit for Eclipse supposed to work with API 10.0?

I have Eclipse Toolkit version 8.0.2002 and I get an error when I attempt to use 10.0 API.

It works fine when I specify API version 9.0.  My problem, however, is that for summer 07 release orgs, I am unable to run unit tests within eclipse.

This is the error:

Code:
Failed to send request to https://tapp0-api.salesforce.com/services/Soap/s/9.0
  com.appexchange.plugin.actions.RunTests$1.run (RunTests.java 53)
  org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java 369)
  org.eclipse.jface.operation.ModalContext.run (ModalContext.java 313)
  org.eclipse.jface.dialogs.ProgressMonitorDialog.run (ProgressMonitorDialog.java 479)
  org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run (ProgressMonitorJobsDialog.java 265)
  org.eclipse.ui.internal.progress.ProgressManager.run (ProgressManager.java 1107)
  com.appexchange.plugin.actions.RunTests.run (RunTests.java 69)
  org.eclipse.ui.internal.PluginAction.runWithEvent (PluginAction.java 254)
  org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java 539)
  org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java 488)
  org.eclipse.jface.action.ActionContributionItem$5.handleEvent (ActionContributionItem.java 400)
  org.eclipse.swt.widgets.EventTable.sendEvent (EventTable.java 66)
  org.eclipse.swt.widgets.Widget.sendEvent (Widget.java 928)
  org.eclipse.swt.widgets.Display.runDeferredEvents (Display.java 3348)
  org.eclipse.swt.widgets.Display.readAndDispatch (Display.java 2968)
  org.eclipse.ui.internal.Workbench.runEventLoop (Workbench.java 1930)
  org.eclipse.ui.internal.Workbench.runUI (Workbench.java 1894)
  org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java 422)
  org.eclipse.ui.PlatformUI.createAndRunWorkbench (PlatformUI.java 149)
  org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java 95)
  org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java 78)
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication (EclipseAppLauncher.java 92)
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start (EclipseAppLauncher.java 68)
  org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java 400)
  org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java 177)
  sun.reflect.NativeMethodAccessorImpl.invoke0 (null -2)
  sun.reflect.NativeMethodAccessorImpl.invoke (null -1)
  sun.reflect.DelegatingMethodAccessorImpl.invoke (null -1)
  java.lang.reflect.Method.invoke (null -1)
  org.eclipse.core.launcher.Main.invokeFramework (Main.java 336)
  org.eclipse.core.launcher.Main.basicRun (Main.java 280)
  org.eclipse.core.launcher.Main.run (Main.java 977)
  org.eclipse.core.launcher.Main.main (Main.java 952)

 



  • July 30, 2007
  • Like
  • 0