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
DeveloperProbsDeveloperProbs 

Urgently help need :( on insert data in SFDC

I have one object "Var__c"  with one column as "name". I can do select or can fetch data from this object, while inserting data it gives error like

Missing entity type information. sObject requires a separate 'type' field be sen
t. at var.pl line 29
Can't call method "result" on an undefined value at var.pl line 32.


Please help me on this its urgent for me.
I have written program as follows

Thanks in advance
-------------------------------------------------------------------------------------------------
#use strict;
use DBI;
use WWW::Salesforce::Simple;
use Tie::Hash::Indexed;
use SOAP::Lite;

my $sforce = WWW::Salesforce::Simple->new(
        'username' => $ARGV[0],
        'password' => $ARGV[1]
);

tie my %Solution, 'Tie::Hash::Indexed';
%Solution =
(
Id => 323,
OwnerId => '',
IsDeleted => '',
Name =>'varun',
CreatedDate => '',
CreatedById => 322,
LastModifiedDate =>'' ,
LastModifiedById =>322 ,
SystemModstamp => ''
);

my $res = $sforce->create( type => "Var__c" , %Solution);


if ($result->result->{"success"} eq "false")
{
   print $result->result->{errors}->{message} . "\n";
}
DeveloperProbsDeveloperProbs
any bdy has any idea?
tocktock

Hello, your using the 'create' function and also trying to set the Id of the Sobject. The Id is an automatically generated unique field on the salesforce side, so that will cause problems. not sure what the properties are of the other fields on your sobject.