Skip to main content

Questions tagged [system]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
38 views

Formula.recalculateFormulas() returning System.HandledException: Script-thrown exception(System Code) When State and Country populated on Lead

LeadTrigger BeforeInsert has some logic that relies on the formula fields on Lead in the logic and using the Formula.recalculateFormulas() to get valid values in these fields. This logic was working ...
lav1407's user avatar
  • 11
2 votes
1 answer
73 views

fflib CRUD check conflicts with Flow System Context

I have built a simple POC flow Flow - specifically creating and updating an account when the flow is running in System Mode Without Sharing - but using the Experience Cloud Guest Site User. When I run ...
BritishBoyinDC's user avatar
0 votes
1 answer
53 views

.get method not returning value even though I copy/pasted the key into it

I'm creating a map based on a custom object in my org. Basically this is the code for it. Map<String, String> translationMap = new Map<String, String>(); List<StageNameTranslation__c>...
potato46's user avatar
0 votes
1 answer
117 views

converting DateTime to String returns the wrong Date as a String

I have the following code to get the DateTime for EST Time Zone Timezone tz = Timezone.getTimeZone('America/New_York'); DateTime now = Datetime.now(); Datetime localTime = now.addSeconds((tz.getOffset(...
potato46's user avatar
0 votes
1 answer
165 views

Query all subscribers to find the subscriber key related to the contacts from mobile Data View

I would like to retrieve users who received sms and retrieve their salesforce ContactID. I had created a Data Extension from the template of the SMSMessageTracking DataView in a child Business Unit. ...
Lamia Hafid's user avatar
2 votes
0 answers
178 views

Why doesn't the System user have access to the CollaborationGroup records?

I've created a test class and a simple flow below that illustrates the issue with the System user. Two test methods are doing a simple SOQL query on the CollaborationGroup records (one with a Standard ...
Dr.J's user avatar
  • 41
0 votes
2 answers
641 views

How to prevent system admins from viewing certain fields

I need to block the read and edit field access on a custom object to all system admins except for one system admin. I could encrypt these fields but system admins can still enable the permission and ...
sfBilb's user avatar
  • 23
0 votes
1 answer
257 views

Is there ANY WAY to SCHEDULE this CODE?

private static void scheduleTEst(Set<Id> sObjectId, String cronJobDetailName, String className, Integer hour) { List<CronTrigger> scheduledExecs = [SELECT Id, CronJobDetail....
CPS's user avatar
  • 345
0 votes
1 answer
595 views

Date formatting not working properly [duplicate]

I have my locale set at (GMT-05:00) Central Daylight Time (America/Chicago). And I am using the below Apex. DateTime d2 = System.Today() ; system.debug('date is '+d2); // date is 2021-04-10 00:00:00 ...
Rahul Allada's user avatar
10 votes
0 answers
5k views

What is the purpose of the "System" User?

There's lot of information about the Automated Process User in Salesforce where it's used to make automated system-level changes by Salesforce. However, I noticed that we also had a user called System ...
Kris Goncalves's user avatar
6 votes
2 answers
832 views

System.assert() in production code? (vs. custom exception)

It's come to my attention that you can use System.assert(), System.assertEquals(), etc. outside of test classes in Apex. I've seen a lot of custom Exception classes written that do nothing but extend ...
Matthew Souther's user avatar
1 vote
2 answers
1k views

System.runAs not working if system user not selected

I created a very simple method on a before insert trigger, that adds the number 11 to a value if a regular user creates a record, But it doesn't add anything if the service user creates it. So for ...
Json's user avatar
  • 1,607
0 votes
0 answers
107 views

System.now() gives different value than expected?

For example if DateTime is : DateTime dt= Datetime.newInstance(2020,07,12,18,30,0); //using System.now() for dt DateTime.newInstanceGmt(dt.date().addDays(-5),Time.newInstance(00,00,01,00)) ;// should ...
Isha's user avatar
  • 163
0 votes
1 answer
480 views

Scheduled Job trigger is 9 hours delayed

I have a set of records(around 90,000 records) to be updated at 1AM every day. But I cannot update at least 10,000 records in a bulk as salesforce reaches governor limits. Then I wrote a schedulable ...
Isuru Buddhika Herath's user avatar
0 votes
1 answer
24 views

I want to develop an object where the time field input must match the system date and time.Can anyone help?

I am working to create an object, where I will have date- time custom field. I want the input of this field to match with the system date and time. I have tried applying a validation rule, where this ...
Saurav Guha's user avatar
0 votes
0 answers
97 views

Component Visibility Filter Added after Profile Change

Had some unusual behavior today. We were modifying profiles in the Sandbox, and I removed the View All Data in the System Permissions of our Sales Agents profiles. After doing this, one of our custom ...
thinker's user avatar
  • 1,432
1 vote
1 answer
2k views

system.runas and user's time zone

I am writing a test class for testing an API, which populates the value of an iVAR with the logged in user's time zone. In real time, this API works fine. If the logged in User's time zone is EST, I ...
Sahitya Tarumani's user avatar
0 votes
1 answer
158 views

System.debug prints twice [closed]

I encountered this weird thing: when I use: System.debug(); I get everything printed twice... and it only happens for the Account object. I'm guessing this is a reason why my API callout doesn't ...
Nerijus's user avatar
0 votes
1 answer
94 views

Will System.assert in Apex get deleted automatically when moved to production?

Will System.assert in Apex get deleted automatically when moved to production? Am I free to use System.assert for documentation purposes in my code? I mean will the lines with System.assert be ...
hellohowdoyoudo's user avatar
0 votes
0 answers
119 views

What is callback interface?

In Salesforce there is an interface StubProvider which is a callback interface. Could anyone explain what is callback interface and how it is different from the normal interface?
Anurag Bhardwaj's user avatar
0 votes
1 answer
602 views

Can you use the developer console while logged in as another user and access information from the original user you logged in from?

So I'm logged in as "Amber," and I have privileges to log in as any user in the system. If I were to log in as "Jessica" and open the developer console, would I still be able to access information ...
cryptobox's user avatar
0 votes
1 answer
297 views

How to get system validations on the field fired before the JavaScript validations on the VisualForce page

I am using a VF page having a custom controller. For simplicity, I am using 2 date fields - fromDate and toDate which belongs to a custom object. There is a command button named Search on VF page ...
Prasadium's user avatar
0 votes
1 answer
139 views

Sandbox Record Access Insufficient Priviledges

Are you able to advise why the System Administrator profile cannot access a record owned by the member of a queue it is not a member of even when it is has view/modify ALL on the Object AND other ...
n34_panda's user avatar
  • 619
1 vote
0 answers
1k views

How do I check if something is running as system in a formula?

Working with Process Builder, have a nice flow that checks the case for certain data elements, and then creates a new object if it couldn't find one automatically when the case was first created. (...
curtisk's user avatar
  • 335
0 votes
2 answers
3k views

How to exclude the "System" from a validation rule?

I know I can add $User.Id == '00550000000lxVg', false, to a formula to exclude a specific user but I can't seem to figure out a UserID for "System". How do I exclude System from a validation rule?
Juice's user avatar
  • 131
2 votes
3 answers
17k views

Setting Password via APEX

I'm try to set a user password and executing the system.setPassword(UserId, Password) method and I always get an error saying that the UserId is invalid. I've checked it and it's the correct UserId. ...
Blam's user avatar
  • 21
19 votes
2 answers
23k views

System vs Date/DateTime class

Is there any difference between System.today() and Date.today()? Similarly, is there any difference between System.now() and DateTime.now()?
Fernando Gavinho's user avatar
4 votes
2 answers
3k views

System Administrator profile does not have rights to some new custom fields

We recently added many new custom fields to custom objects within our package. When I deployed the new objects from Eclipse to a target org (for the purpose of packaging) I noticed that the System ...
SeanW's user avatar
  • 672
2 votes
1 answer
453 views

What value put in System.Assert Methods To check the its work?

How To Check Different Assert Methods in this code? public with sharing class AssertEx { public integer sum() { integer a =10; integer b =20; integer c; c=a+...
Bonny's user avatar
  • 367
4 votes
1 answer
5k views

system.security.NoAccessException: Update access denied for RecordType

I have a Visualforce Page that uses a standard controller (Opportunity) and an extension. In the extension I have a method that saves updates to the opportunity and a related contact. The extension is ...
Mehmet B.'s user avatar
  • 101
0 votes
3 answers
972 views

Check if a process such as deletion or update is done through data Loader or any other application using apex [duplicate]

I have a trigger that will call a batch process if my data is updated or deleted.It is working well but the problem is that, when I try to delete my data using data loader, i've encounter and error ...
Hope's user avatar
  • 1,273
0 votes
1 answer
36 views

System Error Created prevention in salesforce

I'm getting a custom validation system errors. How to prevent them: Error Email: Origin: LeadEmailHandler (this is an apex class) Error: Insert failed. First exception on row 0; first error: ...
Salesforce Learner's user avatar
0 votes
1 answer
524 views

NullPointer Exception at Boolean value assign

Please find below class where I get Null Pointer Exception while assigning value to boolean. Please let me know where is my fault here? Thanks! Apex Class: public class CallReplica_controller { ...
Testing_SFDC's user avatar
  • 2,940
7 votes
2 answers
12k views

System.now() gives a different hour value and System.now().hour() gives a different value. can any one tell me why so?

String day = string.valueOf(system.now().day()); String month = string.valueOf(system.now().month()); String hour = string.valueOf(system.now().hour()); String minute = string.valueOf(system.now()....
Heena's user avatar
  • 121
2 votes
2 answers
9k views

Excluding System admin from this validation rule

I have the following validation rule ; OR( AND( Upper(MailingCountry) <> 'UK', NOT(ISBLANK(TEXT(UK_Email_Consent__c))) ), AND( Upper(MailingCountry) = '...
masond3's user avatar
  • 21
1 vote
2 answers
267 views

Update Closed Opportunity Owner when validation rules/triggers otherwise prevent changes to closed Oppos

Scenario : If I update Account Owner then I want all its Opportunity Owner should be updated with the same, irrespective of its stage(Closed/Open). I want the new Owner Updations to be made on ...
Salesforce Steps's user avatar