You need to sign in to do that
Don't have an account?
sk2006
perl creating attachment
I am trying to create an attachment using perl and the API. I am base64 encoding the string using MIME::Base64's encode_base64 method. Here's my create call:
my $r = $sf->create( type=>'Attachment',
Body => "$filedata",
Name => "$uploaded_filename",
ParentId => "$caseid"
);
Here's what I get back:
$VAR1 = { 'success' => 'false', 'errors' => { 'fields' => undef, 'statusCode' => 'INVALID_TYPE_ON_FIELD_IN_RECORD', 'message' => 'Body: value not of required type: VGhpcyBpcyBhIHRlc3QgZm9yIHRoZSBhdHRhY2htZW50IGZlYXR1cmUuIE5vdCBjb21wcmVzc2lu ZyBiZWZvcmUgaW5zZXJ0IHlldC4=' }, 'id' => undef };
Can someone help please?
my $r = $sf->create( type=>'Attachment',
Body => "$filedata",
Name => "$uploaded_filename",
ParentId => "$caseid"
);
Here's what I get back:
$VAR1 = { 'success' => 'false', 'errors' => { 'fields' => undef, 'statusCode' => 'INVALID_TYPE_ON_FIELD_IN_RECORD', 'message' => 'Body: value not of required type: VGhpcyBpcyBhIHRlc3QgZm9yIHRoZSBhdHRhY2htZW50IGZlYXR1cmUuIE5vdCBjb21wcmVzc2lu ZyBiZWZvcmUgaW5zZXJ0IHlldC4=' }, 'id' => undef };
Can someone help please?
$Salesforce::Constants::TYPES{Attachment}->{Body} = 'xsd:base64Binary';
at WWW::Salesforce version 0.07.
You can download WWW::Salesforce version 0.07 from
http://search.cpan.org/~capoeirab/WWW-Salesforce-0.07/
Please try it!
I couldn't have said it better myself.
- Chase (capoeirab)