Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [apex]

Questions relating to Apex, the native programming language for the Force.com platform. Use it for general questions on syntax, errors, constructs, and rules of use. Most questions should include a code *excerpt* to help answerers understand specifically what has gone wrong or why you need help.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
14 views

Can we rely on reference when it comes to changing Map items changing

My code for(FieldDefinition def : [SELECT QualifiedApiName, EntityDefinitionId, EntityDefinition.QualifiedApiName FROM FieldDefinition WHERE EntityDefinitionId in :...
pincet's user avatar
  • 909
0 votes
1 answer
17 views

Apex call returns successfully after errror, resulting in issues

I have an Apex call which causes an error (ENTITY_IS_DELETED, but it doesn't matter which error it is). I might be able to fix that error, but now it somehow also returns successfully anyway, so the ...
Z0q's user avatar
  • 59
0 votes
1 answer
21 views

Error while updating Lookup field on Case recprd after insert from Web-to-Case form

I'm trying to update the lookup field (Account ID) using the trigger after inserting the Case record by using the Web-to-Case form. But it is throwing the error "FATAL_ERROR|System.FinalException:...
RKCY's user avatar
  • 323
1 vote
1 answer
44 views

NavigationMixin - file preview - Failed to Load inside slds-file_card div

Is there any workaround to display a file preview under slds-file_card div, when I click the image HTML: <template> <div class="slds-p-around_none slds-var-m-top_x-small slds-var-m-...
Ragul's user avatar
  • 531
-1 votes
0 answers
13 views

Discover the users and emails from a group email in using Apex

We need to discover the users and emails from an email group, is there a way to discover using APEX ?
Angelo Rigo's user avatar
0 votes
0 answers
51 views

Create Parent Records from Child Records using Dynamic DML

I'm trying to create corresponding parent records in salesforce (Ex. Account, Parent Account) from child (Opp/Case) records based on a incoming JSON file. The external system does not need or use the ...
Roy's user avatar
  • 1
3 votes
1 answer
55 views

Why does `EntityDefinitionId` works like SObjectType in following code?

Let's say I want to retrieve all the fields with master-detail for each objects for given PermSet. Why can we provide SObject type array instead of Ids? And how can I can retrieve SObjectType as well ...
pincet's user avatar
  • 909
1 vote
0 answers
21 views

How to set scope in Auth provider for extending token expiry on JIRA server?

While setting up named credentials or Auth provider using OAuth2 for connecting to Jira on premise, The incoming link in JIRA is configured correctly and I am able to pull data but the session expires ...
goose's user avatar
  • 81
5 votes
1 answer
97 views

How to write SOQL query to get accounts where billing city equals to shipping city in single query?

This question asked in interview. As per my knowledge, it's not possible to get in single query. Is it even possible? If yes, then how? Please answer this question. Thank You!
nikita yadav's user avatar
0 votes
0 answers
12 views

salesforce => SendEmailResult => duplicate value found: <unknown> duplicates value on record with id: <unknown>

First thing first, I have gone through this thread where "duplicate value" is discussed - How to debug the mysterious "duplicate value found: <unknown> duplicates value on record ...
Mitesh Sura's user avatar
-1 votes
0 answers
36 views

How to Implement the rate limiting in the forget password

Can you please guide me, How to Implement the rate limiting in the forget password number of password reset emails to 5 per hour per email address. Set up a verification mechanism to track the number ...
Chittu Kala's user avatar
0 votes
3 answers
61 views

Verify Email addresses in LWC

I have a LWC component in which one of the part i am sending emails , but here i want to check that the emails are exists in real world or not for now i am just doing the format validation in JS that ...
NewBaySales's user avatar
0 votes
0 answers
17 views

Uninstalling a Package

I have a package installed in my Salesforce org. I also noticed growing numbers of SOQL queries. I would like to know if removing the package would affect any existing records and is there a way to ...
Ashley's user avatar
  • 1
1 vote
1 answer
33 views

Formula Field - Apex code issue

I have two custom objects, PG and Funding Source. Within the PG object, there is a field called Date_of_Birth__c, which is a formula field that pulls the DOB from the contact. This field shows up fine ...
Daniel S's user avatar
0 votes
1 answer
29 views

Property type misidentification in VisualForce Page

I'm deploying all the code from a 1stGen Package to a new Scratch org, to improve our development/testing/release process. There were a few deploy errors but I've fixed all but two types. This is one ...
cyberspy's user avatar
  • 210
3 votes
1 answer
88 views

Moving code from unlocked package back to "happy soup" - how?

We've been experimenting with moving some of our code into unlocked packages, however we'd like to understand how to back-out of this if necessary. As a test, we moved a bunch of "utility" ...
James's user avatar
  • 205
0 votes
0 answers
42 views

Get master object from master-detail relationship by SOQL FieldDefinition object

Let's say we have SELECT DataType FROM FieldDefinition WHERE EntityDefinitionId='Opportunity_ROW_Segment_Junction__c' it works fine but is it possible to retrieve e.g. Opportunity as a single field ...
pincet's user avatar
  • 909
0 votes
1 answer
61 views

system.limitexception: too many callouts: 101 error Salesforce

public with sharing class ToolingAPIUtility { public static final String endpoint = '/services/data/v51.0/tooling/query/?q='; @InvocableMethod(label='Get Alert Data' description='Get Alert ...
Sahir's user avatar
  • 3
1 vote
1 answer
53 views

I need to create a batch class that summarizes all Opportunity Amounts for each Account;

An email should be sent to the primary contact of all Accounts, containing a table with the Closed Won/Open/Closed Lost summarized Opportunity Amounts, but no matter how much i try and change the code ...
Florin Hreniuc's user avatar
-1 votes
0 answers
22 views

Unable to delete Batch Apex class from org [duplicate]

I am not able to remove apex class from sandbox nor production org. When I try to delete the class it gives me message: [...]Apex Job This Batchable class is in use - Batch Job IDs: [...] (note: not a ...
Kacper A's user avatar
0 votes
0 answers
23 views

Prettier, in VS Code, failing to format SOME VF Pages

I'm using Prettier, along with the plugin prettier-plugin-apex in VS Code, to format Salesforce classes and Visual Force pages etc. It works (formats my docs on Save) most of the time, but now some, ...
cyberspy's user avatar
  • 210
0 votes
0 answers
15 views

Is it possible to Approve a ProcessInstanceWorkitem as another user in a Test Class?

I'm trying to approve a ProcessInstanceWorkitem as its ActorId in a test class, but I'm receiving the following error: System.DmlException: Process failed. First exception on row 0; first error: ...
Cassio's user avatar
  • 3
0 votes
0 answers
42 views

Image is rotating to left in Visualforce Page using RenderAs="pdf"

I'm facing an issue: I'm creating a PDF and using the image stored in the files object. I'm creating a Visualforce page with RenderAs="pdf". The image is appearing, but it's rotating to the ...
Aditya Narwade's user avatar
0 votes
0 answers
17 views

Problem with pages numbers in knowledgeArticle via REST API

I am creating a pagination of the knowledgeArticle object. after query execution: /services/data/v52.0/query/?q=select+count()+from+knowledgeArticle I receive the quantity: totalSize: 1349 Then I ...
Kamil G.'s user avatar
1 vote
1 answer
80 views

LWC Wired method not working

I have a controller with a apex method which takes a user id. This controller is used in a LWC component. Here is where I am trying to call the apex method via a wire method. This is done in a ...
Liam's user avatar
  • 121
1 vote
0 answers
35 views

System.CalloutException: PKIX path building failed: unable to find valid certification path to requested target

Sorry for the unexpected appearance, I saw your profile on the forum dealing with the error: System.CalloutException: PKIX path building failed: sun.security.provider.certpath....
Banzoni's user avatar
  • 11
1 vote
1 answer
28 views

How to wait for a VisualForce script to execute when calling it from an Apex method via PageReference?

I have an Apex controller MyController which calls a VisualForce page via PageReference. Here is my controller: public with sharing class MyController { @AuraEnabled public String param1 { get;...
ViqMontana's user avatar
0 votes
1 answer
33 views

How to prefill lookup value in lightning web component

I have a requirement to create a task on opportunity with prefilled values from custom fields on the opportunity. I have a lightning web component on the opportunity detail page which I want to use ...
Thomas's user avatar
  • 2,298
0 votes
0 answers
20 views

Will Large Data Volumes Affect the Performance of Custom and Activity Objects?

We plan to associate a custom object with the activity object to record the actions of our sales personnel. Based on our preliminary estimates, both the custom object and the activity object will ...
Lex's user avatar
  • 11
-1 votes
0 answers
24 views

Session Id generated through postman and apex class are not identical

I am facing issue with session Id. Whenever I am using post request in postman the request is generating the url correctly. But when I did same post request through apex class it's generating ...
Pratik Patil's user avatar
2 votes
1 answer
96 views

Why isn't my Salesforce test method returning null when querying a deleted record created in TestSetup?

I have a Salesforce test class with @TestSetup alongside two test methods. In the last method (testQueryDeletedRecord), I attempt to query a record that I deleted in a previous test method (...
Licytede's user avatar
3 votes
1 answer
48 views

Salesforce Apex Access Nested Lists after Parsing JSON with Wrapper Class

I think I am just missing something simple - using very simplified and generic code for example. I have some JSON: { "level1":[ { "level2":{ "id&...
Dar Wright's user avatar
0 votes
0 answers
29 views

EMAIL IS NOT GOING IF ATTACHING 500KB or Above

I am trying to upload file of size between 1MB and 2MB using LWC component and after upload saving the same file as an attachment and sending it in an single email as an attachment. I am able to ...
Learner's user avatar
  • 21
0 votes
0 answers
30 views

Traversing variable thru batchable steps

Let' say we have this class global class ObjectPermsBatch implements Database.Batchable<sObject>, Database.stateful { Id permset; List<ObjectPermissions> permSets = ...
pincet's user avatar
  • 909
4 votes
1 answer
213 views

Optional chaining - change

I have code in production for many months and it start to be problematic. this code involve if condition with Optional chaining. Here is an example List<case> cases = [Select id, Status__c FROM ...
Raphael D's user avatar
  • 616
2 votes
0 answers
47 views

Converting Rendered Email Templates to PDFs - issue(s)

I'm hoping someone here will be able to help me as I have been trying different "solutions" for days now...to no avail. I am new to Apex and do have some Java in my backgorund...not much ...
greeng13's user avatar
0 votes
0 answers
35 views

Future method not getting called in Auth providers

From out external .Net application after user log in by clicking on one card we are redirecting the user to our salesforce community sites. In order to establish SAML communication under Auth ...
SFDC-Beginner's user avatar
2 votes
2 answers
122 views

How to make a call out after every DML in batch

I recently faced this question in an interview where I was asked 'Can we make a callout in batch execute after a DML and if yes how?' I answered: Implement Database.stateful and make a callout in the ...
sfdcDev's user avatar
  • 67
1 vote
1 answer
40 views

Create Trigger to conditionally before inserting new records, criteria below

I am trying create a Trigger in my Salesforce Org, where I want to create a new record in an object only if no records already exists, and if records already exist then the end date should be null. If ...
Madan Nanoopillai's user avatar
0 votes
0 answers
15 views

parent to child query inside batchable [duplicate]

Let's say we have SELECT Id, Label, (SELECT SobjectType, PermissionsRead FROM ObjectPerms), (SELECT SobjectType, Field, PermissionsRead FROM FieldPerms) FROM PermissionSet where id in : ids will ...
pincet's user avatar
  • 909
0 votes
0 answers
22 views

Extract email information for approval process with apex

Through a flow I am sending an email to a specific user "A" and that user has to respond to the email and that email has to reach Salesforce, so that it knows what I answered, since it ...
Tania Berenice García Montoya's user avatar
1 vote
0 answers
49 views

How to migrate successfully from legacy FCM APIs to HTTP v1 in apex?

I have a working functionality for sending push notifications via Firebase (FCM) from apex. But it is legacy now and I need to upgrade to HTTP v1. Based on the official documentation and the few ...
unique user's user avatar
1 vote
1 answer
36 views

Apex Batch Question

I am trying to create a batch process that creates records based on a list of strings that are passed to it. I am struggling to return the list. So in the start method I want to return the list of ...
Frank's user avatar
  • 433
1 vote
0 answers
19 views

How can i Return the Answer in the Enstein Chat bot from Knowledge search?

The Einstein bot only uses Summary to show articles in the chatbot. I'm looking for a solution to return the full Answer either by test or attached PDF or word. Is that possible? can I do it with Apex?...
nazanin hashemipoor's user avatar
0 votes
1 answer
35 views

How to Fetch and Create Managed Content via API or Apex?

I'm working on an Integration and, need to Fetch and Create Managed Content (Product Media). To fetch/get Managed Content data: I'm using API "/connect/cms/delivery/channels/channelId​/media/...
Anurag's user avatar
  • 1
0 votes
0 answers
20 views

I have a approval process that needs a checkbox field to be checked as criteria, now I trying to initiate it to use it on a LWC

`public with sharing class ApprovalProcessController {   @AuraEnabled(cacheable=true)   public static Id getTheCurrentUserContactId() {       return [SELECT Id,ContactId FROM user WHERE Id = : ...
Akuma's user avatar
  • 1
-1 votes
0 answers
28 views

OpportunityTrigger: System.LimitException: Too many SOQL queries: 101

I'm not sure if you can help. I'm just an admin, not a developer. but when I try and Mass Update using Dataloader, I get that error message. Wondering if anyone could fix it for me so I don't get that ...
MyaH's user avatar
  • 1
1 vote
1 answer
54 views

How to Avoid Heap Size Error on response body

Daily orders loads records but some records are missing to load to fix this we have created another batch apex to call each day records and we are comparing with already exists benefitdisbursement ...
Afrose ahamed's user avatar
0 votes
0 answers
37 views

Failed to invoke future method 'public static void saveQuotePDF(String, Boolean)' on class 'SendDOEmail' for job id 'XXXXXXXXXXXXXXX' [closed]

I am getting this error Failed to invoke future method 'public static void saveQuotePDF(String, Boolean)' on class 'SendDOEmail' for job id 'XXXXXXXXXXXXXXX'. Sometimes I get this mail in the Apex ...
Pranjali Watkar's user avatar
4 votes
1 answer
277 views

Is this a known issue? Apex able to deserialize an ill-formed json

It looks like it is a "feature". Anonymous Apex (note the extra closing brace right after the "v3" value of "k3" key: System.debug(JSON.deserializeUntyped('{"k1"...
Kein's user avatar
  • 65

1
2 3 4 5
737