function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ChrisLivelyChrisLively 

For Delphi 7 developers

This is an FYI.  After 2 days of much pounding and gnashing of teeth I finally managed to get the Enterprise WSDL to work with D7.  There are two problems.  The first problem, and by far easiest to figure out, occurred during the initial WSDL import.  Make sure you UNCHECK "Do not emit unused types" in the Other Options section.  If you don't do this then you won't get the object declarations for Accounts, Contacts, etc.

The second, and by far most ludicrous, issue is the declaration for the QueryResult object.  It is just flat wrong.  Below is the correct declaration.  Note that the additional constructor, two functions, two properties, and change of datatype for the Frecords field.  Copy the code for them straight from the retrieveResponse object declaration.

  QueryResult = class(TRemotable)
  private
    Fdone: Boolean;
    FqueryLocator: QueryLocator;
    Frecords: sObjects;
    Fsize: Integer;
  public
    constructor Create; override;
    destructor Destroy; override;
    function   GetsObjectArray(Index: Integer): sObject;
    function   GetsObjectArrayLength: Integer;
    property   sObjectArray[Index: Integer]: sObject read GetsObjectArray; default;
    property   Len: Integer read GetsObjectArrayLength;
  published
    property done: Boolean read Fdone write Fdone;
    property queryLocator: QueryLocator read FqueryLocator write FqueryLocator;
    property records: sObjects read Frecords write Frecords;
    property size: Integer read Fsize write Fsize;
  end;

If you need any help let me know,

Chris Lively
http://www.livelyconsulting.com

adamgadamg
Thanks Chris!
FernandoKFernandoK

Greetings Chris,

 

Hope you're still on after these almost 10 (!) years... I'm logging in ok into SF using D2010, but when I fetch an Opportunity, for instance, ID comes totally screwed up, and I guess it's something related to WSDL imported pas...

 

I reached your post, but due to time, I don't have the code for retrieveResponse. Could you please post your corresponding QueryResult.GetsObjectArray and QueryResult.GetsObjectArrayLength code ? Or even better, the complete enterprise.pas unit somehow ?

 

Thank you!

 

Fernando