• Richard Fiekowsky 3
  • 10 Points
  • Member since 2020

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 20
We frequently receive notices and warnings about our Salesforce orgs from Salesforce. The emails from Salesforce usually have the org-ID of concern, but no hint of which org that is. Because our company was formed from a long series of acquisitions, we have a large number of orgs, not to mention sandbox orgs and developer orgs and scratch orgs. Does anyone have a workaround or hack that will reveal the "My Domain" URL for that org-ID? The only thing we can do right now is log in to every org and check the org-ID after logging in. 
No hack would be necessary if everyone votes up this idea: https://ideas.salesforce.com/s/idea/a0B8W00000GdpY8UAJ/include-organization-name-id-in-all-sfdc-notices-maint-action-required-etc 
I'm new to salesforce  and i need help ,i have a user logged to experience site how can i fetch opportunity id of that user 
  • April 11, 2023
  • Like
  • 0

Hi there! I'm tryi'n to create rollup trigger by aggregate sum of fields

i have 2 custom objects with lookup field School__c on Classroom__c(child) ,objects:

-School__c with fields,Number_of_students__c,Name

-Classroom__c with fields,Students_Quantity__c,Name and lookup field School__c

How can i have a trigger(before insert,after update,before delete)?

thanks for all advices! 


how to report/query the recipients of email alerts
When launching a flow via a list button with this return URL : /flow/New_Hotel_Master_Booking?varBookingId={!Booking__c.Id}&retURL=/{!Booking__c.Id}
I am getting the below error: “We can't display this page because your browser blocks cross-domain cookies. Try again with a different supported browser.
The purpose is to navigate the user directly to the child record and not the list view of the master record after the completion of the flow.
I have tried to allow all cookies to my Chrome browser.
Any suugestions?
I received 100+ error emails overnight that all look a bit like what I've copied/pasted below. I'm not a developer and am trying to figure out how to fix this. Luckily it's in our Partial Sandbox, so is not affecting our Production org but still, would like to get to the bottom of it. From what I've read, a duplicate field error like this means there are fields with identical API names and the query errors out essentially not knowing which one to use/reference. I do see fields with the label "Amount" with identical APIs but nothing that has changed or been added in the last couple days, which makes me think why would this error suddenly come up now. Where do I find the query? How do I identify which Amount field it's looking for? And where/how do I update the query to fix this?

Error Type: System.QueryException
Error Date: 2019-12-13 04:15:20
Message: "npsp__Largest_Soft_Credit_Date__c,npo02__LastOppAmount__c,npo02__LastCloseDate__c,npo02__LastMembershipAmount__c
ERROR at Row:1:Column:350
duplicate field selected: Amount

Rollups State:"
Context: CRLP.ContactSoftCredit

Stack Trace:
No stacktrace available at the time of saving the record. (npsp)
I want to set field level security for particular field of object from Apex.
e.g  There is custom field named  "SLASerialNumber__c"  on Account object and I have System Administrator Profile.
So I want to give Read and Edit Access of  field to Profile.

How it's possible?
could anyone give me sample scenarios when we go for lookup,master and junction
I and some other colleagues received this notification via email to all our System Administrators:

"You have one or more certificates in your Salesforce org California College Guidance Initiative [org ID here] that will expire soon. Please review the list below and visit Certificate and Key Management from Setup to make an update.
   - SelfSignedCert_20Nov2013_203932, Self-Signed, expires on 11/20/2015. Warning: This certificate will expire in 30 day(s)"

Does anyone have any tips as to how I can check if letting this expire impacts us or not? Has anyone else seen this?
I have a batch job that typically fails due to governor limits. It is running in future state so the limit is often 10001 DML rows. The batch job is called from another scheduled batch job with the line:

System.scheduleBatch(new BatchReconciliation(year, email, false), 'Reconciliation Batch', 1, 200);

The result runs typically 40+ batches but has multiple failures. 

If I change the call to:

System.scheduleBatch(new BatchReconciliation(year, email, false), 'Reconciliation Batch', 1, 20);

it runs over 400 batches, but completes without errors. Is there any drawback to running the job in so many batches? The time for completion seems about the same, but am i flirting with other governor limits?

Thank you!



I am not sure my Subject is correctly write or not.But I faced issue on something like this,


Example I have one object named Employee with contains attribute such  InternalID ,ExternalID, name , age


I need to retrieve the data where InternalId = ExternalID something like below


select Name, Age__c  from Employee__c where InternalID__c = ExternalID__c 



I knew in Oracle we can do something like this, but I m not sure in SFDC can we do that?Usually if there requirement to do that, what is the best way to do it?

My input:

System.debug('Date.today();************ ' + date.today());



Date.today();************  2013-06-07 00:00:00


expected output:

Date.today();************  2013-06-07 


Is possible to get my expected output?



I am using standard approval process with several steps(each approval process having total 8 steps) based on user country criteria.Those approval process are getting called through trigger .


Like if the record gets updated trigger getting fired and based on criteria crossponding approval process gets called.

First approval is called and after some field update again the next approval is called through trigger,the entire functionality is working like that.


But some time(1 out of 50-60 times) after the field update of the first approval next approval is auto rejected. But if i am again working with the same record i am not able to replicate it again.


i have not added such criteria that if the criteria will not match for approval it should rejected or approved .


Any suggestion will be much appreciated.



  • February 05, 2013
  • Like
  • 0

I need to get a list of lead history objects between two dates.  I've come up with this approach:


[SELECT (SELECT LeadId, CreatedDate, Field, OldValue, NewValue FROM Histories WHERE CreatedDate >= :fromDate AND CreatedDate <= :toDate) FROM Lead]


however, that returns a list of all leads that I then would have to go through and check if they actually contain any history.  Is there a way to directly access the lead history object and query that table?






having inherited a huge custom code SF installation, I am trying to prune unused code from production. Is there an easy way to determine if or where an Apex class or VF Page is being used?





  • March 05, 2012
  • Like
  • 0

any query to get all the piclist values

I am working on something where I want to allow an admin to assign items to a Public Group.  Then, at runtime, I need to determine what Public Groups a user is in (directly or via Roles / Roles + Subordinates) and display the appropriate items.  Because Public Groups can be complicated having other Public Groups as Members and also Roles & Subordinates, figuring out the Groups a user is in can be difficult.


I started a conversation on Twitter about it and then did some research and have a starting point.  I'd like to encourage others to help me vet this and then it could become a Cookbook item down the line.  Here's what I got...


I think this can be done in 2 steps without much looping.  From what I can tell, the Group table can contain all kinds of Groups ("Regular" Public Groups, Roles, Soles & Subordinates, Queues, etc.).  The Group Member table seems to only contain pointers to Users or to Other Groups.  Groups that are copies of Roles and Roles & Subordinates have a Related Id filled in.  


I believe the following 2 queries could determine the Public Groups that a User is actually in...


1) Query the Group table to get the Group records where the Related Id = the users's role.  We could filter for Type of Role or RoleAndSubordinates, but it seems that anything with a RelatedId filled in is one of those types.  This query is essentially getting the Group records that mirror our Role record.



List<String> roleRelatedGroupIds = new List<String>();
for (Group g : [SELECT id, RelatedId, Type FROM Group where RelatedId= :UserInfo.getUserRoleId()]{


2) Next we query the Group Member table for records where our user is specifically assigned and  also include records where our role is assigned.


List<String> allGroupIDs = new List<String>();
for (GroupMember gm : [SELECT Id, group.id, group.name, group.type FROM GroupMember where (UserOrGroupId = :UserInfo.getUserId() AND group.type='Regular') OR (UserOrGroupId IN :roleRelatedGroupIds AND group.type='Regular')]{



I'd need to hack at this given lots of users and lots of Group Types like Queues, Territories, Roles, Public Groups, etc.  From what I've been able to test, this works.

  • March 09, 2011
  • Like
  • 0

Is there any way to create an API script which could download the schedule created DataExport zip file?

I'm thinking about getting the ID of the last (actual) zip file and just paste it into corresponding url..


Any ideas to do this?




I have a Hierarchy Custom setting with one field IsProcessed.


My batch apex will run only when the value of  IsProcessed is true. After processing I need to update the value to false. I doubt whether it is possible.


Is there a way I can update a custom setting field value using apex.


Appreciate your help.