• Prakash@SFDC
  • NEWBIE
  • 30 Points
  • Member since 2011
  • Deloitte

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 39
    Replies
I am implementing streaming api in JAVA . For this we need import some JAR files into the JAVA project . Along with that we need to download JSON.org java code and have to add that to the project .But I could not download that file , the URL provide by SFDC documentation is not exist . PFB URL .
https://developer.salesforce.com/page/Getting_Started_with_the_Force.com_Streaming_API

Please guide me from where I can get that file ? 

Hi ,

 

I want to display the records with some filter condition  when i click Add Products button on Opportunity . How can i implement this ?

 

 

Thanks 

Prakash

Hi,

 

I am facing a problem while accessing a static variable in non static method.

 

from a visulaforce pagewhen a button is clicked i am calling a remoteaction method which is static . in that method i am assigning the id of a perticular object to a static filed called agreementId.After this remoteaction method i am calling an action function which calls a non static method , in that method i need to use this static field agreementId . when i am printing this it is giving as null .

 

I tried to access this filed by using classname.filed still it didn't work .

 

Please let  me know how to access this field .

 

 

 

Hi i am unable to get the selected radio button value into the javascript . I am getting as undefined .

i want the value when i am clicking another button in the same form.

<apex:page controller="sampleCon" sidebar="false" showHeader="false" id="testpage">
<script>
function checkThis(){
alert('hi');
var a=document.getElementById('{!$Component.theform.country}').value
alert(a);
}
</script>
<apex:form id="theform">
<apex:selectRadio value="{!country}" id="country" >
<apex:selectOptions value="{!items}"/>
</apex:selectRadio><p/>
<apex:commandButton value="Test" action="" onclick="checkThis();" rerender="out" status="status"/>
</apex:form>
</apex:page>

<apex:outputPanel id="out">
<apex:actionstatus id="status" startText="testing...">
<apex:facet name="stop">
<apex:outputPanel >
<p>You have selected:</p>
<apex:outputText value="{!country}"/>
</apex:outputPanel>
</apex:facet>
</apex:actionstatus>
</apex:outputPanel>
</apex:page>

=============================
Controller :

public class sampleCon {
String country = null;

public PageReference test() {
return null;
}

public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('US','US'));
options.add(new SelectOption('CANADA','Canada'));
options.add(new SelectOption('MEXICO','Mexico')); return options;
}

public String getCountry() {
return country;
}

public void setCountry(String country) { this.country = country; }
}

I am trying to access the radio button value in JScript using 

 

var h = document.getElementById("{!$Component.wizpage.wizardForm.agmtInfo.ContractDetailsSec.whoSignFirstSection.whoSignFirstId}").value;
alert(h);

 

I am getting undefined . What might be the issue ? Please give some idea .

 

1. i am using proper id values while accessing .

2. There is no JavaScript error .

 

Many Thanks in Advance

Prakash

Hi ,

 

I need to pass a value when i am clicking the output link . I am using the following the code .It is not working .

 

<apex:outputPanel rendered="{!results1.size !=0 }">

  <div class="mapResults">
           <div class="sort">
                <span>{!$Label.Results}</span>

 <div id="hideMap1" style="display:none">
                 <apex:outputLink id="map2" value="javascript&colon;hidemap();" styleClass="hideMapLink">
                        <span>{!$Label.Hide_Map}</span>
                  </apex:outputLink>
                 <apex:param name="a1" value="true" assignTo="{!displayAccImage}" />
</div>

<div id="showMap1" >
                         <apex:outputLink id="map1" value="javascript&colon;showmap();resizeMap();" styleClass="showMapLink">
                                   <span>{!$Label.Show_Map}</span>
                       </apex:outputLink>
                      <apex:param name="a2" value="true" assignTo="{!displayAccImage}" />
 </div>
</div>

<div id="mapContainer" class="mapclass" style="display:none">
            <div id="map" >
             </div>
 </div>

<div >
         <div id="hideMap2" style="display:none">
                        <apex:outputLink value="javascript&colon;hidemap();" styleClass="hideMapTab">{!$Label.Hide_Map}
                                     <apex:param id="zyx" name="a3" value="false" assignTo="{!displayAccImage}" />
                        </apex:outputLink>
          </div>
         <div id="showMap2" >
                       <apex:outputLink value="javascript&colon;showmap();resizeMap();" styleClass="showMapTab">                                                   { ! $Label.Show_Map}
                       <apex:param id="xyz" name="a4" value="true" assignTo="{!displayAccImage}" />
           </apex:outputLink>
     </div>
 </div>
</div>
</apex:outputPanel>

 

My task is when i click the showmap link the value for displaAccImage set to true . when i click the hidemap link the value should be false . i want to acheive this with outputlink i dont want commandlink ..etc . All javascript methods are properly called .

 

Please help me how to acheive this .

 

Many Thanks in Advance

Prakash.N

Hi,

 

Tolable() not retrieving the translated value in the group by Clause. All Variable are initialised properly .

 

aResult = [ select tolabel(Solution__c) from Validated_Solution__c where Publish_Flag__c=TRUE AND Account__c =:AccountIdProfile group by Solution__c Order By Solution__c];

 

if(!aResult.IsEmpty()){

 

for(AggregateResult a:aResult){ 

     String str1 = (String)a.get('Solution__c');

      ValidatedSol.add(str1);

     }

 }

 

with ValidatedSol List i am displaying the results in VF page . While displaying it gives master picklist value but i want to display the translated value .If i use a query w/o Group by It will work . I want to use Group by . Please help me how to achieve this.

 

Many Thanks in advance ,

Prakash.N

 

 

HI ,

 

I am using one output link in which if you click that link that should hide and new  link should appear in the same . If you click the new link again that should hide and the old one should appear vice - vesa . I am giving the sample code below .

 

 <apex:outputLink id="map2" value="javascript&colon;hidemap();"  styleClass="hideMapLink">                         
                         <span>{!$Label.Hide_Map}</span>
                         </apex:outputLink>                         
                           
  <apex:outputLink id="map1" value="javascript&colon;showmap();resizeMap();"  styleClass="showMapLink">
                         <span>{!$Label.Show_Map}</span>
                         </apex:outputLink>
                              
                                     
                      
             <script language="javascript">
                        function showmap()
                        {                       
                        document.getElementById("mapContainer").style.display="block"; 
                        }
                        function hidemap()
                        {                       
                        document.getElementById("mapContainer").style.display="none";
                        }
                        </script>   
                       <div id="mapContainer" class="mapclass" style="display:none">
                          <div id="map" >
                       </div>
                      </div>

 

Initially ShowMap link will Appear . If you click that link one block appear with map loaded in it , and Showmap link has to change to HideMap. And if you clikc HideMap link mapblock should close and showmap link should appear .

 

Now the issue is i am able to open Mapblock but the link was  not changing to HideMap . Please help me how to acheive this.

 

Many Many thanks in Advance .

 

 

Hi,

 

I have a requirement like query the  child object and throught this query we have to get the values of another object which is a lookup to its parent. In this case PartnerLocation is the Child to Account and Opportunity is the Lookup to Account.

 

Thanks in Advance

Prakash.N

Hi everybody, 
Now I have very fruitful position in Germany, Berlin from product company. main requirements: 3+ years of experience in Salesforce.com (frontend and backend), Java, JavaScript (CSS and HTML), advanced English level. Full relocation package(if you need). Salary rate 45-50k euro per a year. If you are interested in working in Germany or changing your current project, please write me by skype: somova.it

I'll be grateful for any recommendations:) Thank you for attention and have a perfect day!

 

Hello All,

I currently have this APEX Trigger which i am tryng to perform a Update records so the field populates properly.  I am performing a Open Execute in the developer console but getting an error..

trigger MyLastCallDate on Task (after insert, after update, after delete) 
{
    public String currentUser = UserInfo.getUserId();
    public String oldUser=[select old_ID__c from User where id=:currentUser limit 1]
 [0].old_ID__c;
    Set<Id> con_set = new Set<Id>();
    List<Contact> con_list = new List<Contact>();
    for( Task T: Trigger.new )
    {

        {
            con_set.add(T.whoid);
        }
    }
     
     for(AggregateResult aggregateResult:[SELECT max(createdDate)MaxCDate,whoid FROM Task WHERE whoid IN: con_set AND Status ='Completed' AND (subject LIKE 'call%' OR subject LIKE 'outbound%') AND (CreatedbyId=:currentUser OR OLDOWNERID__C=:oldUser) group By whoid])
     {
        con_list.add(new Contact(Id=(id)aggregateResult.get('whoid'),My_Last_Call__c=date.valueof(aggregateResult.get('MaxCDate'))));
        
     }
     
      try
    {
     
         if(con_list !=null && con_list.size()>0)
         {
             update con_list;
         }
     
    }Catch(Exception ee){
         system.debug('Exception ***'+ee.getMessage());
      
     }

}

Error:
Line: 2, Column: 14
No such column 'My_Last_Call__c' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.


Any advise to fix that issue?
I am using Stripe SDK for Salesforce. I created my webhook listener and provided the apex rest url to Stripe. I generated a connected app in my salesforce instance. How do i provide the client secret and key to Stripe? 
I think i am missing something simple, any hints?

Thanks in advance

It would appear there is a bug with the Winter 14 release and visualforce pageBlockSectionItem. Below is the markup to reproduce:

 

<apex:page">

	<apex:pageBlock>
		<apex:pageBlockSection >
			<apex:pageBlockSectionItem>
				<apex:outputPanel >
					Choose whether to define the fields for this Map Object or whether to refer to another object 
					already configured. (e.g. for Opportunities, you may want to refer to the Account object). Referring to 
					another object means this object need not be geocoded and will use the referring object's information.
				</apex:outputPanel>
				<apex:outputPanel >
					hi
				</apex:outputPanel>
			</apex:pageBlockSectionItem>
		</apex:pageBlockSection>				
	</apex:pageBlock>
	
</apex:page>

In Summer 13 it looked like this, correct:

 

 

In Winter 14 it looks like this:

  • September 12, 2013
  • Like
  • 0

Hi ,

 

I want to display the records with some filter condition  when i click Add Products button on Opportunity . How can i implement this ?

 

 

Thanks 

Prakash

Hi,

 

I am facing a problem while accessing a static variable in non static method.

 

from a visulaforce pagewhen a button is clicked i am calling a remoteaction method which is static . in that method i am assigning the id of a perticular object to a static filed called agreementId.After this remoteaction method i am calling an action function which calls a non static method , in that method i need to use this static field agreementId . when i am printing this it is giving as null .

 

I tried to access this filed by using classname.filed still it didn't work .

 

Please let  me know how to access this field .

 

 

 

I have inserted the FeedItem in trigger(after update).But i got the following exception.

 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Entity is read-only: FeedItem: 

 

I have enabled Enable option in Chatter Settings.Can any one help to solve this above DML exception in Trigger?

Hi,

 

I'm trying to have a trigger do some validation upon insert and if some rules are not met then an error is displayed to the user and the data is not stored.  My problem is with the display formatting.  I'm trying to display something like:

 

Message 1

 

Message 2

 

To do so I have a block of code like:

 

string error_message = message1 + '\n\n' + message2;

f.addError(error_message);

return ;

 

The problem I'm facing is that I use this approach on two different objects an in one case it displays like I want it to and in another case it renders as "Message 1<br><br>Message 2".

 

Is there a particular way I have to format my error message to get the rendering to display properly?

 

Thanks,

Ruben

  • April 17, 2013
  • Like
  • 0

Hi All , can anyone tell wht is meant by Error :Static Resource named UploadTemplate does not exist

I am new to VF code. In my VF code i getting this error.

I have a custom field which I need to delete and it is also a required field which is used in apex class and visualforce page. I dnt need that feld anymore.. is there a way I  can delete a field or make that field which is not a required field. 

Hi All,

This is the VF page code to disply google map for single Account (billing address)it is working. like this i want to display all the account on Google map. Can anyone please tell how to resolve this issue.Also tell what is the change i need to do for this.  

 

VF Code:

 

<apex:page standardController="Account" >
<apex:pageBlock >
<head>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {

var myOptions = {
zoom: 20,
mapTypeId: google.maps.MapTypeId.HYBRID,
mapTypeControl: true
}

var map;
var marker;

var geocoder = new google.maps.Geocoder();
var address = "{!Account.BillingStreet}, {!Account.BillingPostalCode} {!Account.BillingCity}, {!Account.BillingState}, {!Account.BillingCountry}";



var infowindow = new google.maps.InfoWindow({
content: "<b>{!Account.Name}</b>"
});

geocoder.geocode( { address: address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK && results.length) {
if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {

//create map
map = new google.maps.Map(document.getElementById("map"), myOptions);

//center map
map.setCenter(results[0].geometry.location);

//create marker
marker = new google.maps.Marker({
position: results[0].geometry.location,
map: map,
title: "{!Account.Name}"
});

//add listeners
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
google.maps.event.addListener(infowindow, 'closeclick', function() {
map.setCenter(marker.getPosition());
});

}

} else {
$('#map').css({'height' : '15px'});
$('#map').html("Oops! {!Account.Name}'s address could not be found, please make sure the address is correct.");
resizeIframe();
}
});

function resizeIframe() {
var me = window.name;
if (me) {
var iframes = parent.document.getElementsByName(me);
if (iframes && iframes.length == 1) {
height = document.body.offsetHeight;
iframes[0].style.height = height + "px";
}
}
}

});
</script>

<style>
#map {
font-family: Arial;
font-size:12px;
line-height:normal !important;
height:500px;
background:transparent;
}
</style>

</head>

<body>
<div id="map"></div>
</body>
</apex:pageBlock>
</apex:page>

 

Regards,

Udaya

I've tried to do the sample 'Receiving Notifications in a Visualforce Page' of the page http://wiki.developerforce.com/index.php/Getting_Started_with_the_Force.com_Streaming_API

 

I'm doing everything as it comes in the document but don't get it to work. I'm on the na12 instance. When I try it on Chrome It gives me these errors

 

POST https://c.na12.visual.force.com/cometd/handshake 401 (Request requires authentication)

 

I also tried the equivalent sample of the document http://www.salesforce.com/us/developer/docs/api_streaming/api_streaming.pdf (page 11) but It gives me these errors

 

Uncaught TypeError: Object [object Object] has no method 'reset'
org.cometd.LongPollingTransport.resetcometd_js:2102
resetcometd_js:120
_handshakecometd_js:730
handshakecometd_js:1421
initcometd_js:1409
(anonymous function)StreamingPagePDF:89
d.extend._Deferred.f.resolveWithjquery.min.js:16
d.extend.readyjquery.min.js:16
c.addEventListener.y

 

I don't know what to do

 

Thank you in advance

 

David

I just added a NameSpace to my Developer org, and now 2 tests fail with an awful error message.  I'm tempted to just remove the tests so I can actually upload the package.

 

The code hasn't changed, and tests still pass in installed orgs that have the unmanaged package.

 

Error debug lines:

 

21:18:53.48|USER_DEBUG|[7,9]|DEBUG|query string: Select Id, recordId__c FROM chttrunfollow__UnfollowQueue__c WHERE scheduledUnfollowDate__c<= TODAY AND IsDeleted=FALSE
21:18:53.48|METHOD_EXIT|[7,9]|system.debug(String)
21:18:53.48|METHOD_ENTRY|[8,52]|database.query(String)
21:18:53.48|SOQL_EXECUTE_BEGIN|[8,52]|Aggregations:0|Select Id, recordId__c FROM chttrunfollow__UnfollowQueue__c WHERE scheduledUnfollowDate__c<= TODAY AND IsDeleted=FALSE
21:18:53.51|SOQL_EXECUTE_END|[8,52]|Rows:3
21:18:53.51|METHOD_EXIT|[8,52]|database.query(String)
21:18:53.51|METHOD_ENTRY|[9,9]|system.debug(String)
21:18:53.51|METHOD_ENTRY|[9,31]|LIST<chttrunfollow__UnfollowQueue__c>.size()
21:18:53.52|METHOD_EXIT|[9,31]|LIST<chttrunfollow__UnfollowQueue__c>.size()
21:18:53.52|USER_DEBUG|[9,9]|DEBUG|size: 3
21:18:53.52|METHOD_EXIT|[9,9]|system.debug(String)
21:18:53.52|METHOD_ENTRY|[10,16]|Database.getQueryLocator(String)
21:18:53.52|SOQL_EXECUTE_BEGIN|[10,16]|Aggregations:0|Select Id, recordId__c FROM chttrunfollow__UnfollowQueue__c
21:18:53.77|SOQL_EXECUTE_END|[10,16]|Rows:3
21:18:53.77|METHOD_EXIT|[10,16]|Database.getQueryLocator(String)
21:18:53.105|FATAL_ERROR|Internal Salesforce.com Error

 I saw this thread, and added my namespace, but no luck:

http://community.salesforce.com/t5/Visualforce-Development/Visualforce-An-internal-server-error-has-occurred/m-p/167376

 

Class that produces the above error:

 

global with sharing class UnfollowProcessUnfollowQueueBatch implements Database.Batchable<sObject>{

   global String sObjectQuery ='Select Id, recordId__c FROM chttrunfollow__UnfollowQueue__c WHERE scheduledUnfollowDate__c<= TODAY' ;
   
   global Database.QueryLocator start(Database.BatchableContext BC){
        system.debug('query string: '+sObjectQuery);
        List<chttrunfollow__UnfollowQueue__c> uq = database.query(sObjectQuery);
        system.debug('size: '+uq.size());
        return Database.getQueryLocator(sObjectQuery);
   }

   global void execute(Database.BatchableContext BC, List<sObject> scope){
        Set<Id> recordIds=new Set<Id>();
  
        for(sObject s : scope){
            recordIds.add(String.ValueOf(s.get('recordId__c')));
        }//for
    
        //This is the method that unfollows all people from the records 
        try{
            UnfollowRecords.UnfollowRecordsButtonAction(recordIds);
            delete scope;
        } catch (Exception e) {
        }//try
   }

   global void finish(Database.BatchableContext BC){
       AsyncApexJob a = [Select Id, Status, NumberOfErrors, JobItemsProcessed, TotalJobItems, CreatedBy.Email from AsyncApexJob where Id =:BC.getJobId()];
  }

}//UnfollowRecordsFromDelayQueueBatch

Other Class that calls this class:

 

global with sharing class unfollowTryBatchJobsAgain{

    public static void unfollowTryBatchJobsAgain(){
        Integer numBatchApexJobsLimit=5;//at time of coding, there are at most 5 concurrent batch apex jobs in any org
        List<AsyncApexJob> numBatchJobs = [SELECT Id, Status FROM AsyncApexJob WHERE Status = 'Queued' OR Status = 'Processing'];

        //This is the number of jobs that can be queued up by this method
        Integer numJobsAvailable=numBatchApexJobsLimit - numBatchJobs.size();

        if(numJobsAvailable>0){
            List<UnfollowBatchJobsQueue__c> batchJobsQueued=[SELECT Id, IsDeleted, delayJob__c, delayRulesIncluded__c, evalateEachRecordForDaysDelay__c, numRulesUsedInThisObject__c, objectName__c, sObjectQuery__c FROM UnfollowBatchJobsQueue__c WHERE IsDeleted=FALSE ORDER BY  CreatedDate ASC];
            //Goal here is to process the delay queue first as it's more important than the others. Rather than do 2 queries, it's handled with variables here:
            Integer delayJobNum=1000;//initialize to huge number as a backup
            for (Integer i=0;i<batchJobsQueued.size();i++){
                if (batchJobsQueued[i].delayJob__c==TRUE){
                    delayJobNum=i;
                    break;
                }//if 2
            }//for 1
            
            for(Integer i=0; i<numJobsAvailable && i<batchJobsQueued.size(); i++){
                //if this is the high priority "delayed records scheduled for unfollow today" job, do it first
                if (delayJobNum!=1000){
                    UnfollowProcessUnfollowQueueBatch unfollowDelayedRecords= new UnfollowProcessUnfollowQueueBatch();
                    unfollowDelayedRecords.sObjectQuery=batchJobsQueued[delayJobNum].sObjectQuery__c;
                    try{
                        Id unfollowRulesProcessId = Database.executeBatch(unfollowDelayedRecords, 200); 
                        delete batchJobsQueued[delayJobNum];
                    } catch(exception e){
//                        system.debug('Either the batch failed or the job deletion from teh queue failed: '+e);
                    }//try
                } else if(batchJobsQueued[i].delayRulesIncluded__c==FALSE){
                 //is this the simple case with no "days delay" rules?
                    UnfollowRecordsBatch  unfollowRecords= new UnfollowRecordsBatch();
                    unfollowRecords.ObjectName=batchJobsQueued[i].objectName__c;
                    unfollowRecords.numRulesUsedInThisObject=batchJobsQueued[i].numRulesUsedInThisObject__c.intValue();
                    unfollowRecords.sObjectQuery =  batchJobsQueued[i].sObjectQuery__c;
                
                    try{
                        Id unfollowRulesProcessId = Database.executeBatch(unfollowRecords, 200); 
                        delete batchJobsQueued[i];
                    } catch(exception e){
//                        system.debug('Either the batch failed or the job deletion from the queue failed: '+e);
                    }//try
                } else {
                //else it's the more complex case where we need to check for the unfollow date
                    UnfollowQueueDelayRecordsBatch queueDelayRecords= new UnfollowQueueDelayRecordsBatch();
                    queueDelayRecords.ObjectName=batchJobsQueued[i].objectName__c;
                    queueDelayRecords.sObjectQuery =  batchJobsQueued[i].sObjectQuery__c;
                    queueDelayRecords.evalateEachRecordForDaysDelay=batchJobsQueued[i].evalateEachRecordForDaysDelay__c;
                    if(queueDelayRecords.evalateEachRecordForDaysDelay==TRUE){
//let's cross our fingers that the rule criteria didn't change between when this job first ran and now :(  
//Will the code fail elegantly if the rules were changed?
//I'd rather not create a 3rd queue just to save the state of the rules due to stupid batch apex limits
                        queueDelayRecords.delayRules=[Select Id, ObjectName__c, Active__c, FieldName__c, FieldType__c, Operator__c, Value__c, DaysDelay__c FROM UnfollowRule__c WHERE DaysDelay__c>0 AND Active__c = TRUE AND objectName__c=:queueDelayRecords.ObjectName]; 
                    }//if 3

                    try{
                        Id unfollowRulesProcessId = Database.executeBatch(queueDelayRecords, 200); 
                        delete batchJobsQueued[i];
                    } catch(exception e){
//                        system.debug('Either the batch failed or the job deletion from the queue failed: '+e);
                    }//try
                }//if 2
            }//for 1
        }//if 1
        
/*                        
        //This will store the job definition for the jobs over the numBatchApexJobsLimit to be run later
        List<UnfollowBatchJobsQueue__c> batchJobsQueued=new List<UnfollowBatchJobsQueue__c>();

        List<UnfollowRule__c> activeNonDelayedRules=[Select Id, ObjectName__c, Active__c, FieldName__c, FieldType__c, Operator__c, Value__c, DaysDelay__c FROM UnfollowRule__c WHERE (DaysDelay__c<1 OR DaysDelay__c=null) AND Active__c = TRUE];
        
        //now count the # rules for each object to pass into the email later
        For (UnfollowRule__c rule:activeNonDelayedRules){
            List<UnfollowRule__c> rules=new List<UnfollowRule__c>();
            if(objectRulesMap.containsKey(rule.ObjectName__c)){
                //get the existing rules in the map & add the new one
                rules=objectRulesMap.get(rule.ObjectName__c);
                rules.add(rule);
                objectRulesMap.remove(rule.ObjectName__c);
                objectRulesMap.put(rule.ObjectName__c, rules);
            } else {
                rules.add(rule);
                objectRulesMap.put(rule.ObjectName__c,rules);
            }//if 1
        }//for 1

        //Now queue up all the batch jobs
        for (String objectName:objectRulesMap.keyset()){
            //First check if there's a slot available - max of 5 concurrent jobs across all apps
            addFieldNames=FALSE;            
            query=buildQuery(objectName, objectRulesMap.get(objectName), addFieldNames);
            if(numJobsAvailable>0){
                numJobsAvailable--;//subtract one from the limit
                UnfollowRecordsBatch  unfollowRecords= new UnfollowRecordsBatch();
                unfollowRecords.ObjectName=objectName;
    
                unfollowRecords.numRulesUsedInThisObject=objectRulesMap.get(objectName).size();
                unfollowRecords.sObjectQuery =  query;
//                system.debug('The sObjectQuery string is: '+unfollowRecords.sObjectQuery);
                
                Id unfollowRulesProcessId = Database.executeBatch(unfollowRecords, 200); 
            }else{
                String sObjectQuery = query;
//                system.debug('There are 5 batch jobs already running, so this job is not scheduled.  Delay Job: TRUE, Object: '+objectName+', # Rules: '+objectRulesMap.get(objectName).size()+', Query: '+sObjectQuery );
                UnfollowBatchJobsQueue__c job=new UnfollowBatchJobsQueue__c(delayJob__c=FALSE, delayRulesIncluded__c=FALSE, objectName__c=objectName, numRulesUsedInThisObject__c=objectRulesMap.get(objectName).size(), sObjectQuery__c=sObjectQuery);
                batchJobsQueued.add(job);
            }//if 1
        }//for 1
        try{
            if(batchJobsQueued.size()>0){
                insert batchJobsQueued;
            }//if 1
        }catch (DMLException e){
//            system.debug('The batch jobs were not added to the queue successfully, likely due to dupe object name.  Error: '+e);
        }//try
*/        
    }//unfollowTryBatchJobsAgain
}//unfollowTryBatchJobsAgain

 

 

 

 

Hello,

 

I developed a managed package. And some of my clients experience an error : 

 

Argument 1 cannot be null
An unexpected error has occurred. Your solution provider has been notified. (TWE)

 

How can I find the reason of this error, at least line in source code where error has occured?

 

Thanks,

Mikhail

I need to set Session ID and Server URL when page loads in controller class. This is required to call external synchronous web service call