• Avinash Nelluri
  • NEWBIE
  • 15 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 7
    Replies
Hi,

I've come across a null pointer exception. After I started diggin in, I realized that before update contains 163 records where as after update contains only 161 records. I have never encountered such a scenario. Can some one educate me about the possible scenarios for dropping some records in after trigger?

Thanks..
Hello All,
I came across a very weird issue. In my test method, I'm running into a too many soql queries exception before even setting up my test data for a use case. So, I've moved Test.startTest() little bit upwards before the line causing 101th query hoping startTest() method will reset the limits. Surprisingly, it was still running into the same too many soql exceptions. So, I put a debug log to get total soql queries before the line that's causing the error. This time, with the debug, it doesn't throw any error. If I remove the debug, then it will run into too many soql queries.

My code:

insert somList;//This is the point I hit my 100th query. So the next query will be 101th.
System.debug(logginglevel.error, '***SOQL Count 1***'+limits.getQueries());//The debug prints 100.
Test.startTest();
System.debug(logginglevel.error, '***SOQL Count 2***'+limits.getQueries());// This debug is doing magic. If I put the debug, queries count resets. Otherwise it doesn't
List<Account> listAcnts= [SELECT ID, Name FROM Account WHERE xxxxx];//This would be the 101th query if there is no startTest() above.

Any thoughts?

Thanks,
Avinash.

 
Hi, 

For a couple of days I've been receiving this kind of line in my debug logs. I guess this is realated to the new API version (v37.0). 
I would n't care about this if didn't receive thousands of lines like this one in all my traces. 

17:02:42.238 (238882742)|USER_INFO|[EXTERNAL]Salesforce user id| username| GMT time

My debugs levels are: 

Database               INFO
Workflow                INFO
Validation               INFO
Callouts                 INFO
Apex Code            INFO
Apex Profiling        DEBUG
Visualforce            NONE
System                 NONE

Thanks
Hi,

I've come across a null pointer exception. After I started diggin in, I realized that before update contains 163 records where as after update contains only 161 records. I have never encountered such a scenario. Can some one educate me about the possible scenarios for dropping some records in after trigger?

Thanks..
Hello All,
I came across a very weird issue. In my test method, I'm running into a too many soql queries exception before even setting up my test data for a use case. So, I've moved Test.startTest() little bit upwards before the line causing 101th query hoping startTest() method will reset the limits. Surprisingly, it was still running into the same too many soql exceptions. So, I put a debug log to get total soql queries before the line that's causing the error. This time, with the debug, it doesn't throw any error. If I remove the debug, then it will run into too many soql queries.

My code:

insert somList;//This is the point I hit my 100th query. So the next query will be 101th.
System.debug(logginglevel.error, '***SOQL Count 1***'+limits.getQueries());//The debug prints 100.
Test.startTest();
System.debug(logginglevel.error, '***SOQL Count 2***'+limits.getQueries());// This debug is doing magic. If I put the debug, queries count resets. Otherwise it doesn't
List<Account> listAcnts= [SELECT ID, Name FROM Account WHERE xxxxx];//This would be the 101th query if there is no startTest() above.

Any thoughts?

Thanks,
Avinash.

 
Hi,

I was using HTML component in home page component for advance search functionality in Narrow (Left) Column of Home Layout. My HTML component was 
<script language="JavaScript" type="text/javascript"> 
function setFocusOnLoad() {} 
function submitSearchForm(){ 
var searchField = document.getElementById('advsearchfield'); 
document.advsrch.action = '/search/SearchResults?searchType=2&sen=0&setLast=1&str=' + encodeURIComponent(searchField.value); 
return true; 
} 

</script> 

<form name="advsrch" method="post" onsubmit="return submitSearchForm();"> 
<input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr" />
<input class="btn" value=" Go! " type="submit" /> 
</form>


Now that component is not visible in Summer 15 org, so for the workaround I have created visualforce component and create VF page, below is my code of VF page
<apex:page > 

<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" /> 
<apex:includeScript value="{!$Resource.advSearch}"/> 

</apex:page>

advSearch.js (Static Resource) is
 
$(document).ready(function () { 
function setFocusOnLoad() {} 
function submitSearchForm(){ 
var searchField = document.getElementById('advsearchfield'); 
document.advsrch.action = '/search/SearchResults?searchType=2&sen=0&setLast=1&str=' + encodeURIComponent(searchField.value); return true; 
} 

$form = $("<form/>",{name:"advsrch"},{method:"post"},{onsubmit:"return submitSearchForm();"} ); 
$form.append('<input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr" />'); 
$form.append('<input class="btn" value=" Go! " type="submit"/>'); 

$('body').append($form); });

After doing all the changes, I have found couple of issues 

1) Its not showing the blue container as it is now VF component. Requirement is to show the advance search text field and button in blue container just like other components.
2) Its not calling the function same way as it was before, now it refreshing the whole page   and not going link which I am providing. 

Not sure what am I missing or whats need to be done. Any help would be appreciated. Thanks much