• Suman Giri
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 2
    Replies

Hi All,

 

Could I automate the proces of creating an Email Service using Apex code, normally we follow the below steps to create the Email Service:

 

To use email services, click Your Name | Setup | Develop | Email Services.

  • Click New Email Service to define a new email service.
  • Select an existing email service to view its configuration, activate or deactivate it, and view or specify addresses for that email service.
  • Click Edit to make changes to an existing email service.
  • Click Delete to delete an email service.

 

Is there a way I can automate the above steps using Apex ?

Another question being....

Application we are developing has an Email Service associated and which is on Sandbox. When I create a Managed package, would this email service be part of the package I create ?

 

Appreciate if there are any pointers.

Thank You.

 

hi,

 

We invoke a REST service to download a PDF from external system, and the Response Headers we get:

 

Date: Wed, 16 May 2012 09:37:02 GMT
Content-Encoding: gzip
Transfer-Encoding: chunked
Content-Disposition: attachment; filename="XYZ.pdf"
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
Content-Type:application/pdf

 

What I understand from the above headers is that I could see that the "Content-Encoding" is set as gzip, so instead of the PDF as an attachment, we would get the encoded form of data, which needs to be decoded or unzip in my case and then read the attachment to display the PDF. Is my understanding correct ?

Let me know if there is a way to get this done in Apex HTTPResponse processing ?


Also is there a limit on the size of the file that can be retrieved using a service callout ?
Appreciate any pointers.
Thanks,
Suman

Hi,

 

Requirement :-  we have installed an app from appExchange which would create a custom object (Say xyz__c). We need to create a custom field to the above object programatically. We were unable to use the MetadataAPI as service callout would not work from within the Salesforce org.

We found in one of the forum topic that REST API can be used to achieve this.

We were able to display the list of objects in the org and also were able to describe the object in terms of the metadata.

We are referring to the below resource:

http://www.salesforce.com/us/developer/docs/api_re​st/index_Left.htm#StartTopic=Content/quickstart.h...

 

Is there a way I can achieve the Metadata API functionality using REST service call out ?

Appreciate your help or any pointers.

Hi,

 

Requirement :-  we have installed an app from appExchange which would create a custom object (Say xyz__c). We need to create a custom field to the above object programatically. We were unable to use the MetadataAPI as service callout would not work from within the Salesforce org.

We found in one of the forum topic that REST API can be used to achieve this.

We were able to display the list of objects in the org and also were able to describe the object in terms of the metadata.

We are referring to the below resource:

http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#StartTopic=Content/quickstart.htm

 

Is there a way I can achieve the Metadata API functionality using REST service call out ?

Appreciate your help or any pointers.

 

 

 

 

Is there a way I could get the list of installed packages in an org from Apex code. Could it be achieved using Webservices API ?

My requirement is to check whether a particular package is installed in the org, then have perform an action. If the package is available for the org, then have to install the package and then perform an action.

Any suggestions please let me know.

 

Thanks,

Suman

Hi,

 

There is a requirement for us where we receive binary string which needs to be converted into integer. We could acheive this in java with the below code:

 

 String binaryString="00000101";
 System.out.println(Integer.parseInt(binaryString, 2));

 

Output what we get is '5'.

Could we acheive this using Apex ?

Any pointers would be of great help.

Thanks in advance.

 

Regards,

Suman.H

Having figured that I cannot save a PDF retrieved from an external webservice as an Attachment in SFDC (callouts do not support binary), was wondering what workarounds or other options are available?

 

All I was attempting was:

 

 

Http h = new Http();
HTTPRequest req = new HttpRequest();       
req.setEndpoint('http://someserver/sample.pdf');
req.setMethod('GET');
HTTPResponse resp = h.send(req);
String body = resp.getBody();
Attachment attach = new Attachment();
try {
    attach.Body = Blob.valueOf(body); 
    attach.Name = 'PDF Quote';
    attach.ParentId = this.contact.Id;
    attach.ContentType = resp.getHeader('Content-Type');
    attach.IsPrivate = false;			
    insert attach;
} catch (DMLException e) {
    ApexPages.addMessages(e);
}

 All works fine. The attachment is saved. But, is never readable as a valid PDF. Any suggestions? Thanks.

 

Hi everyone,

I want to convert String into Integer so that I can filter data in my where clause of SOQL query.
I created a AutoNumber field on account object. In my SOQL query I want to get account objects 100 at a time into a list. So i did the following query.

Here is my query

// acc is a Account object

acc = [Select id from account a where ( a.AutoNum__c >= 1 and a.AutoNum__c < 100 )];

The problem is AutoNumber in salesforce is of type String. So I cant compare that field to integers 1 and 100. How can I achieve this.

Any example or syntax would help me. I know that valueOf can be used to convert string to integer, but how can i embed that into my SOQL query.

Thank you in advance.

its,
dsv
  • August 29, 2008
  • Like
  • 0