Skip to main content

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
0 votes
0 answers
26 views

How to do an Apex class test coverage [duplicate]

How can i test this code, and The response class os on another page global class Taxa_datadas { @InvocableMethod(label='Get Conversion Rates' description='Retrieve and sum conversion rates within ...
Gabriel Euzebio's user avatar
0 votes
0 answers
15 views

Platform Events and NetSuite [duplicate]

I want two way sync with NetSuite with realtime data updates. I feel that Platform Events will be the best solution for this but I am curious how authentication works when publishing to them. Also ...
Olivia's user avatar
  • 3,471
0 votes
1 answer
30 views

AppExchange Application

As a salesforce partner we are going to upload a managed package to AppExchange. We need to update our codebase and upload it to apply. I tried using the code analyzer, but the topics were very ...
Merve Elevli's user avatar
0 votes
0 answers
13 views

How to pass parameter from Lightning flow to Lightning Email Template to LWC

I have a requirement to display a list of records in email. Records are constructed from 3 objects. Since it's not possible to use a list in the Lightning template I decided to use LWC in the ...
Rachit's user avatar
  • 177
2 votes
1 answer
37 views

Error relinking cloned line items to the cloned sobject record

The below is what I am trying to do - Get a list of purchase orders with its line items. Update the status of the purchase Orders to Rejected. Cloning the purchase orders with its line items. Setting ...
Sumesh's user avatar
  • 33
1 vote
0 answers
24 views

Request.getCurrent().getRequestId() returns the same id if called inside a queueable chain

So if a have a chain of queueables that send outbound messages I grab the requestId using Request.getCurrent().getRequestId() and send it with the request for uniqueness it returns the same request ID ...
KarlLivesey's user avatar
0 votes
0 answers
13 views

How to create a dashboard filter that works as case owner for case report type and created by for email report type

Same as the title. I want to create a dashboard filter that works as "Case Owner" filter for case reports (based on case custom report type) and "Created by" filter for email ...
Ajit's user avatar
  • 11
0 votes
1 answer
26 views

is that possible to check current managed package version name on post install script

When upgrading managed package, i need to check current pacakage version name contains BPM then i need to remove picklist values using post install script. how to check current pacakage version name? ...
Afrose ahamed's user avatar
0 votes
1 answer
41 views

Get full Endpoint of a NamedCredential-based HttpRequest without making a SOQL

So you have an ordinary code that makes a callout using Named Credentials: HttpRequest request = new HttpRequest(); request.setEndpoint('callout:NamedCredentialName/someAdditionalPathHere'); ... ...
Andrii Muzychuk's user avatar
1 vote
1 answer
24 views

@RemoteAction - static method variable access

is there any way to access the variable outside the method and inside the same class? 'selectedvalues' List variable is declared as static variable in same class @RemoteAction public static List<...
Purushothama Puru's user avatar
0 votes
0 answers
23 views

Salesforce Apex - POST multipart/form-data Content-Type + TEXT

This is the second case that I open regarding this topic to ask more specific questions (the first Using blob variables in apex code) In the first one they already indicated to me a first solution ...
Banzoni's user avatar
  • 21
1 vote
1 answer
136 views

What is the difference between Blob.valueOf and EncodeUtil.base64Decode?

I've a scenario where i'm saving the file as content version is attching to a record when i use blob.valueOf() it's failing and when i use EncodingUtil.base64Decode() the method is creating record . I ...
mine_username's user avatar
-6 votes
0 answers
38 views

What is the basic skill to become a Salesforce developer? [closed]

I'm a fresh graduate and planning to start my career in salesforce domain. Anyone to give me a right path way to become a salesforce developer?
Ray Brad's user avatar
0 votes
0 answers
20 views

why is richtext field replace function in before insert not working?

I am trying to replace the Prefix of the image tag URL in the RichText Field. Below is the sample code. trigger Comment_Before_insert on Comment__c (before insert,before update) { trigger. New[0]....
Ragul's user avatar
  • 541
-1 votes
0 answers
22 views

Test Coverage less than Actual Coverage

I'm working on creating and updating test classes for my company's org, but I'm running into an issue where the code coverage for a particular Apex class in currently showing as 32% after all tests ...
Lukem's user avatar
  • 1
0 votes
0 answers
36 views

Using blob variables in apex code [duplicate]

Good afternoon, A while ago I made a post on this topic to see how to send blob variables from a visualforce to the controller. Finally I did not find any solution that was useful to me, so I chose to ...
Banzoni's user avatar
  • 21
1 vote
1 answer
48 views

SALESFORCE_AUTHENTICATOR Enabled for a user

How to identify if a given user is already linked with SALESFORCE_AUTHENTICATOR. I want to delink user from SALESFORCE_AUTHENTICATOR using an apex logic but before doing it I want to put a validation ...
Anuj_sa90's user avatar
1 vote
1 answer
28 views

Variable does not exist compile error

I am running into the good ol' variable does not exist error while creating a simple trigger on the case object. As other posts here have suggested, I've checked for a class with the same name as Case ...
John Gilani's user avatar
1 vote
1 answer
157 views

Is There an Apex Equivalent to a Flow Scheduled Path?

We have a Case follow-up process defined in a Flow as a Scheduled Path. Is it possible to implement the same functionality in Apex? Under the hood, is the Scheduled Flow Path implemented as a ...
Ron Van Aken's user avatar
0 votes
0 answers
28 views

How to fix SLDS updates in new release, issue for tab icon color

I have following code working perfectly with tab icon color brings up perfectly. Suddenly after today's release patch it got failed, Any idea to enable tab icon color ? HTML: <template> <...
Ragul's user avatar
  • 541
1 vote
1 answer
30 views

Batch is not updating Account Rank correctly, rank is updating for each scope

My scenario is We have three custom fields in Account object - Closings, LoanAmt, Ranking. Ranking has to be ranked according to Closings amount. When Closings amount is same for couple of accounts, ...
surya's user avatar
  • 11
0 votes
1 answer
38 views

Update Last Modified Date One day before in Test Class

How to update last modifed Date five minutes before in Test Apex class? Datetime yesterday = Datetime.now().addDays(-1); Test.setCreatedDate(testLeadTwo.Id, yesterday); Test.setCreatedDate(...
shubham shrivastava's user avatar
-1 votes
0 answers
16 views

How to create activity records once we receive inbound email from Outlook to Salesforce for Lead Object?

When we send email using standard email component from Lead or Contact and When the particular Lead or Contact replies to that email that replied email must come to Salesforce and create a task under ...
Atul Rakate's user avatar
0 votes
0 answers
14 views

Test class to cover 75% code coverage , getting fatal error for the codes [duplicate]

Test coverage for the below Apex classes are not enough, getting errors while deployment. public class AccountDiscountsController { public Account accountRec { get; set; } public String accId { get; ...
Nav Vel's user avatar
-1 votes
0 answers
19 views

Experience Cloud Shows Single Sign On Error When hyper link is clicked

I have a LWC app that works in both Salesforce lightning and Experience Cloud. One key feature of component is to redirect users to a record page when a link is clicked. This works flawlessly in ...
Mike's user avatar
  • 29
0 votes
0 answers
29 views

Custom Error Message on ContentDistribution Object in Apex Trigger

I am trying to create a apex trigger on contentdistribution object by following this documentation and added a logic to throw a custom error message as 'This file is not allowed to be delivered.' but ...
Loki_72's user avatar
1 vote
1 answer
46 views

How to write SOQL on custom address field?

I have created one custom object in that I have one custom address datatype field. Field name is Location__c, I'm able to build dynamic SOQL using this custom field the code is as follows: @...
Atul Rakate's user avatar
-1 votes
1 answer
45 views

Access Token Expiration

I am writing a code to hit 3rd party integration system from salesforce. They have their api where they are using username password flow to authenticate while salesforce hits their system for first ...
Shri's user avatar
  • 1
0 votes
0 answers
59 views

Search Multiple SObjects in a For-Loop Workaround

I'm looking to see if there's a better way of running N number of SOQL's without a FOR-LOOP for the below requirement. I have an external system whose fields are mapping to Salesforce via a ...
Roy's user avatar
  • 11
0 votes
0 answers
17 views

Keep richtext codeblock identation and style to chatter feed item

Hi I'm trying to use a richtext in a lwc, in order to accept code snippets (String) denoted by triple single quotes like this: The lwc takes the richtext value and create a chatter feed item through ...
RProgrammer's user avatar
1 vote
0 answers
27 views

2GP dependent package creation fails with dependency error [duplicate]

We have a 2GP devhub in which we are trying to create packages. Our main package has a released version, and this main package is a dependency for our other package in the same namespace. { "...
Dorgaldir's user avatar
0 votes
0 answers
17 views

How to Create and Update Global Value Set and Picklists by APEX? [duplicate]

I Want to create Global Value Set and Picklists via apex, gone through some internet sources but didn't get any of them working for me. Any kind of help is appreciated. Thank You
Sahil Tatkare's user avatar
-1 votes
0 answers
28 views

How do I get GUID from SharePoint into salesforce?

I've successfully connected SharePoint with Files Connect in Salesforce. I'm now trying to automatically link SharePoint documents to Salesforce files by creating content versions and documents using ...
Nitesh Jain's user avatar
0 votes
0 answers
23 views

Debug log shows data in list of the Controller Class but Visualforce page is not displaying anything

The debug logs of the Controller class show the correct data in the list that I have used to split (questions and answers) but while using the same to display it on the vf page it is not displaying ...
Mandeep Kaur Duggal's user avatar
0 votes
0 answers
11 views

Data label for Radio buttons not being set in apex toolkit

I have to add visibility conditions on a few text fields based on the selection of radio button. For that I need to give the data label of the radio button and selected value in the withCondition ...
Saurabh-CK's user avatar
0 votes
0 answers
93 views

System.CalloutException: The callout couldn't access the endpoint

I have created an Apex REST endpoint and I want to test it using an integration user that I've also just set up. The integration user is using the "Salesforce Integration" User License. I've ...
Mike's user avatar
  • 1,199
0 votes
0 answers
31 views

No subject alternative DNS name matching found

Trying to make callout to an authentication provider and get the access token which I would be using in the consecutive callout with another endpoint. Was working fine Initially with all the endpoint ...
Raj's user avatar
  • 1
1 vote
1 answer
24 views

Coding an unsaved changes check on a visualforce page

I'm very new to VF pages, so apologies if this is an obvious question. I've built a VF page that is essentially just a big text box. I would like to throw an "Unsaved Changes" message when ...
PDBDS's user avatar
  • 11
-3 votes
1 answer
29 views

getting INVALID_FIELD_FOR_INSERT_UPDATE error on field update with API call

I'm getting the INVALID_FIELD_FOR_INSERT_UPDATE error when trying to update the field of master-detail relation.
Raghu's user avatar
  • 1
0 votes
1 answer
31 views

How to expose Salesforce Components in external website (with and without authentication)?

Has anyone worked with the 'Lightning Out' feature in Salesforce, which allows using components outside Salesforce and is currently in Beta? I'm interested in learning about any challenges, ...
Diptangsu Sasmal's user avatar
1 vote
1 answer
28 views

Invalid conversion from runtime DealFlowController to System.Callable

I am writing a remote action for my omniscript. In the Remote action, I've mentioned my classname and my method name correctly. I am not passing any remote options or extra payload. Here is my class ...
Sarang's user avatar
  • 2,606
-1 votes
0 answers
30 views

Too Many DML Exception

How to avoid too many dml exceptions in these batch apex (10001). When I try to run the batch apex it hits the governor limits. global class ProjectActionPlanBatch implements Database.Batchable<...
Chandrasekar M G's user avatar
1 vote
1 answer
33 views

Avoiding Batching of Concurrent Remoting Calls with LCC.callApex in Salesforce

I am developing a managed package in Salesforce where I have integrated Angular as a static resource. From the Angular application, I make remoting calls to Apex methods using LCC.callApex. However, ...
Arkan Mansuri's user avatar
2 votes
2 answers
61 views

Apex Trigger Not Firing - Debug Logs Empty

I'm trying to troubleshoot a trigger on the Account object but the debug logs are not showing any entries. Here's what I've done: Created a new trigger named "BeforeInsertTrigger" on the ...
Teacher Lemon's user avatar
0 votes
0 answers
24 views

How do we change the "Time Trigger (Minutes)" in the milestone after the Case enters the entitlement?

I am new to Service Cloud and need some guidance. I have a case that enters an entitlement when it is created, and there are milestones within the entitlement. I am using an Apex class with a time ...
Rahul Allada's user avatar
0 votes
0 answers
28 views

Is it possible to create a Pie chart using VF page that shows all the aggregated fields from a report

VF Page:: <apex:page controller="TestDanixController"> <head> <apex:includeScript value="https://cdn.jsdelivr.net/npm/chart.js"/> </head> ...
Danica Llantos's user avatar
0 votes
0 answers
37 views

Method does not exist or incorrect signature Expression cannot be assigned

This is the error: Method does not exist or incorrect signature: void getOcpIntegration(Account) from the type OCPDataRestCallOut (161:54) force-app\main\default\classes\OrderDataTest.cls Expression ...
user149369's user avatar
0 votes
1 answer
46 views

Is there a way to make production creation required/mandatory when user is creating opportunity?

When user is creating a new opportunity can we make it mandatory to add a new product. I know about "Opportunity Settings" on setup that we can use to prompt "add products to ...
Ajit's user avatar
  • 11
0 votes
0 answers
28 views

Updating External Credential Principal's Client Id and Client Secret via Apex

Using Apex, trying to: Create an External Credential for Client Credentials with Client Secret Flow Add a Principal with a Client Id and Client Secret Associate it with an existing Named Credential ...
nstuyvesant's user avatar
2 votes
1 answer
63 views

How expensive is throwing an Exception ? (I want a stack trace for non-exception conditions)

One way to get a hold of the current stack trace at any given point is to purposely throw an exception, catch it immediately, and inspect the trace information. I keep reading about the expense of ...
Eric Whipple's user avatar

1
2 3 4 5
739