• rjk
  • NEWBIE
  • 0 Points
  • Member since 2003

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
My API 2.0 documentation lists customFieldDefinition as a supported entity type. However, when I do a global describe, this entity type is not in the returned list. Is this entity type still available through the Sforce API? The user I am logging in as has the System Administrator profile.
  • December 03, 2003
  • Like
  • 0
Here's the new version of the Sforce::Sfdc module.

http://www.focalex.com/sforce/Sforce-Sfdc-0.04.tar.gz

Changes:

Added $Sforce::Sfdc::err and the err() method for access to Sforce numeric fault codes
Added print_error and raise_error options, as in DBI
Added private _error() method for setting errors and handling print_error and raise_error
Added wantarray() support to query() method
Added and updated tests
Updated documentation


Please download it, try it out, and send me your feedback.

Issues I'm currently thinking about:

1) Switching from XML-RPC to SOAP, as Salesforce has said they'll be focusing development on the SOAP API from now on.

2) Should the error message resulting from raise_error and print_error include the numeric fault code in addition to the error string? That will make looking up errors in the documentation easier.

3) More featues that I should add. Suggestions?


Thanks to Ron Hess and anagram for feedback and patches!
  • November 26, 2003
  • Like
  • 0
An application of ours broke because the query call is no longer working as expected. Specifically, the operators 'starts with' and 'contains' do not appear to be matching any values. When we do a 'starts with' query, we get nothing back, and when we do a negated 'starts with' query, we get everything back.

Has anyone else observed this behavior?
  • November 24, 2003
  • Like
  • 0
I have packaged up version 0.03 of my new Perl implementation for Sforce, which I have named Sforce::Sfdc. My company is releasing this code as free software under the LGPL.

Sforce::Sfdc inherits from XMLRPC::Lite, and was based on the code posted here by Ron Hess. It is object-oriented and should be both platform-independent and interface-independent.


http://www.focalex.com/sforce/Sforce-Sfdc-0.03.tar.gz


Please download the module, check it out, and give me feedback. I'm especially looking for feedback on the following issues:

1) The name of the module. Maybe it should be XML::Sforce, or Sforce::XMLRPC, or...

2) Anything I did that is bad practice in terms of XML and XML-RPC. I have very little experience in that area.

3) The interface for the helper methods, e.g. login(username => $username, password => $password). Should I just make that login($username, $password)? What about the more complicated methods, such as query()?

4) Bugs, of course.

5) Features that would be useful to have.


I'll post the current documentation as a reply to this message.


enjoy!
Ronald
  • November 14, 2003
  • Like
  • 0
Here's the new version of the Sforce::Sfdc module.

http://www.focalex.com/sforce/Sforce-Sfdc-0.04.tar.gz

Changes:

Added $Sforce::Sfdc::err and the err() method for access to Sforce numeric fault codes
Added print_error and raise_error options, as in DBI
Added private _error() method for setting errors and handling print_error and raise_error
Added wantarray() support to query() method
Added and updated tests
Updated documentation


Please download it, try it out, and send me your feedback.

Issues I'm currently thinking about:

1) Switching from XML-RPC to SOAP, as Salesforce has said they'll be focusing development on the SOAP API from now on.

2) Should the error message resulting from raise_error and print_error include the numeric fault code in addition to the error string? That will make looking up errors in the documentation easier.

3) More featues that I should add. Suggestions?


Thanks to Ron Hess and anagram for feedback and patches!
  • November 26, 2003
  • Like
  • 0
I have packaged up version 0.03 of my new Perl implementation for Sforce, which I have named Sforce::Sfdc. My company is releasing this code as free software under the LGPL.

Sforce::Sfdc inherits from XMLRPC::Lite, and was based on the code posted here by Ron Hess. It is object-oriented and should be both platform-independent and interface-independent.


http://www.focalex.com/sforce/Sforce-Sfdc-0.03.tar.gz


Please download the module, check it out, and give me feedback. I'm especially looking for feedback on the following issues:

1) The name of the module. Maybe it should be XML::Sforce, or Sforce::XMLRPC, or...

2) Anything I did that is bad practice in terms of XML and XML-RPC. I have very little experience in that area.

3) The interface for the helper methods, e.g. login(username => $username, password => $password). Should I just make that login($username, $password)? What about the more complicated methods, such as query()?

4) Bugs, of course.

5) Features that would be useful to have.


I'll post the current documentation as a reply to this message.


enjoy!
Ronald
  • November 14, 2003
  • Like
  • 0

The guts of my sforce perl class is the serializer , it's sublcassed from XMLRPC which does most of the work, however the array,value,dateTime and hash need to be formed slightly different to pass to sforce.

here is the serializer package

#####################################
package  Sfdc::Serializer;
@Sfdc::Serializer::ISA = qw(XMLRPC::Serializer) ;
sub new {
  my $self = shift;

  unless (ref $self) {
    my $class = ref($self) || $self;
    $self = $class->SUPER::new(
      typelookup => {
        base64 => [10, sub {$_[0] =~ /[^\x09\x0a\x0d\x20-\x7f]/}, 'as_base64'],
 int    => [20, sub {$_[0] =~ /^[+-]?\d+$/}, 'as_int'],
        double => [30, sub {$_[0] =~ /^(-?(?:\d+(?:\.\d*)?|\.\d+|NaN|INF)|([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?)$/}, 'as_double'],
        dateTime => [35, sub {$_[0] =~ /^\d{8}T\d\d:\d\d:\d\d$/}, 'as_dateTime1'],
 string => [40, sub {1}, 'as_value'],
      },
      attr => {},
      namespaces => {},
      @_,
    );
  }
  return $self;
}
sub as_value  {  
    my $self = shift;
    my($value, $name, $type, $attr) = @_;
    return ['value', {}, $value];  
}
sub encode_array {
  my($self, $array) = @_;
  return ['array', {},
     [map {$self->encode_object($_)} @$array]
  ];
}
sub as_dateTime1  {  my $self = shift;
    my($value, $name, $type, $attr) = @_;
    return ['dateTime.iso8601', {}, $value];
}

sub encode_hash {
  my($self, $hash) = @_;
  return ['struct', {}, [
    map {
      ['member', {}, [['name', {}, $_], $self->encode_object($hash->{$_})]]
    } keys %$hash
  ]];
}

1;