2

I have just notice that there is a check-box "Use tooling API deploy path when possible" in Eclipse Force.com project settings. See the screenshot:

enter image description here

Can not find any documentation regarding this configuration option. Does this allow to switch between Tooling API and Metadata API?

1 Answer 1

3

Yes, this toggles between using the Tooling API (checked) and the Metadata API (unchecked).

I've found several posts from Nick Chen (Salesforce) confirming this.

Are you deploying through the Tooling API or Metadata API. You can right-click on the Project and then select Force.com > Project Properties. In the dialog that pops-up, select Force.com > Deployment Options to toggle between the two. Source

Found in the source:

DeploymentOptions_UseToolingAPI=Use Tooling API deploy path when possible

Which leads to the UI:

 preferToolingDeploymentCheckbox.setText(UIMessages.getString("DeploymentOptions_UseToolingAPI"));

It terms of actually changing how the deployment occurs. This happens in the BuilderController.

public void build(ComponentList saveComponentList, IProject project, IProgressMonitor monitor) throws Exception {
    ForceProject forceProject =
            ContainerDelegate.getInstance().getServiceLocator().getProjectService().getForceProject(project);

    // If the user has opted for Tooling API and it's applicable, use the faster Tooling API route
    if (forceProject.getPreferToolingDeployment() && isDeployableThroughToolingAPI(saveComponentList, forceProject)) {
        buildThroughTooling(saveComponentList, project, forceProject, monitor);
    } else { // Fallback to the Metadata API that supports all types
        buildThroughMetadata(saveComponentList, project, forceProject, monitor);
    }
}

The API version being deployed needs to meet the minimum version supported by the Tooling API and that all the components meet the requirements for isDeployableThroughContainerAsyncRequest(). The latter being that the tooling API supports all the components being deployed and that those components already exist in Salesforce. The tooling API won't be used to create new components.

7
  • Does it fall back to metadata API if tooling API fails? Curious if the "When Possible" is a poor choice of words or if it actually means what you could infer it means
    – Eric
    Commented Nov 23, 2015 at 2:03
  • there's also some related information here on tooling API issues: salesforce.stackexchange.com/questions/81867/…
    – cropredy
    Commented Nov 23, 2015 at 2:11
  • @Eric I dived a bit deeper into the code. It looks like it will use the Tooling API if - the API version is high enough, all the components are supported by the tooling API, and all the components already exist in Salesforce (have IDs). Commented Nov 23, 2015 at 19:21
  • @Eric It doesn't fallback if it fails; it surfaces an error. The only way to fix the error (today) is to disable the Tooling API deploy path. Fortunately, such bugs are obscure and rare enough that you'd normally want to use the Tooling API.
    – sfdcfox
    Commented Nov 23, 2015 at 19:27
  • @DanielBallinger thank you for such detailed comment. I face some issues with using of Tooling API that I did not see before. For instance if I update local copy from git and Force.com -> Work Online option is set, eclipse deploy local copy and override server copy. With metadata API as a rule it throws and exception like 'There some changes on a server, please refresh from server before save' Do you know is there any difference between Tooling and Metadata in handling of deployment versioning? Commented Nov 25, 2015 at 9:56

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.