Giter VIP home page Giter VIP logo

force.com-toolkit-for-net's Introduction

Ben Duguid works in London, UK as Head of Development for Hugo & Cat, mostly delivering web sites on various Microsoft based platforms.

He has run internal training sessions helping other developers get up to speed in the technologies he knows about, and tries hard to get others to do the same.

For what it's worth he is currently a Pro-Tem Mod on Bricks - a Stack Exchange site for LEGO and building block enthusiasts.

force.com-toolkit-for-net's People

Contributors

alecdtucker avatar avesse avatar bluephlame avatar bregger avatar brentannelson avatar broctopolis avatar bslaterffdc avatar christianpeterek avatar dagood avatar dcarroll avatar eli-precisionlender avatar gnjack avatar jasonrowe avatar johnmigas avatar johntrenwith avatar jrsteele23 avatar marknadig avatar mnltejaswini avatar newky2k avatar samtrost-avalara avatar shankararunachalam avatar shanselman avatar sheilak avatar tennyleaz avatar tugberkugurlu avatar vinickgold avatar wadewegner avatar wharri220 avatar zgramana avatar zhaph avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

nelsonngm

force.com-toolkit-for-net's Issues

Error field attributes are inverted in XML ForceException

From Force.com-Toolkit-for-NET created by Zhaph : wadewegner#332

When handling a bulk job which uses the XML serializer, the ForceException is created with an Error of Unknown and the Message contains the error code from the API.

This appears to be because in the Error Response class the Xml attributes are reversed:

    [XmlElement(ElementName = "exceptionCode")]
    [JsonProperty(PropertyName = "message")]
    public string Message;

    [XmlElement(ElementName = "exceptionMessage")]
    [JsonProperty(PropertyName = "errorCode")]
    public string ErrorCode;

If these were in line with the JsonProperty attributes, the Error would be correctly parsed and the message would be meaningful when the XML parser is used (i.e. in Bulk Upsert operations):

try {
  var results = await client.RunJobAndPollAsync("Contact", BulkConstants.OperationType.Upsert,
                    new List<SObjectList<Contact>> {batch});
}
catch (ForceException fe) {
  Console.Log($"{fe.Error} - {fe.Message}");
  // Logs: "Unknown - InvalidJob" when it should be:
  // "InvalidJob - External ID was blank for Contact. An External ID must be specified for upsert"
}

NuGet Version of DeveloperForce.Force: 2.0.7

Bulk Upsert throws an exception - InvalidJob

From Force.com-Toolkit-for-NET created by Zhaph : wadewegner#331

As per wadewegner#285 when I create a Bulk job with the action of BulkConstants.OperationType.Upsert the library throws an exception:

  • Error: Unknown
  • Message: InvalidJob

I've updated our Contact object in salesforce to include a new field Unique_Email__c, specified as Unique and External ID and I'm trying to bulk insert and update contacts from a 3rd party system:

var results = await client.RunJobAndPollAsync("Contact", BulkConstants.OperationType.Upsert,
                    new List<SObjectList<Contact>> {batch});

Using fiddler to inspect the traffic, the actual issue returned by the Salesforce API is:

<?xml version="1.0" encoding="UTF-8"?>
<error xmlns="http://www.force.com/2009/06/asyncapi/dataload">
  <exceptionCode>InvalidJob</exceptionCode>
  <exceptionMessage>External ID was blank for Contact. An External ID must be specified for upsert.</exceptionMessage>
</error>

Based on the following request:

<?xml version="1.0" encoding="utf-16"?>
<jobInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.force.com/2009/06/asyncapi/dataload">
  <operation>upsert</operation>
  <object>Contact</object>
  <contentType>XML</contentType>
</jobInfo>

I believe I need to be able to specify the ExternalId Field as per this post https://developer.salesforce.com/forums/?id=906F00000008sEBIAY

<?xml version="1.0" encoding="UTF-8"?>
<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
  <operation>upsert</operation>
  <object>Foo__c</object>
  <externalIdFieldName>myExtId__c</externalIdFieldName>
  <contentType>CSV</contentType>
</jobInfo>

Note also that at the time that was written, the contentType element needed to be the last element in the request.

NuGet Version of DeveloperForce.Force: 2.0.7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.