The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [class]

A class is a template or blueprint from which objects are created. An object is an instance of a class.

Filter by
Sorted by
Tagged with
0
votes
1answer
24 views

System.ListException: List index out of bounds: 0 Stack Trace: Class. line 33, column 1

I am trying to use rollup help enable real time. To do this the app (rolluphelper) wants to install a trigger and a class onto the opportunity object. But in deployment it fails with the following ...
0
votes
0answers
10 views

Retrieving and Deploying an Apex class with an older managed package version

In our testing org. I have a class that doesn't function correctly within our org when on the latest version, in fact a managed package needs to be downgraded for the issue to disappear. 7.27 -> 6.96 ...
-2
votes
1answer
33 views

how to write a test class for web service HttpPost

I'm new to development here I'm developing a webservice in rest and I have no idea about how to write a test class for that. Please find the below code of apex class: @RestResource(urlMapping='/...
0
votes
0answers
14 views

Need Help with a test class to my apex class that attaches a Visualforce Page pdf to the quote [duplicate]

I found a way to write an apex class that attaches my quote which is generated by an vf page as a pdf to my quote object. Writing the test class is even a bigger problem for me. I get to 36% coverage ...
0
votes
1answer
23 views

Creating test class for apex (reports namespace) used in Flow action

I have a Flow which calls an apex class (via action). The purpose of the action is to grab a list of Lead Id's from a specific report. The reportID is passed to the class from the flow. Then, the ...
0
votes
1answer
35 views

Execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object Class.Battle

I would like to create a trigger to activate when using the Battle class and its battle percentage method, but it gives me a "activate percentage: execution of BeforeInsert caused by: System....
0
votes
1answer
588 views

How to export data using reports from SFDC programmatically?

We have an issue where we have to manually click Export Report on SFDC reports though the UI on many reports. These reports have several filters and filter logic such as "(1 or 2) AND (4 AND 1)" and ...
3
votes
1answer
4k views

Can we generate a WSDL from an Apex class

Is it possible to generate WSDL from an Apex class ?? Cause i want to check one request but i don't have the WSDl to check from SOAP UI.
0
votes
0answers
37 views

Is there a way to hard delete an Apex Trigger when there is no Apex Class?

I had a developer work on this before myself, so I'm working backwards. I've been able to get all the coding I needed for my org, however, now I have two Inactive Apex Triggers sitting in the Sandbox ...
0
votes
2answers
38 views

Error: Compile Error: Method does not exist or incorrect signature: void ceiling(Integer) from the type System.Math at line 19 column 36

Error: Compile Error: Method does not exist or incorrect signature: void ceiling(Integer) from the type System.Math at line 19 column 36 Trying to add an integer for week of the year into class ? ...
0
votes
2answers
31 views

Setting Invocable Variable value for a Test Class

I'm having difficulty finding a way to write the syntax to set my invocable variables in the test class: Here's the code. global class EmailPreventivoAccettato { global class Parametri { @...
1
vote
1answer
33 views

Help with “Duplicate id in List”

I've recently started at a new company with a completely different instance. Recently I've noticed a growing amount of errors looking like CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: CaptureCard_Trigger:...
1
vote
1answer
32 views

Test Class for Business Hours Check

I am trying to build a test class for my new trigger and part of the trigger is to check current time against the org business hours then set it as a boolean yes/no. Code: DateTime now =system.Now();...
0
votes
0answers
14 views

Apex Code Coverage for if/else if test class [duplicate]

if (userList.size() > 0 ) { String profileName = userList[0].Profile.Name; if (profileName == 'CP_CorporateAdminUser' || profileName == CP_SystemConstants.CORPORATE_OPERATION) { ...
0
votes
2answers
36 views

Confusion regarding save order of execution

I have created a number field in the contact object and created a trigger which is adding one number to the number field, a workflow doing the same, and a process builder doing the same now I have ...
1
vote
1answer
576 views

Parsing plain-text body in Email service class

I am trying to parse an Email body for text that follows "name: " within a plain-text email. Should this not do the trick? The field is not being populated Pattern p = Pattern.compile('(?m)(?i)^name:....
0
votes
1answer
35 views

Enable Default Email Templates in Case Feed is not working

I am trying to enable the default email template selection logic as per the salesforce provided document - https://help.salesforce.com/articleView?id=case_interaction_default_templates.htm&type=5 ...
0
votes
0answers
27 views

Messaging.PushNotification : change structure of payload

I'm building an app on iOS and Android using react-native without the Salesforce Mobile SDK. I want to be able to send Push Notification to the app using Salesforce PushNotification class in Apex. ...
0
votes
2answers
46 views

Extracting Dynamic String from a String

In the below Email body, I need to grab the External Account Id (4891 in the below example), however, that text can be between 4 and 8 characters long. Once I have the ID I'll find a matching account ...
0
votes
1answer
42 views

Modal content not displaying correctly

I am creating a lightning component that pops up from a button on Opportunity. In this lightning component I am using multiple recordEditForm tags that are just outside tab tags. When setting the ...
1
vote
1answer
28 views

How to select the language of a custom label in Apex Class

I have an Apex class which sets the subject and body of an email using custom labels. The new requirement is to set this text per the language selected using a picklist field on Quote object. For ...
0
votes
2answers
1k views

Set target object id missing

I am facing a error while sending a email notification to the property (custom object Property__C) general manager. Error: execution of AfterInsert caused by: System.EmailException: SendEmail ...
0
votes
0answers
23 views

Need Help for Apex Test Class [duplicate]

i have a problem with test code coverage of my trigger: that's the code: public class OpportunityLineItemTriggerHandler{ public static Boolean isTriggerFire = true; public static void sync(Set<Id&...
2
votes
3answers
985 views

convert hex value to integer

I am working on a method defined in a class that controls the lead object. The desired end result is to produce a unique number for each Lead record. I currently have this working, but the out put is ...
0
votes
2answers
44 views

Combine two different PDFs in single Visualforce page?

I have used below visualforce code to display two pdf in a single page but in the result, I am getting two different PDFs with two sections with iframe. Is it possible to combine these two PDFs in ...
0
votes
1answer
634 views

Update list values in an input text field

I have below code to update the input text field value for OUTCOME field from the User. My list update is failing to happen without throwing any exception. Please can someone help me here? My ...
0
votes
1answer
37 views

How to deep clone a batch class?

I have tried deep cloning on the opportunity object which has closed won stages it will also clone the Related Products I have tried cloning the opportunity and it works okay,how will i deep clone it?...
1
vote
1answer
832 views

dynamic datatable

I want to create a datatable with opportunity information. I add a picture that shows how the table should look like. I have the information for the table ( below is my class code), but I don't know ...
1
vote
0answers
24 views

Populate a Lookup Field Upon Record Creation

I am trying to create a trigger that will populate a lookup field on a custom object called Levvel Forecat. The basic criteria here is that when a new Levvel Forecast record is created with a ...
0
votes
1answer
440 views

Case “Internal Comments” in VisualforcePage and Controller

Below is my Apex Page: <apex:page standardController="Process_Adherence_Monitoring__c" extensions="PAM_QuestionButtonPageController"> <apex:form > <apex:pageMessages id="msg"/> &...
1
vote
1answer
378 views

Is there any way to make a change to a managed package component outside of packages and patches? Or on the fly?

I received the following feedback from an SF customer service agent, and I am not sure I understood him 100% correctly. You are able to edit the code in a managed package in developer, trial, and ...
1
vote
1answer
106 views

LWC: Can I have an expression and a string as a class combination?

I have a div and I want to assign one css class statically and one dynamically. Something like this: <div class="my-class + {dynamicClass}"></div> However that is not working and I am ...
3
votes
3answers
69 views

Apex more than 50 Queueble jobs

I have this class that call a Queueble job more than 50 times in a loop. I recive the error: Too many queueable jobs added to the queue. The limit is 50. Here is the class: global class ...
0
votes
2answers
369 views

Read-only “Lookup” field.

How can I make lookup field as read-only so that the user does not change the lookup field? I'm using custom object and like this to be done using apex code since I'm writing all my business logic ...
0
votes
1answer
1k views

Display error message from controller fails

I have below apex page where I am trying to catch a custom apexpages.addmessage from the controller. But it is not working , simply not displaying the error message in page. Can someone please help? ...
4
votes
1answer
58 views

Need help in optimizing the below helper class

Logic : For any new record inserts for 'Properties' object, check if its Account_Ref_Ext_ID__c equals to 'Account' object's Chris_Account_Number__c. If it matches, assign Account id to properties ...
1
vote
2answers
194 views

LWC: Removing a class name on scroll

I am trying to remove a class name once the user has scrolled a certain amount. In my JS file for a LWC I have the following: import { LightningElement, wire, api, track } from 'lwc'; function ...
0
votes
1answer
35 views

Scheduling Flow

I am trying to create a screen flow that is scheduled in Salesforce. From the screen flow I call an Invocable method where I pass my input parameters from my screen flow. From there I call a future ...
0
votes
1answer
365 views

Mass transfer approval process

In our case, usually the users request us the approvals pending of a particular user. We go to Setup -> Administration Setup -> Data Management -> Mass Transfer Approval Processes and we manage ...
1
vote
0answers
22 views

Batch fails to deploy

I have a batch that I uploaded into Production successfully on July 20th and then a change to that batch on July 27th, both with no issues. I needed to make another change to that batch today, so I ...
0
votes
1answer
40 views

Error saving classes

When trying to save these two clases highlighted in the photo, you are encountering the error "Invalid api version: 0.0" as highlighted in the image.
-2
votes
2answers
72 views

Attempt to de-reference a null object - error in test class

I am trying to update business unit field in business_unit__c custom object. for this we have used custom settings in trigger and if manually any sales rep is creating based on their role we created a ...
0
votes
1answer
26 views

Issues with this Test Class for this Opportunity Trigger

I have created a trigger that on clicking the Sync Quote button it will update Opportunity Products with custom fields our organization needs to put into the accounting system trigger ...
0
votes
1answer
29 views

0% coverage on trigger [duplicate]

I have a working trigger that I'm starting to build my test class for. I've done a few lines and ran a test to make sure it's working as it should and everything seems okay, except the trigger itself ...
2
votes
1answer
117 views

Where or how can I find what interfaces an out of the box Apex class implements?

Is there a method of discovering (or a place to look up) all of the interfaces that an out of the box Salesforce class (Like LoginHistory) implements? The reason I ask: I'm attempting to test a ...
0
votes
1answer
32 views

Apex classes in Trigger body

We can write apex classes in trigger body and these apex classes will be considered as inner classes as outer class will be trigger class/body. Is there any use case we can define classes in trigger ...
0
votes
1answer
80 views

Cannot delete @Deprecated component in a managed package even with SF deletion tool

We have a @deprecated apex class in our managed package and want to delete it. We logged a case to enable the Component Deletion Tool but still cannot delete the @deprecated component. Here's what I ...
0
votes
0answers
18 views

class test for controller [duplicate]

I need some assistance writing a test class for this extension controller : public with sharing class ControllerOppRel { public Product2 opptyList; public ControllerOppRel (ApexPages....
-1
votes
1answer
33 views

How to Unshare Record By using shared date

I want to Unshare records by Query which I shared 1 month ago. List<CustomObject> rec = [SELECT Id, CreatedDate FROM CustomObject WHERE CreatedDate <Whatever Date]; How I can get Shared ...
1
vote
1answer
445 views

LAST_N_DAYS doesn't work correctly

I have selected all accounts with a few information and the lastmodifieddate of the opportunities. I ordered the join by the lastmodifieddate DESC LIMIT 1. This is fine so far, when I output the date ...