-
ChatterFeed
-
0Best Answers
-
6Likes Received
-
0Likes Given
-
33Questions
-
17Replies
Package Install Error: Couldn't validate Quick Action
I'm creating a package and when I try and deploy it to my test org, I'm getting the following error:
Data_Summary_Object_Record_Page: Component [force:highlightsPanel] attribute [actionNames]: We couldn't validate Quick Action LeftProp_DSS__Data_Summary__c.Run_Summary_Now
Run_Summary_Now is an action (button) on the Data_Summary_Object_Record_Page which calls a flow.
I've verified that the action, page and flow are all in the package, and all work perfectly in the dev org.
Any ideas why this is failing? Also, how does one even validate a quick action, especially one that just calls a flow?
Thanks,
Steve
- Steve Berley
- June 11, 2022
- Like
- 0
- Continue reading or reply
update FileExtension on ContentVersion
So, I now have 820k files loaded all no FileExtension. It seems permissions are set so that I can’t edit the field on the CV record. Does anyone have a suggestion of how to correct this easily? Do you know if Support can grant update permission to the ContentVersion.FileExtension field?
Thanks
- Steve Berley
- May 02, 2022
- Like
- 0
- Continue reading or reply
which objects refer to Files?
- I started with a backup of the old system that included all files, etc. (checked both “Include images, documents, and attachments” and “Include Salesforce Files and Salesforce CRM Content document versions”)
- This generated 218 zip files. I’ve downloaded and extracted all to my local machine
- I’ve moved all files from the ContentVersion folders in each zip to a single folder to ease uploading.
- This folder had 524k files, all named with a salesforce id that starts with 068 (which are ContentVersion records). Sampling them, they’re a combination of short notes and scanned documents.
Here’s where it gets interesting… The old instance has:
- Roughly 19k ContentVersion records and the same number of ContentDocument records
- 18k FeedAttachment records
- 682 ContentNote records
Even after accounting for the CV, FA and CN records listed above, I still have nearly 500k files named 068….. that I can’t find any reference to in the system.
Where else should I look?
Thanks,
- Steve Berley
- April 21, 2022
- Like
- 0
- Continue reading or reply
EE org not allowing API access
"Invalid username, password, security token; or user locked out."
- I successfully logged in using the username/password moments ago.
- The security token was created today
- The login uses the "factory" system administrator profile
- The API works with dozens of other enterprise edition orgs, including many verified working properly today.
I'm at a loss as to why this org won't permit API access. Do you all have any thoughts as to why it's failing?
Thanks,
- Steve Berley
- March 18, 2022
- Like
- 0
- Continue reading or reply
cron every 14 days
Thanks,
- Steve Berley
- January 29, 2022
- Like
- 0
- Continue reading or reply
deserializing json datetime yields null
json:
{ "data": [ { "created_at": "2021-06-12T00:00:01.000Z", "id": "1403502310429392901", "text": "She means business \uD83D\uDC69\uD83C\uDFFD⚖️ Gugu Mbatha-Raw is Judge Renslayer in Marvel Studios' #Loki. Stream new episodes of the Original Series every Wednesday on @DisneyPlus. https://t.co/IwpY2eUvwd" } ] }
Deserializer from SuperFell's tool
// Generated by JSON2Apex http://json2apex.herokuapp.com/ public class Twitter_TimelineParser { public class Data { public String created_at; public String id; public String text; } public static Twitter_TimelineParser parse(String json) { return (Twitter_TimelineParser) System.JSON.deserialize(json, Twitter_TimelineParser.class); } }
created_at always returns a null, whether I try to capture it as a DateTime, Date or String. I really don't which type I get as long as I get the data since I can always manipulate it later.
Any idea's why?
Obviously this is the compact version relying on the native parser. I've also tried with the involved one and tried to capture the string then convert it within the parser. Still only yields null.
Thanks,
- Steve Berley
- June 13, 2021
- Like
- 0
- Continue reading or reply
mail setTemplateID not working
If instead, I use mail.setHtmlBody() it works fine. Any ideas why templates aren't working?
id templateID='00X1R000000f3T1UAI'; Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); mail.setTemplateId(templateID); Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
- Steve Berley
- June 10, 2021
- Like
- 0
- Continue reading or reply
abstract property declarations and value assignments
Do you know if this can be done? Is it possible to abstract the property declarations and the assignment of values to properties?
Thanks,
- Steve Berley
- May 28, 2021
- Like
- 0
- Continue reading or reply
No batch calls, but getting "No more than one executeBatch can be called from within a test method" error
I've got some code that's amazingly simple but is throwing the craziest error when I try to deploy.
- The code has 100% coverage in the sandbox with no errors
- Even when deploying from a brand new sandbox I get the error.
- There are no batch calls in the code
Thanks for your help...
Steve
The error is:
System.UnexpectedException: No more than one executeBatch can be called from within a test method. Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation.
The code follows...
trigger TaskTrigger on Task (before insert, before update, before delete, after insert, after update, after delete, after undelete) { if (trigger.isAfter && trigger.isInsert) { TaskHandler.evaluateTasks(trigger.new); } }
public with sharing class TaskHandler { // public TaskHandler() { } public static void evaluateTasks(list<task> newTasks){ set<string> didNums = new set<string>(); set<id> leadIDs = new set<id>(); for (task t : newTasks){ if ( string.isNotBlank(t.Dialpad__PhoneNumber__c) ) { didNums.add( LeadSourceHandler.scrubber(t.Dialpad__PhoneNumber__c) ); } if ( string.isNotBlank(t.WhoID) ) leadIDs.add(t.WhoID); } map<string, string> LeadSources = getLeadSources(didNums); set<id> LeadsInNeed = getLeadIDs(leadIDs); list<lead> leadsToUpdate = new list<lead>(); list<Lead_Source__c> newLeadSources = new list<Lead_Source__c>(); for (task t : newTasks){ string didNum = LeadSourceHandler.scrubber(t.Dialpad__PhoneNumber__c); if ( LeadsInNeed.contains(t.WhoID) ){ if ( LeadSources.containsKey( didNum ) ) { leadsToUpdate.add( new Lead(id=t.WhoID, LeadSource = LeadSources.get( didNum ) ) ); } else { newLeadSources.add( new Lead_Source__c(name = t.Dialpad__PhoneNumber__c ) ); } } } if( leadsToUpdate != null && leadsToUpdate.size() > 0 ) update leadsToUpdate; if( newLeadSources != null && newLeadSources.size() > 0 ) insert newLeadSources; // save new ones } public static set<id> getLeadIDs(set<id> leadIDs){ map<id, lead> leadsInNeed = new map<id, lead>([select id from lead where LeadSource = null and id in :leadIDs]); return leadsInNeed.keySet(); } public static map<string, string> getLeadSources(set<string> didNums){ map<string, string> m = new map<string, string>(); for (Lead_Source__c ls : [select name, lead_source__c from Lead_Source__c where name in :didNums and Lead_Source__c != null]){ m.put(ls.name, ls.Lead_Source__c); } return m; } }
@isTest private class TaskHandler_test { // private TaskHandler_test() { } @isTest static void AssignLeadSourcesPrimary_test(){ insert new Lead_Source__c(name='1234', lead_source__c='source 1'); lead l1 = new lead(lastname='lead 1', Language__c='English', Location__c='Los Angeles'); lead l2 = new lead(lastname='lead 2', Language__c='English', Location__c='Los Angeles'); insert new list<lead>{l1, l2}; task t1 = new task(subject='task 1', whoID=l1.id, activitydate=date.today(), Dialpad__PhoneNumber__c='1234'); task t2 = new task(subject='task 2', whoID=l2.id, activitydate=date.today(), Dialpad__PhoneNumber__c='47'); insert new list<task>{t1, t2}; } }
- Steve Berley
- February 24, 2021
- Like
- 0
- Continue reading or reply
where to manage coupon codes
I have a new package and I want to give a discount to an early adopter. I see the coupon code field in the checkout process but I can't figure out where to manage coupon codes in the partners site.
What am I missing?
Thanks,
Steve
- Steve Berley
- January 14, 2021
- Like
- 0
- Continue reading or reply
Batch Apex workaround for - Semi join sub-selects are not allowed with the 'OR' operator
SELECT id, name FROM Account WHERE name = 'whatever' OR id IN ( SELECT accountID FROM contact WHERE lastname = 'something' )No surprise that it yields the error:
MALFORMED_QUERY: Semi join sub-selects are not allowed with the 'OR' operator
The challenge is, how do you accomplish this type of goal in batch apex?
The only idea I've come up with is to split the query into two parts
Query A: SELECT id FROM Account WHERE id IN ( SELECT accountID FROM contact WHERE lastname = 'something' )
Query B: SELECT id, name FROM Account WHERE name = 'whatever'
- Make the batch class stateful and in the init store the results of Query B to a map.
- Make Query A the one returned by the batch start() method.
- In the execute() method, process the scope (from query A) and as all records from the map of query B as they're processed.
- In the finish() method process records that remain in the map of query B after all query A results handled in the batches.
How have you all solved this problem?
Thanks,
- Steve Berley
- December 23, 2020
- Like
- 0
- Continue reading or reply
email.setOrgWideEmailAddressId() causes messages to go to spam
I'm finding if I set an org wide email address, using setOrgWideEmailAddressId(), messages always go to spam. If I don't set it they avoid spam but don't come from the desired sender.
Anyone have suggestions of how to control the sender and stay out of spam?
Thanks,
Steve
- Steve Berley
- November 25, 2020
- Like
- 0
- Continue reading or reply
Generically access child records in a parent-child query
In the example below:
- 1 and 2 work and yield the same result, as you’d expect
- 3 works perfectly
- 4 errors with: "Invalid field Contacts for Account"
Thanks,
list<account> aa = [SELECT name, ( SELECT name FROM Contacts ) FROM Account]; for (account a : aa) { system.debug('-- 1: '+a.name); system.debug('-- 2: '+a.get('name')); system.debug('-- 3: '+a.contacts); system.debug('-- 4: '+a.get('Contacts')); // errors out }
- Steve Berley
- August 30, 2020
- Like
- 0
- Continue reading or reply
Limit so only one user can run batch at a time?
I have a client who has a batch process that generates a lot of data, and because of this it takes a bit to run.
Since the process needs to be manually triggered, is it possible to prevent someone from starting it if another user already has it running?
Could I query active jobs and throw a message if it's in queue?
Thanks,
Steve
- Steve Berley
- July 30, 2020
- Like
- 0
- Continue reading or reply
setOrgWideEmailAddressId() giving Invalid ID error
Even though the OWE email address is verified and I’m using the id retrieved from querying the owe object — it ALWAYS gives an “Invalid Id” error.
What am I doing wrong?
- Steve Berley
- July 01, 2020
- Like
- 0
- Continue reading or reply
Generating a PDF - want to change the page footer from within a loop
I have a VF page that generates what we call Route Sheets. Each one takes 1-2 pages and the whole printout is about 55 pages long. Each Route starts on a new page. This is all fine.
The challenge is -- I'd like to include the route name on every page so was thinking of placing it in the page footer. To accomplish this I'd need to change the footer with each iteration through the loop.
Can that be done? If not, do you have other suggestions?
Thanks,
Steve
<apex:page controller="GenerateRouteSheets" deferLastCommandUntilReady="true" renderAs="PDF" applyBodyTag="false" action="{!loadData}"> <!-- <apex:page controller="GenerateRouteSheets" deferLastCommandUntilReady="true" renderAs="PDF" applyBodyTag="false" > --> <head> <style> @page{ size: landscape; @bottom-right { font-family: 'Arial Unicode MS'; font-size: 13px; content: "Page " counter(page) " of " counter(pages); } } </style> </head> <script> var dt = new Date(); document.getElementById("datetime").innerHTML = dt.toLocaleString(); </script> <body> <apex:pageBlock > <apex:repeat value="{!routes}" var="r"> <div style="page-break-after:always; "> Route {!r} ~~ SNIP ~~ </div> </apex:repeat> </apex:pageBlock> </body> </apex:page>
- Steve Berley
- May 27, 2020
- Like
- 0
- Continue reading or reply
suddenly getting errors from force:project:create
17:08:30.275 sfdx force:project:create --projectname Eden-tncDev --outputdir /Users/Steve/Dev/sfdx --template standard ERROR running force:project:create: Command failed with ENOENT: npm root -g --prefix /Users/Steve/Dev/sfdx/.yo-repository --loglevel error spawnSync npm ENOENT 17:08:30.696 sfdx force:project:create --projectname Eden-tncDev --outputdir /Users/Steve/Dev/sfdx --template standard ended with exit code 1
I've already tried reinstalling the Salesforce extensions suite with no luck. Any thoughts?
Thanks,
Steve
- Steve Berley
- May 13, 2020
- Like
- 0
- Continue reading or reply
Address changed but can't capture when re-geocoded
However, if one of the accounts moves to a new address, I can’t capture the event to update the distance since I can’t seem to identify when the re-geocoding is complete.
Currently, my trigger is as below..
if(trigger.isAfter && trigger.isUpdate){ set<id> needsUpdate = new set<id>(); for (account is : trigger.new){ account was = trigger.oldMap.get(is.id); if( is.billinglatitude != was.billinglatitude || is.billinglongitude != was.billinglongitude) needsUpdate.add(is.id); } // call to update the distance }
This isn't catching the event so needsUpdate is always blank.
Also, the Data Integration rule is NOT set to bypass triggers (see below).
Has anyone figured a way around this problem?
Thanks a ton for your help...
Steve
- Steve Berley
- May 01, 2020
- Like
- 0
- Continue reading or reply
CLI: unexpected end of json input
Has anyone else come across/resolved this problem?
- Steve Berley
- February 24, 2020
- Like
- 0
- Continue reading or reply
call javascript automatically based on changes to record
I also have a field on account called Status.
The button can be pushed any time. However it must be clicked when Status is set to 47.
Since the users are forgetful i want to automatically call the window.open() for them whenever status=47.
How do I do this - by any realistic means (apex, wfr, flow, pb....)
Thanks,
Steve
- Steve Berley
- February 21, 2018
- Like
- 0
- Continue reading or reply
Using VS Code and connecting to Salesforce (replacing the MM layer)
Thanks,
Steve
- Steve Berley
- February 12, 2018
- Like
- 5
- Continue reading or reply
pass class method name as parameter to another method?
I've got a circumstance where I need to pass the name of a class method to another method which would execute then passed method.
Example:
the class I'd want to call:
public class1 { public static void methodA() { }; }
The class I'd pass the method name to...
public class2 { public static void methodRunner(string methodName) { run( class1.methodName() ); // call that would execute the method (TBD) } }
so the call would be -
class2.methodRunner( class1.methodA );
In case you're wondering why go to all this work?
I'd like to create a generic way to run class methods as batch processes from the console in prod to efficiently retrofit existing data - without littering the prod org with lots of one-time use code.
Looking forward to everyone's collective insights...
Thanks,
Steve
- Steve Berley
- May 05, 2017
- Like
- 1
- Continue reading or reply
EE org not allowing API access
"Invalid username, password, security token; or user locked out."
- I successfully logged in using the username/password moments ago.
- The security token was created today
- The login uses the "factory" system administrator profile
- The API works with dozens of other enterprise edition orgs, including many verified working properly today.
I'm at a loss as to why this org won't permit API access. Do you all have any thoughts as to why it's failing?
Thanks,
- Steve Berley
- March 18, 2022
- Like
- 0
- Continue reading or reply
No batch calls, but getting "No more than one executeBatch can be called from within a test method" error
I've got some code that's amazingly simple but is throwing the craziest error when I try to deploy.
- The code has 100% coverage in the sandbox with no errors
- Even when deploying from a brand new sandbox I get the error.
- There are no batch calls in the code
Thanks for your help...
Steve
The error is:
System.UnexpectedException: No more than one executeBatch can be called from within a test method. Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation.
The code follows...
trigger TaskTrigger on Task (before insert, before update, before delete, after insert, after update, after delete, after undelete) { if (trigger.isAfter && trigger.isInsert) { TaskHandler.evaluateTasks(trigger.new); } }
public with sharing class TaskHandler { // public TaskHandler() { } public static void evaluateTasks(list<task> newTasks){ set<string> didNums = new set<string>(); set<id> leadIDs = new set<id>(); for (task t : newTasks){ if ( string.isNotBlank(t.Dialpad__PhoneNumber__c) ) { didNums.add( LeadSourceHandler.scrubber(t.Dialpad__PhoneNumber__c) ); } if ( string.isNotBlank(t.WhoID) ) leadIDs.add(t.WhoID); } map<string, string> LeadSources = getLeadSources(didNums); set<id> LeadsInNeed = getLeadIDs(leadIDs); list<lead> leadsToUpdate = new list<lead>(); list<Lead_Source__c> newLeadSources = new list<Lead_Source__c>(); for (task t : newTasks){ string didNum = LeadSourceHandler.scrubber(t.Dialpad__PhoneNumber__c); if ( LeadsInNeed.contains(t.WhoID) ){ if ( LeadSources.containsKey( didNum ) ) { leadsToUpdate.add( new Lead(id=t.WhoID, LeadSource = LeadSources.get( didNum ) ) ); } else { newLeadSources.add( new Lead_Source__c(name = t.Dialpad__PhoneNumber__c ) ); } } } if( leadsToUpdate != null && leadsToUpdate.size() > 0 ) update leadsToUpdate; if( newLeadSources != null && newLeadSources.size() > 0 ) insert newLeadSources; // save new ones } public static set<id> getLeadIDs(set<id> leadIDs){ map<id, lead> leadsInNeed = new map<id, lead>([select id from lead where LeadSource = null and id in :leadIDs]); return leadsInNeed.keySet(); } public static map<string, string> getLeadSources(set<string> didNums){ map<string, string> m = new map<string, string>(); for (Lead_Source__c ls : [select name, lead_source__c from Lead_Source__c where name in :didNums and Lead_Source__c != null]){ m.put(ls.name, ls.Lead_Source__c); } return m; } }
@isTest private class TaskHandler_test { // private TaskHandler_test() { } @isTest static void AssignLeadSourcesPrimary_test(){ insert new Lead_Source__c(name='1234', lead_source__c='source 1'); lead l1 = new lead(lastname='lead 1', Language__c='English', Location__c='Los Angeles'); lead l2 = new lead(lastname='lead 2', Language__c='English', Location__c='Los Angeles'); insert new list<lead>{l1, l2}; task t1 = new task(subject='task 1', whoID=l1.id, activitydate=date.today(), Dialpad__PhoneNumber__c='1234'); task t2 = new task(subject='task 2', whoID=l2.id, activitydate=date.today(), Dialpad__PhoneNumber__c='47'); insert new list<task>{t1, t2}; } }
- Steve Berley
- February 24, 2021
- Like
- 0
- Continue reading or reply
where to manage coupon codes
I have a new package and I want to give a discount to an early adopter. I see the coupon code field in the checkout process but I can't figure out where to manage coupon codes in the partners site.
What am I missing?
Thanks,
Steve
- Steve Berley
- January 14, 2021
- Like
- 0
- Continue reading or reply
Batch Apex workaround for - Semi join sub-selects are not allowed with the 'OR' operator
SELECT id, name FROM Account WHERE name = 'whatever' OR id IN ( SELECT accountID FROM contact WHERE lastname = 'something' )No surprise that it yields the error:
MALFORMED_QUERY: Semi join sub-selects are not allowed with the 'OR' operator
The challenge is, how do you accomplish this type of goal in batch apex?
The only idea I've come up with is to split the query into two parts
Query A: SELECT id FROM Account WHERE id IN ( SELECT accountID FROM contact WHERE lastname = 'something' )
Query B: SELECT id, name FROM Account WHERE name = 'whatever'
- Make the batch class stateful and in the init store the results of Query B to a map.
- Make Query A the one returned by the batch start() method.
- In the execute() method, process the scope (from query A) and as all records from the map of query B as they're processed.
- In the finish() method process records that remain in the map of query B after all query A results handled in the batches.
How have you all solved this problem?
Thanks,
- Steve Berley
- December 23, 2020
- Like
- 0
- Continue reading or reply
Business plan validation
I sent my business plan to Salesforce at the beginning of november and it's still pending for approval, and we need that to ask for the security review.
I read it takes 3 days usually, do you have some feedback ?
Thanks
- Maxime
- December 16, 2020
- Like
- 0
- Continue reading or reply
Generically access child records in a parent-child query
In the example below:
- 1 and 2 work and yield the same result, as you’d expect
- 3 works perfectly
- 4 errors with: "Invalid field Contacts for Account"
Thanks,
list<account> aa = [SELECT name, ( SELECT name FROM Contacts ) FROM Account]; for (account a : aa) { system.debug('-- 1: '+a.name); system.debug('-- 2: '+a.get('name')); system.debug('-- 3: '+a.contacts); system.debug('-- 4: '+a.get('Contacts')); // errors out }
- Steve Berley
- August 30, 2020
- Like
- 0
- Continue reading or reply
Limit so only one user can run batch at a time?
I have a client who has a batch process that generates a lot of data, and because of this it takes a bit to run.
Since the process needs to be manually triggered, is it possible to prevent someone from starting it if another user already has it running?
Could I query active jobs and throw a message if it's in queue?
Thanks,
Steve
- Steve Berley
- July 30, 2020
- Like
- 0
- Continue reading or reply
setOrgWideEmailAddressId() giving Invalid ID error
Even though the OWE email address is verified and I’m using the id retrieved from querying the owe object — it ALWAYS gives an “Invalid Id” error.
What am I doing wrong?
- Steve Berley
- July 01, 2020
- Like
- 0
- Continue reading or reply
Generating a PDF - want to change the page footer from within a loop
I have a VF page that generates what we call Route Sheets. Each one takes 1-2 pages and the whole printout is about 55 pages long. Each Route starts on a new page. This is all fine.
The challenge is -- I'd like to include the route name on every page so was thinking of placing it in the page footer. To accomplish this I'd need to change the footer with each iteration through the loop.
Can that be done? If not, do you have other suggestions?
Thanks,
Steve
<apex:page controller="GenerateRouteSheets" deferLastCommandUntilReady="true" renderAs="PDF" applyBodyTag="false" action="{!loadData}"> <!-- <apex:page controller="GenerateRouteSheets" deferLastCommandUntilReady="true" renderAs="PDF" applyBodyTag="false" > --> <head> <style> @page{ size: landscape; @bottom-right { font-family: 'Arial Unicode MS'; font-size: 13px; content: "Page " counter(page) " of " counter(pages); } } </style> </head> <script> var dt = new Date(); document.getElementById("datetime").innerHTML = dt.toLocaleString(); </script> <body> <apex:pageBlock > <apex:repeat value="{!routes}" var="r"> <div style="page-break-after:always; "> Route {!r} ~~ SNIP ~~ </div> </apex:repeat> </apex:pageBlock> </body> </apex:page>
- Steve Berley
- May 27, 2020
- Like
- 0
- Continue reading or reply
suddenly getting errors from force:project:create
17:08:30.275 sfdx force:project:create --projectname Eden-tncDev --outputdir /Users/Steve/Dev/sfdx --template standard ERROR running force:project:create: Command failed with ENOENT: npm root -g --prefix /Users/Steve/Dev/sfdx/.yo-repository --loglevel error spawnSync npm ENOENT 17:08:30.696 sfdx force:project:create --projectname Eden-tncDev --outputdir /Users/Steve/Dev/sfdx --template standard ended with exit code 1
I've already tried reinstalling the Salesforce extensions suite with no luck. Any thoughts?
Thanks,
Steve
- Steve Berley
- May 13, 2020
- Like
- 0
- Continue reading or reply
try catch & execution speed
So I've gotta ask - are try/catches super processor intensive?
Also - tips for working around this would be greatly appreciated...
Thanks,
- Steve Berley
- November 24, 2017
- Like
- 0
- Continue reading or reply
quick actions - preventing or closing dialog
Is it possible to prevent the Quick Action dialog from showing?
While not as good a solution, I'd like to make it vanish immediately, but I can't make it happen.
Component:
<aura:component implements="force:lightningQuickActionWithoutHeader"> <aura:handler name="init" value="{!this}" action="{!c.dismissIt}" /> </aura:component>
JS Controller:
dismissIt : function(component, event, helper) { var wasDismissed = $A.get("e.force:closeQuickAction").fire(); }As you can see they're as simple as possible but it's just not working.
Any suggestions?
Thanks,
Steve
- Steve Berley
- August 16, 2017
- Like
- 0
- Continue reading or reply
id field in list changing as contents added
for(id opp : opps.keySet()){ id dg = opps.get(opp); if (templates.containsKey(dg) ) { list<npsp__Allocation__c> thisTemplate = templates.get(dg); for (npsp__Allocation__c t : thisTemplate) { t.npsp__Opportunity__c = opp; toInsert.add(t); system.debug('added: '+toInsert[toInsert.size()-1].npsp__Opportunity__c); // << #1 } } } system.debug('------------------ '); for (npsp__Allocation__c a : toInsert ) system.debug(a.npsp__Opportunity__c); // << #2
Looking at the output from the debug statements - the two ids are different, specificially one includes FF and the other includes FG. However when interrogated again they're both FG.
What's going on? How do I fix this? I have tried changing API version of the code - no luck.
- Steve Berley
- June 29, 2017
- Like
- 0
- Continue reading or reply
developer docs no longer google properly??
Is it my imagination or has something changed so that developer docs stopped googling properly in the past month or so?
I often enter a google query such as: sfdc apex map methods
For years one of the top results would be the page describing all methods you can do to a map.
Now, however, all you get is the developer documentation home page. Which is useless in great part because the search within the developer documentation site is quite weak.
Ugh!
</rant>
- Steve Berley
- May 27, 2017
- Like
- 0
- Continue reading or reply
pass class method name as parameter to another method?
I've got a circumstance where I need to pass the name of a class method to another method which would execute then passed method.
Example:
the class I'd want to call:
public class1 { public static void methodA() { }; }
The class I'd pass the method name to...
public class2 { public static void methodRunner(string methodName) { run( class1.methodName() ); // call that would execute the method (TBD) } }
so the call would be -
class2.methodRunner( class1.methodA );
In case you're wondering why go to all this work?
I'd like to create a generic way to run class methods as batch processes from the console in prod to efficiently retrofit existing data - without littering the prod org with lots of one-time use code.
Looking forward to everyone's collective insights...
Thanks,
Steve
- Steve Berley
- May 05, 2017
- Like
- 1
- Continue reading or reply
Trapdoor Wish List
Trapdoor is awesome but I do have some things that I wish I could control or fix.
1.) Duplicate URL.
I entered a URL into my list of servers as http://www.salesforce.com/login and then again as http://www.salesforce.com/login/
Trapdoor lists these as 2 distinct servers but if I delete one in order to correct it, Trapdoor deletes the other server in the list too.
I wish I could manually edit the list of servers and login details so that I could correct my typo.
2.) Sorting
I see that there is a "sort by alias" option but I don't see this working as expected.
If I had access to the list of servers ( see 1 above ) I would be happy to manually edit and order my servers.
Thanks !!
- Ryan Lambert
- December 10, 2013
- Like
- 0
- Continue reading or reply
Salesforce, Snow White and the Seven Dwarfs
Hi guys,
today I received a strange error message after trying to change the controller in the visualforce editor
Error: java.sql.SQLException: ORA-00001: unique constraint (CORE.AKAPEX_CLASS) violated ORA-06512: at "HAPPY.CAPEX", line 505 ORA-06512: at line 1 : {call cApex.update_class(?,?,?,?,?,?,?,?,?,?,?,?)})}
and remebered about a Blog article on Wes's Blog about strange error messages where I found this
Error: java.sql.SQLException: ORA-00001: unique constraint (CORE.AKAPEX_CLASS) violated ORA-06512: at “SNEEZY.CAPEX”, line 505 ORA-06512: at line 1 : {call cApex.update_class(?,?,?,?,?,?,?,?,?,?,?,?)})}
.
Looks like some SF guys are huge fans 'Snow White and the Seven Dwarfs' .
So the big question is, where are the others and of course where's Snow White?
- GoodGroove
- September 13, 2009
- Like
- 0
- Continue reading or reply