• Logesh
  • NEWBIE
  • 55 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 16
    Replies
Hi Friends,

Does anyone have sample test class for apex class which has soql query for External Objects? Kindly share.

Thanks,
Loges
  • February 25, 2015
  • Like
  • 0
Hi Friends,

I've a scenario where I need to send email notification whenever the status of the task is changed. I know that workflow email alert is not supported for Task object. But is there any other where we can send email notification based on certain criteria?

Many Thanks,
Logesh
  • March 24, 2014
  • Like
  • 0
Hi Friends,

I've a scenario where I need to restrict special characters such as (@,!<,>,?,+,=, %,#,(,),/,\,&,£,€,$, "") in text field. But it should accept alpha numeric character, white space & characters such as this (Á, Ñ, í, ó). Please help me with validation rule for this scenario.

Many Thanks
Logesh
  • February 13, 2014
  • Like
  • 0

Hi Friends,

 

I've a custom object which has lookup relationship with Case object. I'd overridden create page for the custom object's record with the visualforce page with a 'Case' standard controller. Since the Case has knowledge sidebar enabled, it also displayed in the new custom record creation page. Is there any way to remove the knowledge Sidebar without changing the 'Case' standard controller.

 

Thanks,

Logesh

  • October 07, 2013
  • Like
  • 0

Hi All,

 

Is it safe to hardcode document url within <apex:image> tag in visualforce email template for embedding image as recommended in salesforce documentation

Link Here

 

Thanks,

Logesh

 

Hi Friends,

 

I need y'all help to rotate text to 270 degree in visualforce which is rendered as PDF. The text is within <td> or <div> tag. I used CSS attributes

 

-webkit-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -o-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    transform: rotate(90deg); 

 

But as the name implies, it worked only with web page. Is there any other way to rotate text in pdf?

 

Thanks,

Logesh

Hi Mates,

 

Can we able to integrate service cloud console with third party CTI through REST API (Without using salesforce soft phone layout). Genesys IWS(Interaction Workspace) is a third party CTI. It has its own soft phone layout. If inbound call comes to IWS, contact number in the IWS should do screen pop up of matching contact detail page in salesforce service cloud console.

 

Thanks,

Logesh

Hi Friends,

 

Is it possible to send multiple records to printer directly by clicking a button in salesforce?

 

Thanks,

Logesh

  • November 28, 2012
  • Like
  • 0

Hi Friends,

 

I'm having a scenario where I need to download all the attachment for a particular custom object as a single zip file on click of a button. Here I categorize attachment based on attachment description field.

Consider there are categories such as A, B & C. Under category A, there are 5 attachments (which means these 5 attachment will have description as A) When I click on a button, I need to download all the 5 attachments belonging to A category as a single zip file. Can you guide me??

 

Thanks & Regards,

Logesh

  • November 28, 2012
  • Like
  • 0

Hi Friends,

 

Hope this scenario will be very interesting for everyone!! I have a scenario where the user needs to download the word document by clicking a link on page.

This word document is dynamically generated from visualforce by fetching values from the record.

Everything works fine. But the problem is when I try to open the downloaded document in MsWord (2007 or 2010), It opens in web layout by default. But I need to open the document in print layout / print view.

I searched and found that the below code snippet works well for all kinds of technology like php, python, etc..

// Code snippet

<!--[if gte mso 9]>
<xml>
<w:WordDocument>
  <w:view w:val="print" />
  <w:zoom w:percent="100" />
  <w:DoNotOptimizeForBrowser/>
  <w:DoNotHyphenateCaps/>
  <w:PunctuationKerning/>
</w:WordDocument>
</xml>
  <![endif]-->

 

But it didnt work with visualforce.  I placed this code snippet inside the <head> tag and right below the <title> tag as per Office XML reference. But I didnt get a positive result.

Is there anyway to achieve this in visualforce??

 

Thanks & Regards,

Logesh

  • November 27, 2012
  • Like
  • 0

Hi Friends,

I'm using an indexed custom field in my soql query to avoid non - selective query error. The query is structured as below

sObjectType customObj_name = [SELECT Id,customfield1__c from customObj WHERE Indexed-customfield__c LIKE 'value%'ORDER BY customfield1__c DESC LIMIT 1];

It worked fine for 7 months. Then suddenly non - selective query error started occuring.

Later I went through the BEST PRACTICES for Handling Large Data Volumes and found that indexed custom field stops working and throws error when it exceeds the threshold limit for 'LIKE' operator in 'WHERE' Clause. That is, the threshold for 'LIKE' operator is 100,000 records of the total records it process. In my scenario, it crosses the threshold and custom indexing stops working and throws error - non selective error.

But My question is when I use the same query in the SOQL for Loop like below

for(customObj__c co: [SELECT Id,customfield1__c from customObj WHERE Indexed-customfield__c LIKE 'value%' ORDER BY customfield1__c DESC LIMIT 1] ){
//code to process
}

Will this process without throwing error?
I learnt that it process records in multiples of batches through internal calls to query() and querymore().
What is the maximum number of records processed by query() calls and querymore() calls, that is called from SOQL - for Loop?
Is there any other way to process the maximum number of records efficiently from a single object?
Just in curiosity, I want to know - What is the maximum number of records, a custom object can hold in Salesforce Unlimited Edition? And is there a way to query all the records efficiently from that kind of custom object?

Thanks,
Logesh

Hi Friends,

 

I'm using an indexed custom field in my soql query to avoid non - selective query error. The query is structured as below

 

sObjectType customObj_name = [SELECT Id,customfield1__c from customObj WHERE Indexed-customfield__c LIKE 'value%'ORDER BY customfield1__c DESC LIMIT 1];

 

It worked fine for 7 months. Then suddenly non - selective query error started occuring.

 

Later I went through the BEST PRACTICES for Handling Large Data Volumes and found that indexed custom field stops working and throws error when it exceeds the threshold limit for 'LIKE' operator in 'WHERE' Clause. That is, the threshold for 'LIKE' operator is 100,000 records of the total records it process. In my scenario, it crosses the threshold and custom indexing stops working and throws error - non selective error.

 

But My question is when I use the same query in the SOQL for Loop like below

 

for(customObj__c co:  [SELECT Id,customfield1__c from customObj WHERE Indexed-customfield__c LIKE 'value%' ORDER BY customfield1__c DESC LIMIT 1] ){

//code to process

}

 

Will this process without throwing error?

I learnt that it process records in multiples of batches through internal calls to query() and querymore().

What is the maximum number of records processed by query() calls and querymore() calls, that is called from SOQL - for Loop?

Is there any other way to process the maximum number of records efficiently from a single object?

Just in curiosity, I want to know -  What is the maximum number of records, a custom object can hold in Salesforce Unlimited Edition? And is there a way to query all the records efficiently from that kind of custom object?

 

Thanks,

Logesh

 

Hi All, I have a scenario where some users in the organization should see the event details in Multi user calendar view while some users should not have the access to see the event details. In Simple words, i want to enable the 'Show Event Details on Multi-User Calendar View' for particular users and disable the 'Show Event Details on Multi-User Calendar View' for certain users in Setup -> Customize -> Activities -> Activity Settings. Kindly provide your suggestions on these!! Thanks, Logesh
  • January 05, 2012
  • Like
  • 0

Hi All,

 

 

           I'd  trigger & custom controller which creates a custom object record and sets the logic respectively. 

            

           Custom record will be automatically created when an Event is created with following condition

 

 Status - 'Not Started' and for a particular record type. When Event is updated with Status - 'Completed'. Some fields become editable in custom record.

 

Now the problem is, when user tries to save the custom record "Attempt to de-reference a null object" error occurs without apex class line number. With the additional message "Your development organization has been notified". As the error happens only for a particular user in a Production environment. I didnt get the mail about the error from the concerned person.

 

While the custom record is generated, it carries some referenced field information such as Account & contact & it is not editable. Since I've a insert operation in try block, deletion of such referenced records wont throw error in the UI.

 

Is there anyway to point the issue, please help me!!

 

Thanks,

Logesh

 

 

  • December 09, 2011
  • Like
  • 0

Hi Friends,

 

                    I have a scenario where I need to send the email with the pdf attachment once the record is insert (this is for custom object).

Record for the custom object will be inserted when an Event is created with particular condition(This is done through trigger).

 

I wrote an apex class and I called that class from the trigger. It worked fine. I used the getContentasPdf to render the record inputs as pdf  to send as attachment. But the "getContentasPdf" is not supported in triggers. Is there any other way to send a email with pdf as attachment from trigger. Please help me!!

 

- Logesh

  • December 07, 2011
  • Like
  • 0

Hi All,

 

            Is there anyway to make the text field value to appear as link to record in standard Salesforce report functionality. Similar to standard 'Name' fields. So that user can navigate to related record by clicking on the link.

 

 

- Logesh

  • November 10, 2011
  • Like
  • 0

Hello All,

 

                     I'll explain the scenario here..

consider two objects A & B. Report is created with report type [A related to B (A should atleast have one B record)].

If I select 'My reports' in the Show drop-down. It should show the records owned/created by me as well as the records created/owned by other users where A has a lookup to B(child) and in this lookup if my name was mentioned.

 

Please help me to solve this!!

 

 

Thanks in Advance!!

Is there anyway to edit the field label displayed in report builder , i wanna to make the Account/Lead rating as Lead rating. Plz provide me a solution

Plz click the link below to view the screenshot

http://www.facebook.com/photo.php?op=1&view=global&subj=181143345255191&pid=9469242&id=789353055&oid=181143345255191

 

how to make a inbound call in CTI demo adapter.(The phone number may be the number of saved lead or contact record. So, that when a call comes from that phone number, the detail page of the record associated with that phone number should be displayed

  • April 30, 2011
  • Like
  • 0
Hi Friends,

I've a scenario where I need to restrict special characters such as (@,!<,>,?,+,=, %,#,(,),/,\,&,£,€,$, "") in text field. But it should accept alpha numeric character, white space & characters such as this (Á, Ñ, í, ó). Please help me with validation rule for this scenario.

Many Thanks
Logesh
  • February 13, 2014
  • Like
  • 0

Hi Friends,

 

I've a custom object which has lookup relationship with Case object. I'd overridden create page for the custom object's record with the visualforce page with a 'Case' standard controller. Since the Case has knowledge sidebar enabled, it also displayed in the new custom record creation page. Is there any way to remove the knowledge Sidebar without changing the 'Case' standard controller.

 

Thanks,

Logesh

  • October 07, 2013
  • Like
  • 0

Hi Friends,

 

I need y'all help to rotate text to 270 degree in visualforce which is rendered as PDF. The text is within <td> or <div> tag. I used CSS attributes

 

-webkit-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -o-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    transform: rotate(90deg); 

 

But as the name implies, it worked only with web page. Is there any other way to rotate text in pdf?

 

Thanks,

Logesh

Hi Friends,

 

Is it possible to send multiple records to printer directly by clicking a button in salesforce?

 

Thanks,

Logesh

  • November 28, 2012
  • Like
  • 0

Hi Friends,

 

I'm having a scenario where I need to download all the attachment for a particular custom object as a single zip file on click of a button. Here I categorize attachment based on attachment description field.

Consider there are categories such as A, B & C. Under category A, there are 5 attachments (which means these 5 attachment will have description as A) When I click on a button, I need to download all the 5 attachments belonging to A category as a single zip file. Can you guide me??

 

Thanks & Regards,

Logesh

  • November 28, 2012
  • Like
  • 0

Hi Friends,

I'm using an indexed custom field in my soql query to avoid non - selective query error. The query is structured as below

sObjectType customObj_name = [SELECT Id,customfield1__c from customObj WHERE Indexed-customfield__c LIKE 'value%'ORDER BY customfield1__c DESC LIMIT 1];

It worked fine for 7 months. Then suddenly non - selective query error started occuring.

Later I went through the BEST PRACTICES for Handling Large Data Volumes and found that indexed custom field stops working and throws error when it exceeds the threshold limit for 'LIKE' operator in 'WHERE' Clause. That is, the threshold for 'LIKE' operator is 100,000 records of the total records it process. In my scenario, it crosses the threshold and custom indexing stops working and throws error - non selective error.

But My question is when I use the same query in the SOQL for Loop like below

for(customObj__c co: [SELECT Id,customfield1__c from customObj WHERE Indexed-customfield__c LIKE 'value%' ORDER BY customfield1__c DESC LIMIT 1] ){
//code to process
}

Will this process without throwing error?
I learnt that it process records in multiples of batches through internal calls to query() and querymore().
What is the maximum number of records processed by query() calls and querymore() calls, that is called from SOQL - for Loop?
Is there any other way to process the maximum number of records efficiently from a single object?
Just in curiosity, I want to know - What is the maximum number of records, a custom object can hold in Salesforce Unlimited Edition? And is there a way to query all the records efficiently from that kind of custom object?

Thanks,
Logesh

I've searched the forums for info and have tried cobbling together a solution for my needs, but it still doesn't work.   I'm developing a button that is trying to download all attachments for a case. 

The Apex page:

<apex:page standardController="Case" extensions="AllAttachmentsController">
  <h1>Download attachments for case: "{!Case.Id}" </h1>
   {!AttNames}
</apex:page>

And the controller method:

public String[] getAttNames() {
        Id caseid = ApexPages.currentPage().getParameters().get('Id');
        
        String[] attNames = new List<String>();
        String strURL;
        string session = UserInfo.getSessionId();        
        HttpRequest req = new HttpRequest();
        HttpResponse res;
        Http h = new Http();
        String strResult ;
                
        ATT=[SELECT Id, Name FROM Attachment WHERE parentId = :ApexPages.currentPage().getParameters().get('Id')]; 
        integer j = ATT.size();
        
        for(integer i=0; i<j; i++) {                      
            strURL= 'https://' + ApexPages.currentPage().getHeaders().get('Host') 
                + '/servlet/servlet.FileDownload?file=' + ATT[i].Id;
            
            strURL = strURL.replace('visual', 'content');
            req.setHeader('Content-Type', 'application/octet-stream');
            req.setHeader('Authorization', 'OAuth ' + session);
            req.setHeader('Content-Disposition', 
                    'attachment; filename=' + ATT[i].Name);                        
            req.setHeader('Host', ApexPages.currentPage().getHeaders().get('Host'));
            req.setMethod('GET'); 
            req.setEndpoint(strURL);            
            attNames.add(strURL);
            res = h.send(req);       
            
            //...Gotta do it again w/ the return URL...
            strURL =  res.getHeader('Location'); 
            
            System.debug('HTTP REDIRECT (' + session + '): ' + strURL ); 
            req.setEndpoint(strURL);
            res = h.send(req); 
            strResult = res.getBody();              
            System.debug('HTTP Body:' + strResult );
            }
        return attNames;
        }       

 

...But the debug log looks strange to me - in that the "moved" URL is exactly the same as the successful endpoint URL:

15:06:55.095 (95548000)|CALLOUT_REQUEST|[33]|System.HttpRequest[Endpoint=https://c.na4.content.force.com/servlet/servlet.FileDownload?file=00P60000008OlopEAC, Method=GET]
15:06:55.148 (148429000)|CALLOUT_RESPONSE|[33]|System.HttpResponse[Status=Found, StatusCode=302]
15:06:55.148 (148464000)|SYSTEM_METHOD_EXIT|[33]|System.Http.send(APEX_OBJECT)
15:06:55.148 (148500000)|SYSTEM_METHOD_ENTRY|[36]|System.HttpResponse.getHeader(String)
15:06:55.148 (148519000)|SYSTEM_METHOD_EXIT|[36]|System.HttpResponse.getHeader(String)
15:06:55.148 (148536000)|SYSTEM_METHOD_ENTRY|[38]|System.debug(ANY)
15:06:55.148 (148554000)|USER_DEBUG|[38]|DEBUG|HTTP REDIRECT (00D300000000iGb!AQsAQNINwJAlI9D_N1TCE5M438xHt_XNSHaTH2jSvkxiLqdhPh5PkIMvBZ.TnAKbNgXCFsdFQWkLRbcIPhP6DJFNdSYEdNyZ): https://na4.salesforce.com/servlet/servlet.FileDownload?file=00P60000008OlopEAC
15:06:55.148 (148567000)|SYSTEM_METHOD_EXIT|[38]|System.debug(ANY)
15:06:55.148 (148583000)|SYSTEM_METHOD_ENTRY|[39]|System.HttpRequest.setEndpoint(String)
15:06:55.148 (148600000)|SYSTEM_METHOD_EXIT|[39]|System.HttpRequest.setEndpoint(String)
15:06:55.148 (148617000)|SYSTEM_METHOD_ENTRY|[40]|System.Http.send(APEX_OBJECT)
15:06:55.151 (151594000)|CALLOUT_REQUEST|[40]|System.HttpRequest[Endpoint=https://na4.salesforce.com/servlet/servlet.FileDownload?file=00P60000008OlopEAC, Method=GET]
15:06:55.206 (206214000)|CALLOUT_RESPONSE|[40]|System.HttpResponse[Status=Found, StatusCode=302]
15:06:55.206 (206244000)|SYSTEM_METHOD_EXIT|[40]|System.Http.send(APEX_OBJECT)
15:06:55.206 (206282000)|SYSTEM_METHOD_ENTRY|[41]|System.HttpResponse.getBody()
15:06:55.206 (206293000)|SYSTEM_METHOD_EXIT|[41]|System.HttpResponse.getBody()
15:06:55.206 (206307000)|SYSTEM_METHOD_ENTRY|[42]|System.debug(ANY)
15:06:55.206 (206318000)|USER_DEBUG|[42]|DEBUG|HTTP Body:The URL has moved <a href="https://na4.salesforce.com/servlet/servlet.FileDownload?file=00P60000008OlopEAC">here</a>

 

Any help is greatly appreciated.

 

 

 

 

 

 

 

<apex:page standardController="Case" extensions="AllAttachmentsController">
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Download attachments for case: "{!Case.Id}" </h1>
   {!AttNames}
  <!-- select  Id from Attachment Where parentId = "{!Case.Id}" !-->
  <!-- SELECT Name, Body From Attachment  WHERE Id = "{!This.Id}" !-->
  <!-- (dump  Body to browser in base64 encode format... !-->
  <!-- End Default Content REMOVE THIS -->
</apex:page>

Hi Friends,

 

                    I have a scenario where I need to send the email with the pdf attachment once the record is insert (this is for custom object).

Record for the custom object will be inserted when an Event is created with particular condition(This is done through trigger).

 

I wrote an apex class and I called that class from the trigger. It worked fine. I used the getContentasPdf to render the record inputs as pdf  to send as attachment. But the "getContentasPdf" is not supported in triggers. Is there any other way to send a email with pdf as attachment from trigger. Please help me!!

 

- Logesh

  • December 07, 2011
  • Like
  • 0

Hi All,

 

            Is there anyway to make the text field value to appear as link to record in standard Salesforce report functionality. Similar to standard 'Name' fields. So that user can navigate to related record by clicking on the link.

 

 

- Logesh

  • November 10, 2011
  • Like
  • 0

Is there anyway to edit the field label displayed in report builder , i wanna to make the Account/Lead rating as Lead rating. Plz provide me a solution

Plz click the link below to view the screenshot

http://www.facebook.com/photo.php?op=1&view=global&subj=181143345255191&pid=9469242&id=789353055&oid=181143345255191

 

how to make a inbound call in CTI demo adapter.(The phone number may be the number of saved lead or contact record. So, that when a call comes from that phone number, the detail page of the record associated with that phone number should be displayed

  • April 30, 2011
  • Like
  • 0

Hi,

I need to put a custom related list on the account detail page and put the Hover link on the top of the page for the custom related list.

 

I was able to do the custom related list displayed on the bottom of the Account detail page wiring a standard controller extension and visula force page.

 

Now the problem is How do I place the Hover link on the top of the page for the custom list? I saw couple of threads for the above, but the hover links issue was never discussed?.

 

Can any one please guide me how can I do this.

 

Thank you.