-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
7Questions
-
3Replies
Test class for select id from 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
-
- David Herrero 5
- June 12, 2017
- Like
- 0
- Continue reading or reply
detail page button not visible in lightning
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
-
- David Herrero 5
- May 10, 2017
- Like
- 0
- Continue reading or reply
sforce.one.navigateToURL not working in Visualforce page
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
-
- David Herrero 5
- March 28, 2017
- Like
- 0
- Continue reading or reply
Account Contact Relationship API
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
-
- David Herrero 5
- March 17, 2017
- Like
- 0
- Continue reading or reply
Using AggregateResult inside Execute method of a Batch Class
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
}
}
-
- David Herrero 5
- December 08, 2016
- Like
- 1
- Continue reading or reply
Deploy a flow with migration tool
<?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
-
- David Herrero 5
- October 20, 2016
- Like
- 0
- Continue reading or reply
Default value in a multipick list not working when render a previously not render pageblock
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
-
- David Herrero 5
- June 13, 2016
- Like
- 0
- Continue reading or reply
Using AggregateResult inside Execute method of a Batch Class
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
}
}
-
- David Herrero 5
- December 08, 2016
- Like
- 1
- Continue reading or reply
sforce.one.navigateToURL not working in Visualforce page
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
- David Herrero 5
- March 28, 2017
- Like
- 0
- Continue reading or reply
Account Contact Relationship API
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
- David Herrero 5
- March 17, 2017
- Like
- 0
- Continue reading or reply
Using AggregateResult inside Execute method of a Batch Class
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
}
}
- David Herrero 5
- December 08, 2016
- Like
- 1
- Continue reading or reply