• nh
  • NEWBIE
  • 0 Points
  • Member since 2003

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
sfisher,

I was using the tags: autoAssign = 1.

does autoAssign = true make the difference?

and assignmentRuleId to the corresponding rule.

I'm setting them in the XML SaveOptions header.

Nigel

Message Edited by nh on 05-12-2004 10:22 AM

  • May 12, 2004
  • Like
  • 0
Any lead records we create via the API do not follow any assignment rules, they always get stamped as owned by the user the API logged in as. However, leads created using the 'CGI based' webtolead interface do follow assignments.

We were told in order to fix this, it is necessary to set API header options for autoAssign and assignment RuleId.

We 'patched' the Soap Client API 'create' method and added 2 SaveOptions:

my $r = $client->call($method =>
SOAP:ata->name('sObjects' => \SOAP:ata->value(@elems))
->attr( { 'xsi:type' => 'sfons:'.$type } ),

SOAP::Header->name('SaveOptions' => \SOAP::Header->name('autoAssign' => "1" )),
SOAP::Header->name('SaveOptions' => \SOAP::Header->name('assignmentRuleId' => "01Q3000000002i3" )),

$self->get_session_header());

We monitored the lead create with SOAP debug on. The options were generated and accepted and the lead records created. However, we still cannot get lead records to assign correctly.

Are we setting the 'SaveOptions' correctly? Is there something we are doing wrong?

We are creating thousands of leads through the API and its critical to us to get the assignment process automated and not rely on manual updates via the Sforce web interface.

Any help on this would be greatly appreciated,

Thanks

Nigel
  • March 18, 2004
  • Like
  • 0

I found a problem when trying to create some 'text' fields that should only hold numeric values.

For example - PostalCode.   I try and set with a Zip code, and get:

    <errors>
     <fields xsi:null="true"/>
     <message>Value 12563 not of required type string on field PostalCode</message>
     <statusCode>INVALID_TYPE_ON_FIELD_IN_RECORD</statusCode>
    </errors>

I get the same error on other 'text' fields that need a numeric value.  I found a work around by adding a 'space' character to the end of the string but assume this is something that needs to get fixed.

Thanks

Nigel

 


 

  • February 23, 2004
  • Like
  • 0

I'm using the Perl API (latest release) to query the contact  table and need to pick up the OwnerID field so I can look up their email and notify them if I update a contact record through the API. 

However when I query the contact table all I get returned is blank OwnerID fields.  How do I get hold of this data?  The sample code I'm using is below:

Also, I'm not familiar with Oracle query syntax as I use mysql.  What is the syntax to sort a query.  In mysql it is  'order by field' or to reverse 'order by field desc'  but this is not accepted in the API query call.

Thanks

Nigel Hall

 

my $COLUMNS = "Id,OwnerID,CreatedDate,FirstName,LastName,Email";
my $LIMIT = "10";
my $DATATYPE = "Contact";

my $query_str = "select $COLUMNS from $DATATYPE";

$result = $port->query( 'query' => $query_str );

if ($result->fault()) {
    print $result->faultstring();
    print "\n  error on: $query_str\n"
} else {
    my $i = 0;

    my $count = 1;
    foreach my $elem ($result->valueof('//queryResponse/result/records')) {
        my %DATA;
        foreach my $col (split(',',$COLUMNS)) {
#           printf "$elem->{$col} - ";
            $DATA{$col} = $elem->{$col};
        }
        print "rec: $count\n";
        foreach my $field ( keys %DATA ) {
                printf "%-15s: [%s]\n", $field, $DATA{$field};
        }
        print "\n";
        $count++;
    }
}

Message Edited by nh on 02-18-2004 04:32 PM

Message Edited by nh on 02-18-2004 04:32 PM

  • February 19, 2004
  • Like
  • 0

I am using the Perl API Salesforce.pm  to update data in the 'account' data type.  I can update the 'Name' field no problem.  It works perfectly.

Also in the 'Account' table is a customer custom field 'Client_ID__C'.  Whenever I try to update that field, I get an update return result of 1 but the field does not get updated.

If I try to update both the Name and Client_ID_C field, I still get a return of 1 but neither field gets updated.  Shouldn't there be an error return if the update does not happen?

Is this a permissions issue or an API issue?  If we login via the web interface with the same account/password we can update these fields.  Help?

  • January 14, 2004
  • Like
  • 0
Any lead records we create via the API do not follow any assignment rules, they always get stamped as owned by the user the API logged in as. However, leads created using the 'CGI based' webtolead interface do follow assignments.

We were told in order to fix this, it is necessary to set API header options for autoAssign and assignment RuleId.

We 'patched' the Soap Client API 'create' method and added 2 SaveOptions:

my $r = $client->call($method =>
SOAP:ata->name('sObjects' => \SOAP:ata->value(@elems))
->attr( { 'xsi:type' => 'sfons:'.$type } ),

SOAP::Header->name('SaveOptions' => \SOAP::Header->name('autoAssign' => "1" )),
SOAP::Header->name('SaveOptions' => \SOAP::Header->name('assignmentRuleId' => "01Q3000000002i3" )),

$self->get_session_header());

We monitored the lead create with SOAP debug on. The options were generated and accepted and the lead records created. However, we still cannot get lead records to assign correctly.

Are we setting the 'SaveOptions' correctly? Is there something we are doing wrong?

We are creating thousands of leads through the API and its critical to us to get the assignment process automated and not rely on manual updates via the Sforce web interface.

Any help on this would be greatly appreciated,

Thanks

Nigel
  • March 18, 2004
  • Like
  • 0

I'm using the Perl API (latest release) to query the contact  table and need to pick up the OwnerID field so I can look up their email and notify them if I update a contact record through the API. 

However when I query the contact table all I get returned is blank OwnerID fields.  How do I get hold of this data?  The sample code I'm using is below:

Also, I'm not familiar with Oracle query syntax as I use mysql.  What is the syntax to sort a query.  In mysql it is  'order by field' or to reverse 'order by field desc'  but this is not accepted in the API query call.

Thanks

Nigel Hall

 

my $COLUMNS = "Id,OwnerID,CreatedDate,FirstName,LastName,Email";
my $LIMIT = "10";
my $DATATYPE = "Contact";

my $query_str = "select $COLUMNS from $DATATYPE";

$result = $port->query( 'query' => $query_str );

if ($result->fault()) {
    print $result->faultstring();
    print "\n  error on: $query_str\n"
} else {
    my $i = 0;

    my $count = 1;
    foreach my $elem ($result->valueof('//queryResponse/result/records')) {
        my %DATA;
        foreach my $col (split(',',$COLUMNS)) {
#           printf "$elem->{$col} - ";
            $DATA{$col} = $elem->{$col};
        }
        print "rec: $count\n";
        foreach my $field ( keys %DATA ) {
                printf "%-15s: [%s]\n", $field, $DATA{$field};
        }
        print "\n";
        $count++;
    }
}

Message Edited by nh on 02-18-2004 04:32 PM

Message Edited by nh on 02-18-2004 04:32 PM

  • February 19, 2004
  • Like
  • 0

I am using the Perl API Salesforce.pm  to update data in the 'account' data type.  I can update the 'Name' field no problem.  It works perfectly.

Also in the 'Account' table is a customer custom field 'Client_ID__C'.  Whenever I try to update that field, I get an update return result of 1 but the field does not get updated.

If I try to update both the Name and Client_ID_C field, I still get a return of 1 but neither field gets updated.  Shouldn't there be an error return if the update does not happen?

Is this a permissions issue or an API issue?  If we login via the web interface with the same account/password we can update these fields.  Help?

  • January 14, 2004
  • Like
  • 0

Looks like Byrne has fixed the login issue with his perl toolkit (note that currently only supports query.)

http://www.majordojo.com/salesforce/

 

 

  • December 13, 2003
  • Like
  • 0