Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
15 views

System.LimitException: Too many queueable jobs added to the queue: 2

Problem I need to run a batch method to update account hierarchies every 15 min. See my other post for the account hierarchy code. Currently, When I run the class I get the following error: ...
0
votes
0answers
23 views

XML Parsing Invalid

I am Currently Parsing a stored XML String in a field in an Object Name XMLParsing__C and it is currently stored on field xml__c. so meaning every new record has different XML Strings. ex first ...
0
votes
0answers
24 views

It does not show me the custom field in visualforce

I have two objects accounts and contacts (through the account I call the contacts related to it since they are several types of contacts), I want to show a custom contact field named Type_contact__c ...
0
votes
1answer
19 views

How many API calls can be made per hour to a non-bulk endpoint?

Assume that there was a REST endpoint that worked with 1 record at a time, i.e. not bulkified. If we were to use the Apex scheduler to pull down the records into SFDC every hour, what would be the ...
-1
votes
0answers
13 views

Lead Reassaignment. Can we do this with one trigger and class Combination [on hold]

acitve --> No Chnage inactive - > user --> manager is active --> assigned to manager inactive --> user --> manager is empty --> assigned to unassigned inactive --> user --> manager is ...
-2
votes
0answers
20 views

Testing code coverage , but unable to cover these part of code can anyone cover these part to reach 75% [duplicate]

List<Extended_Application__c> extLstUpd = new List<Extended_Application__c>(); Map<String,Extended_Application__c> extendedMap = new Map<String,Extended_Application__c>(...
1
vote
0answers
23 views

How do I roll up an Account Hierarchy and keep all children in sync?

Problem My org has many extremely complicated account hierarchies because of our client type. I have an ask: to stamp all accounts with sum of all of the accounts sales volumes in the hierarchy on ...
0
votes
1answer
18 views

Find the center record in a list from custom object and purge in bi direction

I have list of records from a custom object which is sorted based on a custom field "Date_of_Occurrence__c" in DESC. The size of the list is 30000. Now i want to the first record and last record in ...
2
votes
0answers
16 views

Did Salesforce remove FLS visibility for HasOptedOutOfEmail and HasOptedOutOfFax during a release update automatically?

I'm pretty sure my code was querying these some time ago inside a dynamic SOQL query. Today I can't query them anymore because FLS seems to be removed from the Admin profile that I'm using. Easy ...
0
votes
0answers
10 views

Case_UnreadByOwner [duplicate]

Please find the below visualforce page and Apex class code Any one please let me know how to test this code. VF Page: <apex:page standardController="Case"extensions="CaseExtension" ...
4
votes
1answer
50 views

Is there a way in Apex to dynamically determine the ApiVersion the current code is executed with?

Assume we have an Apex class myClass.cls and we use it on several different Orgs. While the source-code is the same, on some Orgs we use different ApiVersion, e.g. some Orgs use v45.0, others use v42....
0
votes
1answer
25 views

apex trigger to concatinate and update another field

I am working on one trigger where I need to concatinate two fields and populate in third field. On hed__Course_Offering__c object, I want to concatinate hed__Course__c and hed__Term__c field and need ...
0
votes
0answers
12 views

Post Web Service [on hold]

I am a beginner and I need to create a Post web serice which, when creating a Case in saleforce, the webservice allows the creation of the same Case in another environment (some fields will be saved ...
0
votes
1answer
20 views

How to replace html <input> tag with <apex:input> in visualforce without changing the output

I need to replace following visualforce code block which is used to input a String variable in my visualforce page with <apex:input> Visualforce <div class="slds-col"> ...
0
votes
0answers
10 views

Nested Json Data on VF page salesforce

I have a json data in nested array object format.I want to show it on VF page in table format. my data formate is like: { "results": [ { "engagement": { "id": 29090716, "...
0
votes
0answers
15 views

Lightning:CheckboxGroup how to default as checked

I have a lightning component called "TodoItem" which lists the TO-DOs for the user to go through based on the picklist field "Insurance Type". I was able to acheieve this through custom settings. I ...
0
votes
0answers
31 views

Text box to update contacts with visualforce apex

I have a detail, I want to obtain records in a text field to be able to update them using a "Update" button, I can only show them in an outputextText, when I input an inputText I mentioned this error "...
-3
votes
0answers
28 views

Apex Trigger. Can anybody help me to decide this? [on hold]

When creating a record of the Product object, the trigger should check whether the AddedDate field is filled in, if not filled, assign it the current date and the current time. Need to use apex ...
0
votes
0answers
20 views

Deleting Apex Classes & Triggers from Production

I am trying to delete some of my production code. I am using VS Code and when I push the following to Prod: <?xml version="1.0" encoding="UTF-8"?> <ApexTrigger xmlns="http://soap.sforce.com/...
0
votes
1answer
16 views

Showing user's assigned default record type on a lightning component

On a standard button override component I'm getting all record type values. Is there a way to show default record type assigned to the user's profile? @AuraEnabled public static Map<Id, String> ...
0
votes
1answer
17 views

separation characters between picklists value - Set

I have 6 multi picklists. I pushed all the selected values into Set For Example: Picklist A: Cherry Apple Picklist B: Apricots Avocado Picklist C: Banana Blackberries Blackcurrant ...
-2
votes
1answer
49 views

Unknown property 'ProductTablePageController.products'

I got the error below: Unknown property 'ProductTablePageController.products'. But why? Code is here: <apex:page Controller="ProductTablePageController"> <apex:form > <...
0
votes
0answers
35 views

How do I call SQL Server stored procedures from Salesforce? [on hold]

I've been asked to build a Build SSIS packages and deploy/execute them from Stored Procedure. This Stored Procedure should be executed/called from Salesforce. I've built the SSIS packages and deploy ...
0
votes
1answer
48 views

Print Aura from Apex to Lightning Component

I am trying to print lightning aura markup from apex to lightning component, i have my reasons :( but its not working, I tried unescapedHTML as well. Here is how my lightning component looks Aura ...
0
votes
1answer
15 views

FIELD_INTEGRITY_EXCEPTION, field integrity exception: unknown (scheduling not enabled on product): [unknown]

I am setting up some test data for my unit test but am hitting the wall when inserting a OpportunityLineItemSchedule. Here's my code: @IsTest static void myTest() { Account acct = new Account();...
2
votes
2answers
16 views

Which unit tests should check read access for user?

We are using fflib-apex-common in our project, and we implemented several selectors. By default fflib_SObjectSelector checks for Read permission. But now I am wondering what type of tests, and at what ...
1
vote
1answer
23 views

Schedule Batch Apex too many rows

I am having an issue because I believe I don't understand batch apex/scheduling very well. Every time I use this I get either a SOQL error of trying to query too many rows of 50001, or a DML error ...
0
votes
1answer
33 views

How to pass paramters to a dynamically created apex class [duplicate]

is there a way to pass in parameters to a class when creating it dynamically using Type.forName(classname).newInstance(). global with sharing class ManagerBatch implements Database.Batchable<...
-2
votes
0answers
21 views

Can any one help me in writing the test class for a class having wrapper class? [duplicate]

I have written test classes before but not sure how to proceed with this particular class containing a wrapper class. Can anyone suggest any directions, any help would be highly appreciated. public ...
-2
votes
0answers
39 views

Need help on query optimization [on hold]

Can it be possible to optimise the query mainly in or condition check ,can we use something list and contains .please help List<PermissionSetAssignment> lstcurrentUserPerSet = [SELECT ...
0
votes
1answer
36 views

You have uncommitted work pending with the DML

public with sharing class CalloutWebservice { public Account headAccount; private Boolean ApiEnabled; private List<Account> accountList; public CalloutWebservice(ApexPages....
0
votes
0answers
13 views

Salesforce integration with Social table [on hold]

Is there any one who have done salesforce integration with social table? I want to create guest list and guest with tags. At the moment its creating guest list and guest but when I add tag code in it ...
6
votes
2answers
127 views

Are some Apex governor limits are becoming “softer”?

Im currently updating lots of records of an SObject having extensive trigger logic and today I've noticed this limit consumption: Limit Name .................... ┃ ...Actual ┃ ....Maximal ┃ ....Usage ...
0
votes
0answers
21 views

get div Id inside Apex:pageblocktable using Jquery

I am creating a heirarchical structure between account and contact using pageblocktable within another pageblocktable. I have a div tag that is holding the contacts pageblocktable for each account. On ...
0
votes
4answers
56 views

SOQL with Date filter in WHERE clause

@AuraEnabled public static List<StaffReport__c> getUserReports(String UserId, Date startDate, Date endDate) { return [Select Date__c from StaffReport__c where User__c =: UserId AND Date__c &...
1
vote
1answer
15 views

Testing bulk clone operation

After doing enough Google search and scratching my brain, I have decided to post here and seek for suggestions. Here is the background: An opportunity has multiple order & order line item ...
0
votes
1answer
23 views

Need to Fetch If assigned PermissionSet to user have specific permission

Requirement-I need to sent true or false flag based on permissions assigned to user Permission sets. Suppose one user is having 5 permissions assigned to him/her ,I need to check(...
0
votes
0answers
30 views

INVALID_CROSS_REFERENCE_KEY when trying to delete OppotunityLineItemSchedule

I'm stuck on this error and can't figure out where is the problem: I have a trigger on Opportunity object which would look at another Opportunities OpportunityLineItems and see if the ...
1
vote
1answer
20 views

Trigger addError('blah') -> Lightning Components JS alert('contense of addError('blah')')

I am sure my Title does not help much, but not sure how to shorten this question concisely. I have a Lightning Component that has the ability to update a case record. I have an APEX Trigger that ...
0
votes
0answers
7 views

View the history of SingleEmailMessage usage

I know how to see how many SingleEmailMessages we've sent in the current GMT day, but I need to know if it's possible to see a history of emails further back than that. For example, for the past week, ...
3
votes
1answer
44 views

How to test soql with For Update statement

I have a SOQL query that uses the FOR UPDATE statement. Actually, this query is in a selector class. Now I want to test my selector class, but how would I test that records returned by this query are ...
0
votes
0answers
21 views

Libraries and packages all Salesforce implementation should have [on hold]

I'm starting a new project and I would like to ask what are the libraries and packages that you always/often use in each new project/Salesforce implementation. Please also add GitHub, explanation and ...
2
votes
2answers
29 views

ContentVersion FileExtension

Does anyone know how I can change the FileExtension for a new ContentVersion in a test class? Im currently trying to create a test class for my ContentDocumentLink Trigger, in which I have an if ...
2
votes
2answers
50 views

Change Data Capture and Async Triggers

I have been reading about the new Salesforce async triggers. Currently, I tend to handle these sort of needs with a trigger that passes data to a 'Handler class' that would evaluate if a certain ...
0
votes
2answers
40 views

Apex trigger to stop duplicate records into SF if email already exists on a person account

I have an existing trigger which converts leads into peron accounts if the company name is blank. Trigger AutoConvert on Lead (after insert) { LeadStatus convertStatus = [ select ...
0
votes
0answers
20 views

Filtering not working properly with paging [on hold]

I have a Datatable of 500 entries, each page contains 50 entries. When I try to filter a property, I excepted it to filter all 500 entries, and paging the filtered result. But it only filter the 50 ...
-4
votes
0answers
35 views

List of size 6 too large to display [on hold]

list<list<object>> obj = new list<list<object>>(); for(list<String> data : obj){ } I am getting an error in line 2. List of size 6 too large to display.
0
votes
1answer
17 views

Roll up summary Trigger performing total sum in account

I am not able to perform insertion,updation,deletion on account Apex class: public static void parentUpdate(list<Contact> records){ set<ID> ids = new set<ID>(); for(Contact ...
0
votes
1answer
15 views

Fast compilation for Salesforce

I have Sublime Text 3 with MavensMate plugin. Also have MavensMate application setup in the machine. Whenever I save any apex file it goes to the server and gets any errors found. Which is a bit ...
0
votes
0answers
13 views

default new lead notification email

My partner portal users get an email notification when a lead is assigned to them, but I cannot for the life of me determine where they're coming from. There are no workflow rules / email alerts, ...