• S.Mac-Intosh
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 19
    Replies
Recently i'm getting an error when i'm trying to open my Chatter actions. Im getting this error on al my custom chatter actions which are linked to a VF page. The error code is everytime i get the error different. The action have worked for a long time.
User-added image

The code of one of these pages is:
 
<apex:page standardController="VG_Availability__c" extensions="AvailabilityCheckInOutController" docType="html-5.0" applyHtmlTag="false" showheader="false" standardstylesheets="false">
  
    <html>
    <head>
      <meta charset="utf-8" />
      <meta http-equiv="Cache-control" content="public" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      
      <!--<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"/>-->
      <apex:includeScript value="{!$Resource.GoogleApiJS}"/>

      <!-- alertify -->
      <apex:stylesheet value="{!URLFOR($Resource.alertify, 'alertify.js-0.3.11/themes/alertify.core.css')}"/>
      <apex:stylesheet value="{!URLFOR($Resource.alertify, 'alertify.js-0.3.11/themes/alertify.bootstrap.css')}"/>
      <apex:includeScript value="{!URLFOR($Resource.alertify, 'alertify.js-0.3.11/lib/alertify.min.js')}"/>
        
      <apex:stylesheet value="{!URLFOR($Resource.BootstrapSF1, 'dist/css/bootstrap.css')}"/>
      <apex:stylesheet value="{!URLFOR($Resource.BootstrapSF1, 'dist/css/docs.min.css')}"/>
      <apex:includeScript value="{!URLFOR($Resource.BootstrapSF1, 'dist/js/docs.js')}"/>

      <!-- Bootstrap -->
      <!--<apex:stylesheet value="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"/>
      <apex:stylesheet value="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/>
      <apex:includeScript value="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"/>-->
      
            
    <apex:includeScript value="{!$Resource.BootstrapMin}"/>
    <apex:stylesheet value="{!$Resource.BootStrapThemeMinC}"/>
    <apex:stylesheet value="{!$Resource.BootStrapMinC}"/>
        
     <style>
        .alertify-logs {
            top: 150px;
            right: 10px; 
        }   
     </style>
           
     </head>
      <form>
        <fieldset>
            <legend>Welcome to Racktime Check-In App</legend>
            <div class="form-group">
                <label for="details">Details</label>
                <textarea rows="5" class="form-control" id="details" name="details" placeholder="extra informatie bij check-in"></textarea>
                
            </div>
            <div id="working" style="display:none">
                <div class="progress">
                    <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
                    </div>
                </div> 
            </div>
        </fieldset>     
      </form>

    <!--<script type='text/javascript' src='/canvas/sdk/js/publisher.js'></script>-->
    <apex:includeScript value="{!$Resource.SF1Publisher}"/>
    
    <script>
     var sf1=false;
     $(document).ready(function(){
     if ( (typeof sforce != 'undefined') && (sforce != null) ) {
            sf1=true;
            Sfdc.canvas.publisher.subscribe({name: "publisher.post", onData:function(e) {
                submitted();
            }});
                                                        
            Sfdc.canvas.publisher.subscribe({name: "publisher.showPanel",
                onData:function(e) {
            Sfdc.canvas.publisher.publish({name:"publisher.setValidForSubmit", payload:"true"});
            }});
            }
        });
      
    function saveItem()
    {
        $('#working').toggle();       
        if (navigator.geolocation){
            navigator.geolocation.getCurrentPosition(geoSuccess, geoError, {maximumAge: 0, timeout:30000, enableHighAccuracy: true});      
        }
        else{
            alertify.error('Geolocation not supported');
        }  
        return false;  
    }

    function geoError(error) 
    {
        var code='';
        if (error.code == error.PERMISSION_DENIED) {
            code='Permission Denied';
        }
        else if (error.code == POSITION_UNAVAILABLE){
            code='Position Unavailable';
        }
        else if (error.code == TIMEOUT){
            code='Timeout';
        }             
        alertify.error('Unable to capture location : ' + code);
    }
    
    function geoSuccess(position)
    {  
        saveToServer(position.coords.latitude, position.coords.longitude);
    }
    
    function saveToServer(lat, long)
    { 
        var details=$("#details").val();
        try
        {
            Visualforce.remoting.Manager.invokeAction(
            '{!$RemoteAction.AvailabilityCheckInOutController.Checkin}', 
            details, lat, long, '{!VG_Availability__c.Id}',
            function(result,event){processResult(result,event)}
            );
        }
        catch (e){
            alertify.error('Save failed : ' + e.getMessage());
        }      
    }
  
    function closeAction()
    {
        Sfdc.canvas.publisher.publish({name: "publisher.close", payload:{ feed:"true", refresh:"true"}});
    } 
    
    function processResult(result, event)
    {
        $('#working').toggle();
        if (event.status) 
        {
            if (result=='ERRORCHECKIN')
            {
                alertify.error('Already Checked In!')
                setTimeout(closeAction, 8000);
            }
            else if (result=='SUCCESS')
            {
                alertify.success('Check In Completed');
                setTimeout(closeAction, 3000);
            }
            else{
                alertify.error('Checkin failed : ' + result);
            }
        }
        else{
            alertify.error('Remoting error : ' + event.message);
        }
    }
    
    function submitted() 
    {
        saveItem();
    }
    </script>   
</html>
</apex:page>

 
Hello,

Atm i'm getting the error: Too many query rows: 50001
This because the functionality will insert up to 5000 records.
The functionality works fine but Salesforce gives me this error because he thinks its wrong.
How can i prevent this error? Some sources told me that batch apex should work but i didn't succeed in implementing this.

Code snippit:
01 public void CreateSOLocations(){
02            
03 
04            
05            Fill_Item_Ids();
06            
07            
08            
09            Check_Amount_Items();       
10            
11            
12            String VGWO_ID = Get_WO();
13            String Customer_Account = Get_Main_Acc();
14            
15            for(AggregateResult a: GroupBy_Project_Locations){
16                             
17                PBSI__PBSI_Sales_Order__c NewRecord = new PBSI__PBSI_Sales_Order__c();
18                id myid = string.valueof(a.get('Account_Location_ID__c'));
19                /// system.debug('Blabla  ' + myid);
20                NewRecord.Account_Location__c = myid;
21                NewRecord.PBSI__Customer__c = Customer_Account;
22                NewRecord.VG_Work_Order__c = VGWO_ID;
23                NewRecord.Project__c = ProjectID;                       
24 
25                NewSOs.add(NewRecord);
26                
27                }
28                Insert NewSOs;
29                
30                integer i = 0;
31                
32                for(AggregateResult a: GroupBy_Project_Locations){
33                
34                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item1')));
35                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item2')));
36                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item3')));
37                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item4')));
38                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item5')));
39                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item6')));
40                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item7')));
41                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item8')));
42                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item9')));
43                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item10')));
44                 
45                for(Integer c = 0; c < Amount_DifferentItems ;c++ ){
46                           
47                    PBSI__PBSI_Sales_Order_Line__c NewSOLine = new PBSI__PBSI_Sales_Order_Line__c();
48                    NewSOLine.PBSI__Sales_Order__c = NewSOs[i].id;
49                    NewSOLine.PBSI__Item__c = Id_ProjectItem[c];
50                    NewSOLine.PBSI__Quantity_Needed__c = Amount_ProjectItem[c];
51                    
52                    if(NewSOLine.PBSI__Quantity_Needed__c != NULL){
53                        NewSOLines.add(NewSOLine);
54                    }
55                    
56                    
57                    
58                    }
59            i++;
60            Amount_ProjectItem.clear();
61                       
62                       
63            }
64            
65            Insert NewSOLines;     
66      
67 
68         }


Can someone help me out with this?

How can i get the 'Average test coverage' of the following code to 75%? It is 0% ATM. My code:

 

Public with sharing class InsertClass{

Public string InsertTestObject{

Get{

TestObject__c Record = [SELECT Testobject__c.name FROM Testobject__c WHERE Id ='a0Cb0000000Tvw5'];
TestObject__c newRecord = Record.clone(false, true);
System.debug('Naam van testobject die wordt gekopieerd ' + newRecord );

newRecord.name = Record.Name + ' CLONE';
System.debug('Naam van testobject die wordt geinsert ' + newRecord.name );
insert newRecord;

return newRecord.id ;
}
}

Hey i'm trying to clone an account.

There are no errors in my code but he wont insert the copied account.

My second step is to edit some fields so it wont be exactly the same account.

Does someone know what i need to do?

My code is:

 

Public class InsertClass{


Public string InsertAccount{

Get{

Database.DMLOptions dmo = new database.DMLOptions();
dmo.AssignmentRuleHeader.UseDefaultRule= true;

///list<Account> WillBeClonedAccount = new list<Account>();

Account IsClonedAccount = [SELECT Account.Name, Account.Billing_Term__c FROM Account WHERE Id = :ApexPages.currentPage().getParameters().get('id')];

Account CopiedAccount = new Account();
CopiedAccount.Name = IsClonedAccount.Name;
CopiedAccount.Phone = '020384732';
CopiedAccount.Billing_Term__c = IsClonedAccount.Billing_Term__c;


///WillBeClonedAccount.add(CopiedAccount);

CopiedAccount.SetOptions(dmo);
insert(CopiedAccount);

/// insert(WIllbeClonedAccount);
return CopiedAccount.name ;
}
}
}

Hello,

Atm i'm getting the error: Too many query rows: 50001
This because the functionality will insert up to 5000 records.
The functionality works fine but Salesforce gives me this error because he thinks its wrong.
How can i prevent this error? Some sources told me that batch apex should work but i didn't succeed in implementing this.

Code snippit:
01 public void CreateSOLocations(){
02            
03 
04            
05            Fill_Item_Ids();
06            
07            
08            
09            Check_Amount_Items();       
10            
11            
12            String VGWO_ID = Get_WO();
13            String Customer_Account = Get_Main_Acc();
14            
15            for(AggregateResult a: GroupBy_Project_Locations){
16                             
17                PBSI__PBSI_Sales_Order__c NewRecord = new PBSI__PBSI_Sales_Order__c();
18                id myid = string.valueof(a.get('Account_Location_ID__c'));
19                /// system.debug('Blabla  ' + myid);
20                NewRecord.Account_Location__c = myid;
21                NewRecord.PBSI__Customer__c = Customer_Account;
22                NewRecord.VG_Work_Order__c = VGWO_ID;
23                NewRecord.Project__c = ProjectID;                       
24 
25                NewSOs.add(NewRecord);
26                
27                }
28                Insert NewSOs;
29                
30                integer i = 0;
31                
32                for(AggregateResult a: GroupBy_Project_Locations){
33                
34                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item1')));
35                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item2')));
36                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item3')));
37                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item4')));
38                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item5')));
39                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item6')));
40                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item7')));
41                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item8')));
42                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item9')));
43                Amount_ProjectItem.add(integer.valueof(a.get('Totaal_Item10')));
44                 
45                for(Integer c = 0; c < Amount_DifferentItems ;c++ ){
46                           
47                    PBSI__PBSI_Sales_Order_Line__c NewSOLine = new PBSI__PBSI_Sales_Order_Line__c();
48                    NewSOLine.PBSI__Sales_Order__c = NewSOs[i].id;
49                    NewSOLine.PBSI__Item__c = Id_ProjectItem[c];
50                    NewSOLine.PBSI__Quantity_Needed__c = Amount_ProjectItem[c];
51                    
52                    if(NewSOLine.PBSI__Quantity_Needed__c != NULL){
53                        NewSOLines.add(NewSOLine);
54                    }
55                    
56                    
57                    
58                    }
59            i++;
60            Amount_ProjectItem.clear();
61                       
62                       
63            }
64            
65            Insert NewSOLines;     
66      
67 
68         }


Can someone help me out with this?

Hey i'm trying to clone an account.

There are no errors in my code but he wont insert the copied account.

My second step is to edit some fields so it wont be exactly the same account.

Does someone know what i need to do?

My code is:

 

Public class InsertClass{


Public string InsertAccount{

Get{

Database.DMLOptions dmo = new database.DMLOptions();
dmo.AssignmentRuleHeader.UseDefaultRule= true;

///list<Account> WillBeClonedAccount = new list<Account>();

Account IsClonedAccount = [SELECT Account.Name, Account.Billing_Term__c FROM Account WHERE Id = :ApexPages.currentPage().getParameters().get('id')];

Account CopiedAccount = new Account();
CopiedAccount.Name = IsClonedAccount.Name;
CopiedAccount.Phone = '020384732';
CopiedAccount.Billing_Term__c = IsClonedAccount.Billing_Term__c;


///WillBeClonedAccount.add(CopiedAccount);

CopiedAccount.SetOptions(dmo);
insert(CopiedAccount);

/// insert(WIllbeClonedAccount);
return CopiedAccount.name ;
}
}
}

I'm new to using the Force.com IDE and Eclipse and I'm running into an issue. I'm trying to create a project that is connected to an org with a large number of managed packages installed. I want to look only at 3 classes, so I select only these three classes, however the IDE proceeds to download the contents of all "referenced packages", which is not what I want, and takes an extremely long time.

 

For some reason these do not appear in the project contents, but if I navigate to the workspace folder, the xml files for all referenced packages are clearly visible.

 

I'm finding this behaviour a bit strange, is there some way to avoid it? I.e. just download the classes I ask for?

 

I am using the standalone installer version, 64 bit, version 19

Going through the Force.com Workbook and on pg 31, trying to create an Apex Trigger by Right clicking on my project folder and trying to select New Apex Trigger, but I don't have that option. Rather I get the option to create a new Project, Folder, File, Example or Other.

Same thing when I tried to Create a New Application. Also, when I right click on my project and select Properties, I don't have an option to download the latest metadata changes on the server. I went and updated by force.com ide to the latest by going to Help and Software Updates and following the directions on this website for upgrading the ide.

Thanks for your help in advance.

Johns