• David Herrero 5
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies
Hi , I need to create  a test class for ObjectTerritory2Association.

I have ObjectTerritory2Association activated in my org. It is working properly but when inside a test class I insert an account , if I query on ObjectTerritory2Association it is empty.
How am I supposed to create a test class for this?


Thanks
Hi all,
We are trying to switch to lightning , and inside an object I can't see the "Detail page buttons".
They are not Javascript buttons, they are just a button who redirect to a visualforce page.

I can't find any information regarding this buttons and why I can't see them.

Any help?
Thanks
Hi,
I am totally new with lightning and I am trying to switch some objtects from classic to lightning.
I have one visualforce page that checks one variable, and if it is true it redirects to another direction.
In classic it uses the "window.location.href", but it won't work with lightning, so I have added the following code:
 
<apex:form id="form">
        
        <apex:outputPanel rendered="{!$User.UIThemeDisplayed == 'Theme4d'}">
            
            <script type="text/javascript">
            
            var precondition = {!Lead.Conversion_Precondition__c} || {!ISBLANK(Lead.RecordTypeId)};  
            
            if(precondition){
                String url="{!URLFOR($Action.Lead.Convert, Lead.Id, [retURL='/' + Lead.Id, nooppti=1, IsReminderSet_fu=0], true)}";
                sforce.one.navigateToSObject(url);
            }
            </script>        
        </apex:outputPanel>
        <apex:outputPanel rendered="{!$User.UIThemeDisplayed == 'Theme3'}">
            <script type="text/javascript">
            var precondition = {!Lead.Conversion_Precondition__c} || {!ISBLANK(Lead.RecordTypeId)};  
            if(precondition){
                
                window.location.href = "{!URLFOR($Action.Lead.Convert, Lead.Id, [retURL='/' + Lead.Id, nooppti=1, IsReminderSet_fu=0], true)}";
            }
            </script>
        </apex:outputPanel>

even if I put the sforce.one.navigateto alone it does not work.
any suggestion?

Thanks
I would like to validate if an account is in the Account Contact Relationship object. I can't find the Account Contact Relationship  API name.
As it is not possible to do it with the Lookup filter criteria, I 'd like to do in the trigger, but I am begining to think this is not possible neither.

Any tip with this issue?

Thanks

I have facing an error when I use an aggregateresult inside the execute method of a Batch Class.

I have being reviewing old post and I have read the solution provided here https://help.salesforce.com/apex/HTViewSolution?urlname=Aggregate-queries-and-Batch-Apex&language=en_US
but in that solution, the problem is in the start , not in the execute.

My batch class is like this :
global class BatchClass implements Database.Batchable<Sobject> {

global Database.QueryLocator start(Database.BatchableContext ctx) {
        String query = 'select a lot of records based in Ids and Dates';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext ctx, List<Sobject> sObjects) {
    for(AggregateResult result : [select field1__c,field2__c, sum(Net_Revenue__c) r from Revenue__c where Type__c = 'C' where :condition group by Corporate_Account__c, Year_Month__c]){
            revenues.get((Id)result.get('c')).addRevenue((String)result.get('m'), (Decimal)result.get('r'));
        }

When I execute the class, I get this.

First error: Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch

Any idea on how to resolve this?

Thanks
      
    }


}

I am trying to deploy a flow with ant migration tool but I am not ablo to do.
 
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
	<fullName>MyPackage</fullName>

	
	<types>
		<members>BE_Addendum_Creation_2017-17</members>
		<name>Flow</name>
	</types>
	<version>38.0</version>
</Package>

This is the package.xml (I try to deploy  version 17)
and the error :
[sf:retrieve] Waiting for server to finish processing the request...
[sf:retrieve] Request Status: Pending
[sf:retrieve] Request Status: Succeeded
[sf:retrieve] Retrieve warnings (1):
[sf:retrieve] package.xml - Entity of type 'Flow' named 'BE_Addendum_Creation_2017-17' cannot be found
[sf:retrieve] Finished request 09S7E000000aeKSUAY successfully.

BUILD SUCCESSFUL
Total time: 12 seconds

 
Hi,
I have a multipicklist and the first value is set to default value.
If I show this field in a page layout or directly in a visualforce page, it works fine and shows the supposed value as default value.
But if I have a VFpage where in the first step  the picklist is not showed and in the second steps it is showed, then the multipick list doesn't shows ANY default value marked.

Any idea of what can be happening?

Thanks 

I have facing an error when I use an aggregateresult inside the execute method of a Batch Class.

I have being reviewing old post and I have read the solution provided here https://help.salesforce.com/apex/HTViewSolution?urlname=Aggregate-queries-and-Batch-Apex&language=en_US
but in that solution, the problem is in the start , not in the execute.

My batch class is like this :
global class BatchClass implements Database.Batchable<Sobject> {

global Database.QueryLocator start(Database.BatchableContext ctx) {
        String query = 'select a lot of records based in Ids and Dates';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext ctx, List<Sobject> sObjects) {
    for(AggregateResult result : [select field1__c,field2__c, sum(Net_Revenue__c) r from Revenue__c where Type__c = 'C' where :condition group by Corporate_Account__c, Year_Month__c]){
            revenues.get((Id)result.get('c')).addRevenue((String)result.get('m'), (Decimal)result.get('r'));
        }

When I execute the class, I get this.

First error: Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch

Any idea on how to resolve this?

Thanks
      
    }


}

Hi,
I am totally new with lightning and I am trying to switch some objtects from classic to lightning.
I have one visualforce page that checks one variable, and if it is true it redirects to another direction.
In classic it uses the "window.location.href", but it won't work with lightning, so I have added the following code:
 
<apex:form id="form">
        
        <apex:outputPanel rendered="{!$User.UIThemeDisplayed == 'Theme4d'}">
            
            <script type="text/javascript">
            
            var precondition = {!Lead.Conversion_Precondition__c} || {!ISBLANK(Lead.RecordTypeId)};  
            
            if(precondition){
                String url="{!URLFOR($Action.Lead.Convert, Lead.Id, [retURL='/' + Lead.Id, nooppti=1, IsReminderSet_fu=0], true)}";
                sforce.one.navigateToSObject(url);
            }
            </script>        
        </apex:outputPanel>
        <apex:outputPanel rendered="{!$User.UIThemeDisplayed == 'Theme3'}">
            <script type="text/javascript">
            var precondition = {!Lead.Conversion_Precondition__c} || {!ISBLANK(Lead.RecordTypeId)};  
            if(precondition){
                
                window.location.href = "{!URLFOR($Action.Lead.Convert, Lead.Id, [retURL='/' + Lead.Id, nooppti=1, IsReminderSet_fu=0], true)}";
            }
            </script>
        </apex:outputPanel>

even if I put the sforce.one.navigateto alone it does not work.
any suggestion?

Thanks
I would like to validate if an account is in the Account Contact Relationship object. I can't find the Account Contact Relationship  API name.
As it is not possible to do it with the Lookup filter criteria, I 'd like to do in the trigger, but I am begining to think this is not possible neither.

Any tip with this issue?

Thanks

I have facing an error when I use an aggregateresult inside the execute method of a Batch Class.

I have being reviewing old post and I have read the solution provided here https://help.salesforce.com/apex/HTViewSolution?urlname=Aggregate-queries-and-Batch-Apex&language=en_US
but in that solution, the problem is in the start , not in the execute.

My batch class is like this :
global class BatchClass implements Database.Batchable<Sobject> {

global Database.QueryLocator start(Database.BatchableContext ctx) {
        String query = 'select a lot of records based in Ids and Dates';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext ctx, List<Sobject> sObjects) {
    for(AggregateResult result : [select field1__c,field2__c, sum(Net_Revenue__c) r from Revenue__c where Type__c = 'C' where :condition group by Corporate_Account__c, Year_Month__c]){
            revenues.get((Id)result.get('c')).addRevenue((String)result.get('m'), (Decimal)result.get('r'));
        }

When I execute the class, I get this.

First error: Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch

Any idea on how to resolve this?

Thanks
      
    }


}