• Weetz
  • NEWBIE
  • 0 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I do not seem to be able to delete a trigger from production using the ANT tool.  I get the following error:
 
    C:\Documents and Settings\rogerh\My Documents\SFDC-APEX>ant delete
    Buildfile: build.xml
    delete:
    [sf:compileAndTest] compileAndTest on https://www.salesforce.com/services/Soap/u/10.0, compiling 0 classes and 0 triggers, deleting 0 classes and 1 triggers
    BUILD FAILED
    C:\Documents and Settings\rogerh\My Documents\SFDC-APEX\build.xml:17: Failed:
    Failed to delete trigger SetLeadCallCount: Not found for delete 'SetLeadCallCount'

    Total time: 4 seconds
 
My build.xml file includes:
    <!-- Cleans up above. (Deletes can be combined with compiles.) -->
    <target name="delete">
        <sf:compileAndTest username="${sf.username}" password="${sf.password}" server="${sf.serverurl}" apiversion="10.0">
            <deleteTrigger>SetLeadCallCount</deleteTrigger>
        </sf:compileAndTest>
    </target>
I called SFDC support and was told that ANT is not supported, although right on the page in Setup->App Setup->Deploy-> Tools it says:

Salesforce-Supported Tools

Apex Deployment Tool  A Java/ANT-based command line utility for scripted deployment of Apex code.
 
Is anyone else having this problem?  My kluge workaround was to basically have the trigger do nothing and redeploy it.  I really want to remove it altogether.
  • May 30, 2008
  • Like
  • 0
I created a custom lookup/reference field in the opportunity record called Registered_By which is a reference to a user record.  The API name for the field is 'Registered_By__c'.  In an S-control, I am trying to update this field with the Id of the user who created the lead that was converted.  The assignment for the Id field is giving me an error: "id value of incorrect type".  Here is the code:
 
var op = new Sforce.Dynabean("Opportunity");
op.set("id", opptId);
op.set("recordtypeid", document.editPage.orecordtype.value );
op.set("Contact_City__c", "{!Lead.City}");
op.set("Contact_Company__c", "{!Lead.Company}");
op.set("Contact_Country__c", "{!Lead.Country}");
op.set("Contact_Email__c", "{!Lead.Email}");
op.set("Contact_First_Name__c", "{!Lead.FirstName}");
op.set("Contact_Last_Name__c", "{!Lead.LastName}");
op.set("Contact_Phone__c", "{!Lead.Phone}");
op.set("Contact_State__c", "{!Lead.State}");
op.set("Contact_Zip_Postal_Code__c", "{!Lead.PostalCode}");
op.set("Contact_Title__c", "{!Lead.Title}");
op.set("Registered_By__c", "{!Lead.CreatedById}");  <- This line causes the error
var sr = op.save();
 
What am I doing wrong?
 
Thanks!
  • February 27, 2007
  • Like
  • 0
I do not seem to be able to delete a trigger from production using the ANT tool.  I get the following error:
 
    C:\Documents and Settings\rogerh\My Documents\SFDC-APEX>ant delete
    Buildfile: build.xml
    delete:
    [sf:compileAndTest] compileAndTest on https://www.salesforce.com/services/Soap/u/10.0, compiling 0 classes and 0 triggers, deleting 0 classes and 1 triggers
    BUILD FAILED
    C:\Documents and Settings\rogerh\My Documents\SFDC-APEX\build.xml:17: Failed:
    Failed to delete trigger SetLeadCallCount: Not found for delete 'SetLeadCallCount'

    Total time: 4 seconds
 
My build.xml file includes:
    <!-- Cleans up above. (Deletes can be combined with compiles.) -->
    <target name="delete">
        <sf:compileAndTest username="${sf.username}" password="${sf.password}" server="${sf.serverurl}" apiversion="10.0">
            <deleteTrigger>SetLeadCallCount</deleteTrigger>
        </sf:compileAndTest>
    </target>
I called SFDC support and was told that ANT is not supported, although right on the page in Setup->App Setup->Deploy-> Tools it says:

Salesforce-Supported Tools

Apex Deployment Tool  A Java/ANT-based command line utility for scripted deployment of Apex code.
 
Is anyone else having this problem?  My kluge workaround was to basically have the trigger do nothing and redeploy it.  I really want to remove it altogether.
  • May 30, 2008
  • Like
  • 0
Hi,
 
Im using ANT Tool to deploy triggers.When i ran the ant deploy command in cmd prompt im getting the following error
 
 
E:\sample>ant deploy -verbose
Apache Ant version 1.7.0 compiled on December 13 2006
Buildfile: build.xml
Detected Java version: 1.6 in: C:\Program Files\Java\jdk1.6.0\jre
Detected OS: Windows XP
parsing buildfile E:\sample\build.xml with URI = file:/E:/sample/build.xml
Project base dir set to: E:\sample
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apach
e/tools/ant/antlib.xml. It could not be found.

 [property] Loading E:\sample\build.properties
 [property] Loading Environment env.
Build sequence for target(s) `deploy' is [deploy]
Complete build sequence is [deploy, delete, ]
deploy:
 [setproxy] Setting proxy to <proxy host>:80
parsing buildfile jar:file:/E:/apache-ant-1.7.0/lib/ant-salesforce.jar!/com/sale
sforce/antlib.xml with URI = jar:file:/E:/apache-ant-1.7.0/lib/ant-salesforce.ja
r!/com/salesforce/antlib.xml
[sf:compileAndTest] Using proxy: <proxy host>:80 user <username> [sf:compileAndTest] compileAndTest on https://www.salesforce.com/services/Soap/u
/12.0, compiling 0 classes and 0 triggers, deleting 0 classes and 0 triggers
[sf:compileAndTest] note: use ant -verbose to get more information on the failur
e
BUILD FAILED
E:\sample\build.xml:14: Failed to login:Unexpected element. Parser was expecting
 element 'urn:partner.soap.sforce.com:organizationId' but found 'urn:partner.soa
p.sforce.com:orgDefaultCurrencyIsoCode'

        at com.salesforce.ant.CompileAndTest.execute(CompileAndTest.java:190)
        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(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a: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(DefaultExe
cutor.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)
Caused by: com.sforce.ws.ConnectionException: Unexpected element. Parser was exp
ecting element 'urn:partner.soap.sforce.com:organizationId' but found 'urn:partn
er.soap.sforce.com:orgDefaultCurrencyIsoCode'
        at com.sforce.ws.bind.TypeMapper.verifyTag(TypeMapper.java:363)
        at com.sforce.ws.bind.TypeMapper.verifyElement(TypeMapper.java:392)
        at com.sforce.soap.partner.GetUserInfoResult.loadFields(GetUserInfoResul
t.java:455)
        at com.sforce.soap.partner.GetUserInfoResult.load(GetUserInfoResult.java
:439)
        at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:564)
        at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:475)
        at com.sforce.soap.partner.LoginResult.loadFields(LoginResult.java:263)
        at com.sforce.soap.partner.LoginResult.load(LoginResult.java:226)
        at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:564)
        at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:475)
        at com.sforce.soap.partner.LoginResponse_element.loadFields(LoginRespons
e_element.java:68)
        at com.sforce.soap.partner.LoginResponse_element.load(LoginResponse_elem
ent.java:59)
        at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:564)
        at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:475)
        at com.sforce.ws.transport.SoapConnection.bind(SoapConnection.java:136)
        at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:11
0)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:92)
        at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.jav
a:1193)
        at com.sforce.soap.partner.PartnerConnection.<init>(PartnerConnection.ja
va:301)
        at com.sforce.soap.partner.Connector.newConnection(Connector.java:27)
        at com.salesforce.ant.CompileAndTest.execute(CompileAndTest.java:120)
        ... 17 more
--- Nested Exception ---
com.sforce.ws.ConnectionException: Unexpected element. Parser was expecting elem
ent 'urn:partner.soap.sforce.com:organizationId' but found 'urn:partner.soap.sfo
rce.com:orgDefaultCurrencyIsoCode'
        at com.sforce.ws.bind.TypeMapper.verifyTag(TypeMapper.java:363)
        at com.sforce.ws.bind.TypeMapper.verifyElement(TypeMapper.java:392)
        at com.sforce.soap.partner.GetUserInfoResult.loadFields(GetUserInfoResul
t.java:455)
        at com.sforce.soap.partner.GetUserInfoResult.load(GetUserInfoResult.java
:439)
        at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:564)
        at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:475)
        at com.sforce.soap.partner.LoginResult.loadFields(LoginResult.java:263)
        at com.sforce.soap.partner.LoginResult.load(LoginResult.java:226)
        at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:564)
        at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:475)
        at com.sforce.soap.partner.LoginResponse_element.loadFields(LoginRespons
e_element.java:68)
        at com.sforce.soap.partner.LoginResponse_element.load(LoginResponse_elem
ent.java:59)
        at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:564)
        at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:475)
        at com.sforce.ws.transport.SoapConnection.bind(SoapConnection.java:136)
        at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:11
0)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:92)
        at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.jav
a:1193)
        at com.sforce.soap.partner.PartnerConnection.<init>(PartnerConnection.ja
va:301)
        at com.sforce.soap.partner.Connector.newConnection(Connector.java:27)
        at com.salesforce.ant.CompileAndTest.execute(CompileAndTest.java:120)
        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(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a: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(DefaultExe
cutor.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)
Total time: 4 seconds
 
This is the first time i'm trying to deploy,so not sure why im getting this error. Is there any thing to do with mutiple currency since multi currencies are enabled in my org.Is it the problem with some classpath.
Any pointers will be of great help.
Thnaks in advance.
  • March 12, 2008
  • Like
  • 0