• sanket mahajan 1
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 13
    Replies
any simple setting to bypass validation rule?
Hi Team,

How can we hide the below options for a user.? Please suggest.

User-added imageThanks,
Pradeep
 
Hello, 
I can't get the terminal to recognize my ant path. I get the message "'ant' is not recognized as an internal or external command, operable program or batch file.

I have the apache-ant-1.10.1 and salesforce_ant_39.0 files in this location: C:\Users\DJensen\Ant

My ANT_HOME is set up as: C:\Users\DJensen\Ant\apache-ant-1.10.1

I've tried several different paths, but just can't seem to get it to work. Any help would be greatly appreciated. 

I'm using windows 7.
Hi all,

I am trying to setup my build.xml to reference the ant-salesforce.jar from my project checkout. The directory structure is similar to this:
Project Dir
>src
>ant-salesforce.jar
>build.xml

I am trying to reference the ant-salesforce.jar from the root directory of the project in my build.xml as shown below:
<project name="Test" default="test" basedir=".">

	<property environment="env"/>

	<taskdef resource="com/salesforce/antlib.xml">
      <classpath>
          <pathelement location="./ant-salesforce.jar" />
      </classpath>
  </taskdef>

	<target name="retrieve">
		<sf:retrieve username="${SRC_USERNAME}" password="${SRC_PASSWD}" serverurl="${SRC_URL}" retrieveTarget="src" unpackaged="src/package.xml"/>
	</target>

	<target name="deployValidate">
		<sf:deploy username="${DEST_USERNAME}" password="${DEST_PASSWD}" serverurl="${DEST_URL}" deployRoot="src" rollbackOnError="true" checkonly="true"/>
	</target>

	<target name="deploy">
		<sf:deploy username="${DEST_USERNAME}" password="${DEST_PASSWD}"    serverurl="${DEST_URL}" deployRoot="src" rollbackOnError="true" />
	</target>
</project>

However, it keeps giving me the following error:
build.xml:12: The prefix "sf" for element "sf:retrieve" is not bound.

Am I missing something when including the reference to the ant-salesforce.jar?

Any help would be appreciated.

Thanks
Hi All,
Can any one help me for ANT setup and configuration step by step process 
It is urgent to our end, I have to deploy through the ANT tool only.

Thanks 
Bheem
I am building a continuous delivery pipline with ant migration tool and encounted one issue. where do I put ant-salesforce.jar? I can't put it in apache-ant lib folder on host because host created on demand. I was hoping I can specify its locatoin in build.xml file. I took sample build.xml file to try:
build.xml:
    <taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
        <classpath>
            <pathelement location="../ant-salesforce.jar" />
        </classpath>
    </taskdef>

It doesn't work when running ant tool. it complanins about ant-salesforce.jar is not a JAR.
Can someone suggest a solution?
Thanks!
Lin 
Hi All,
How I can Setup ANT Tool can anyone give the Steps?
Advance Thanks

Regards,
Rajesh
 

Hi all,

 

Trying to get the Force.com Migration Tool setup.

 

Running it on Ubuntu (on a Linode).

 

Whenever I try and deploy the sample package, I get the following error:

 

BUILD FAILED
/home/tcarman/Salesforce/Files/sample/build.xml:46: Failed to login: Failed to send request to https://login.salesforce.com/services/Soap/u/24.0

 

 

Checked, double checked, and triple checked the username/password/URL in build.properties. Even tried putting the values directly into the build.xml and bypassing the build.properties alltogether....no luck. Yep - I'm using the security token.

 

Given SFDC shows nothing in login history, I don't think its an issue with the credentials. 

 

Perhaps Proxy issue? I don't know if Linode boxes require any special settings - and if so I can't find anywhere.

 

Also I'm pretty new to linux, so could be something silly I have missed.

 

Any advice, hugely appreciated :)

 

 

I have a Hierarchy Custom setting with one field IsProcessed.

 

My batch apex will run only when the value of  IsProcessed is true. After processing I need to update the value to false. I doubt whether it is possible.

 

Is there a way I can update a custom setting field value using apex.

 

Appreciate your help.

I've created a hierarchical Custom Setting.  I'm looking to modify a field at the org level.

 

Given that my custom setting is called Test_config__c, and the field I want to update is Sample_field__c, here is some sample code:

 

 

Test_config__c aConfig = Test_config__c.getOrgDefaults();

aConfig.Sample_field__c = 'Some new value';

 

 

When I manage the custom value, the assignment hasn't been persisted.

 

 

Experts,

 

I have a situation where based on where the Update is executed from, I got to decide on whether to execute or bypass the trigger. In conventional programming languages, I would have accomplished this by a context or an instance variable.

 

I am relatively new to Apex and could not get my head around on the best way to achieve this. Any ideas are welcome!

 

Thanks!

Pr@sh...

 

Hi,
 
I am trying to deploy an Apex Triiger and its related test class to production from sandbox. I am using Ant script for doing this. I get the following proxy authentication required error when I run ant deploy.
 
Error from ant deploy:

C:\workzone\Salesforce-ant\sample>ant -verbose deploy
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_01\jre
Detected OS: Windows XP
parsing buildfile C:\workzone\Salesforce-ant\sample\build.xml with URI = file:/C
:/workzone/Salesforce-ant/sample/build.xml
Project base dir set to: C:\workzone\Salesforce-ant\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 C:\workzone\Salesforce-ant\sample\build.properties
 [property] Loading Environment env.
 [setproxy] Setting proxy to XXXXXXXX:8080
Build sequence for target(s) `deploy' is [deploy]
Complete build sequence is [deploy, deployUnpackaged, retrieveUnpackaged, test,
]
deploy:
parsing buildfile jar:file:/C:/apache-ant-1.7.0/lib/ant-salesforce.jar!/com/sale
sforce/antlib.xml with URI = jar:file:/C:/apache-ant-1.7.0/lib/ant-salesforce.ja
r!/com/salesforce/antlib.xml
[sf:compileAndTest] Using proxy: XXXXXXX:8080
[sf:compileAndTest] compileAndTest on https://www.salesforce.com/services/Soap/u
/11.0, compiling 1 classes and 1 triggers, deleting 0 classes and 0 triggers
[sf:compileAndTest] note: use ant -verbose to get more information on the failur
e
BUILD FAILED
C:\workzone\Salesforce-ant\sample\build.xml:34: Failed to login:Failed to send r
equest to https://www.salesforce.com/services/Soap/u/11.0
        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: Failed to send request to https://
www.salesforce.com/services/Soap/u/11.0
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:95)
        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
Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns "H
TTP/1.0 407 Proxy Authentication Required"
        at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnec
tion.java:1425)

        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(AbstractDelegateHttpsURLConnection.java:168)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLCo
nnection.java:836)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Htt
psURLConnectionImpl.java:230)
        at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.jav
a:115)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:88)
        ... 21 more
--- Nested Exception ---
com.sforce.ws.ConnectionException: Failed to send request to https://www.salesfo
rce.com/services/Soap/u/11.0
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:95)
        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)
Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns "H
TTP/1.0 407 Proxy Authentication Required"
        at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnec
tion.java:1425)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(AbstractDelegateHttpsURLConnection.java:168)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLCo
nnection.java:836)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Htt
psURLConnectionImpl.java:230)
        at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.jav
a:115)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:88)
        ... 21 more
Total time: 1 second
C:\workzone\Salesforce-ant\sample>
 
Buld.xml
<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce">
    <property file="build.properties"/>
    <property environment="env"/>
    <setproxy proxyHost="${proxy.host}" proxyPort="${proxy.port}" />
    <!-- Test out deploy and retrieve verbs for package 'mypkg' -->
    <target name="test">
      <!-- Upload the contents of the "mypkg" package -->
      <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployroot="mypkg"/>
      <mkdir dir="retrieveOutput"/>
      <!-- Retrieve the contents into another directory -->
      <sf:retrieve username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" retrieveTarget="retrieveOutput" packageNames="MyPkg"/>
    </target>
    <!-- Retrieve an unpackaged set of metadata from your org -->
    <!-- The file unpackaged/package.xml lists what is to be retrieved -->
    <target name="retrieveUnpackaged">
      <mkdir dir="retrieveUnpackaged"/>
      <!-- Retrieve the contents into another directory -->
      <sf:retrieve username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" singlePackage="true" retrieveTarget="retrieveUnpackaged" unpackaged="unpackaged/package.xml"/>
    </target>
    <!-- Deploy the unpackaged set of metadata retrieved with retrieveUnpackaged -->
    <target name="deployUnpackaged">
      <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployroot="retrieveUnpackaged" singlePackage="true"/>
    </target>
 <target name="deploy">
        <sf:compileAndTest
            username="${sf.username}"
            password="${sf.password}"
            server="${sf.serverurl}"
            apiversion="11.0"
            baseDir=".">
            <runTests>
                <class>compileAndTest</class>
            </runTests>
         </sf:compileAndTest>
</target>
</project>
 
I tried the following to set the following in build.xml file for retrieving the proxy userid and password, but did not work, probably due to wrong syntax:
 
<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce">
    <property file="build.properties"/>
    <property environment="env"/>
    <setproxy proxyHost="${proxy.host}" proxyPort="${proxy.port}"  proxyUser="${proxy.user}"  proxyPassword="${proxy.password}" />
 
If anyone can please figure out how to set the proxyuser and password, that will be greatly appreciated.
 
Thanks,
Ambili


Message Edited by arasu on 02-11-2008 10:25 AM

Message Edited by arasu on 02-11-2008 10:26 AM
  • February 11, 2008
  • Like
  • 0