Stack Exchange Network

Stack Exchange network consists of 174 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.

-2
votes
1answer
25 views

System.QueryException: unexpected token: nullnull

I am doing a query from a field in custom settings. And updating the leads Here is my apex code public with sharing class textInputsConsecond implements Schedulable { public list<Lead> ...
1
vote
0answers
19 views

CRUD/FLS Enforcement for configuration tables like FiscalYearSettings

Is Field Level Security enforcement a requirement for querying tables like 'FiscalYearSettings' and 'Period'? or only for tables like Opportunity and Contact. Our app need to display the fiscal year ...
0
votes
0answers
8 views

Live Agent offline Support

Can we show a custom link using offline chat page.I have a requirement just to show a custom link if i open the support form. Is there a standard setting that we can achieve the requirement. In ...
0
votes
0answers
21 views

Invalid type for implements System.Schedulable Class

I have the following class which I try to schedule from the anonymous window but this gives the error: invalid type:abc_RiskSchedulerProcessor Class global class abc_RiskSchedulerProcessor ...
0
votes
0answers
15 views

how to upload attcahment from visualforce page to document object? [on hold]

Here i have an contract standard object and document standard object and created a record in contract object and attached a file (doc or pdf) in note & attachment list. create a custom button(move)...
0
votes
1answer
19 views

Repeated invocations of Trigger Handler. Logs not helpful

I have a method in a trigger handler that's being called in a recursive but seemingly untraceable fashion. The following log entries just repeat over and over until I reach maximum stack depth. 01:...
0
votes
1answer
17 views

How to get callback result — lightning component

apex public class Edit_Controller { @AuraEnabled public static List<OpportunityLineItem> ItemList {get; set;} @AuraEnabled public static List<PriceBookEntry> Oppline(List<String> ...
0
votes
0answers
10 views

How to access the Schedule ID for each instalment of a LineItemSchedule

I have Products that have schedules with just one revenue amount (and date) and there are some that have two installments. When exporting this LineItemSchedule object, I can only see the second ...
0
votes
0answers
15 views

Insufficient access rights on cross-reference id in a managed package procedure

I have added a changing Opportunity owner logic inside Opportunity before triggers. And this is causing issue in a managed package procedure when I amend a contract in Salesforce cpq package. The ...
0
votes
0answers
19 views

Review Code - Account Merge [on hold]

Based on suggestion by @SFDCFOX to my question here, I tried to implement the logic as suggested Can someone please review my code and give me suggestions. ? I know there are fundamental flaws in ...
0
votes
0answers
29 views

Test Class for Dynamic SOQL [duplicate]

Pretty new with salesforce dev. So forgive me. I am doing a SOQL query and then updating records. The trick here is . I am grabbing my query from two custom fields which are in the Custom Settings . ...
-1
votes
0answers
30 views

How Can I store Rich Text Area field(Image) of a custom object into document object [on hold]

I have trigger to insert document record when ever account record is created and I have one custom field Image__c which is Ritch Text Area data type, I am storing images in Image__C field, How can get ...
3
votes
2answers
205 views

Illegal Integer but only after threshold

We are deploying a tiered schedule for pricing related to products based on a firms assets under management. The tiers have breakpoints based on these aum fields (currency). In apex I have a method ...
2
votes
0answers
30 views

Field is not writable on custom Big Object in APEX

I'm trying to read a set of records from a custom Big Object, update a long text field (not part of the object index), and then upsert back. When trying to update the value of the field I get 'Field ...
-2
votes
0answers
11 views

Insert records related to a common object related to two objects in Lookup relation [duplicate]

I have three Objects Contact, Item and Preferance. Prefarance is the common object which has lookup relation with Item and Contact. Type is field on Contact. I am writing a query on Item based on ...
1
vote
2answers
18 views

Batch Apex… which Object is iterable?

I'm dealing with the CampaignMember standard object, and a custom object called Binding__c. I need to create a new Binding__c record for each CampaignMember record, and there might be 25K of those -- ...
0
votes
0answers
10 views

Add Specific Attachments to Docusign envelope

I have Docusign for Salesforce set up with a Lightning Component custom button the generates the URL reqd to select the correct template, fill in various merge fields and redirect to Docusign. What i ...
0
votes
1answer
34 views

SOQL to return COUNT value via Apex

I am trying to return the SOQL listed values into a field using an Apex Trigger:- Object: Name = RPA__c Fields: Business_Area__c (picklist) VALUES = Finland Managed Services, UK Managed Services ...
0
votes
1answer
22 views

Date is Subtracting 1 day after converting to other format

For some reasons, the Date is subtracting one day whenever it is converted to other formats, I don't have any idea why this is happening. I am using .addDays(1) to temporarily solve the issue, but I ...
0
votes
0answers
18 views

Setting Picklist values dependency using metadata api

I have created two picklist values using metadata api and able to insert the values in the both the picklists, but I have to set the dependency between them, like one is controlling and other would be ...
0
votes
0answers
16 views

Automating New Starters [on hold]

fun one here for you. We're trying to automate our "new starters" which is essentially a new user, the whole idea behind this is to create a page layout as exact to the new starter form that our HR ...
2
votes
1answer
16 views

Does For update lock subquery records?

I tried searching a little bit but haven't found the answer yet. Suppose I am having a query: Select Id, Name, (Select Id, Name From OpportunityContactRoles) From Opportunity For Update Will the ...
0
votes
0answers
56 views

Apex heap size too large: 12289287

I have three objects Contact, Item and Prefarance. Prefarance is the object which is child for both Contact and Item. My scenario: When the Contact field " Type" is RA, I want to upsert records into ...
0
votes
0answers
8 views

How to bind two lenses in a Wave Dashboard

I have a dashboard which shows orders and order line items of selected users. I have a lens which has orders ranked. Like 1st order as 1, 2nd order as rank 2, so on and so forth. It is filtered to ...
0
votes
0answers
22 views

Sending Data from Controller to Javascript Function

I have a form that I wrote in VF page and use to send data to another place outside SF. When a user has filled the form - I want to store the data in SF and only then send the data. Because I need ...
0
votes
1answer
21 views

MIXED_DML error only on UpsertResult has errors

In a @Future method (because of other MIXED_DML problems) we are upserting users and collecting the results. We then want to send an email once the transaction is complete. If everything works well, ...
0
votes
0answers
5 views

How to show table of fields based on selection of object in picklist in visualforce page? [duplicate]

I want to show a table of fields whenever I select an object from picklist.
0
votes
1answer
16 views

Email not been sent from the finish method of a batch job in a unit test

The below code is to validate if an email has been sent from the finish method of a batch job using the Limits.getEmailInvocations(). The afterEmail variable is been set to 0 and no email is been sent ...
-1
votes
0answers
15 views

apex:outputlink Not working in Service console but working in normal Visualforce page [on hold]

Output link not working in Service console but working in normal org <apex:outputlink value="/apex/AccountsTest">Test Link</apex:outputlink>. Any help on this appreciated .
3
votes
2answers
93 views

How is it possible for @TestSetup to effect test result?

While refactoring a test to make it more consistent with the style of our other tests, a colleague came upon something really weird. The original test created the test account in @TestSetup, like so: ...
0
votes
1answer
26 views

Nested for loops with Maps --

Kindly guide me, how I can avoid nested For loop. I have already used Map. if (reqserviceAcct2assetLst.size() == 0 && serviceAcct2product.size() > 0) { for(Id i : serviceAcct2product....
0
votes
0answers
18 views

Salesforce CPQ - Filter Picklist Values based on Product in Configuration Attribute

Use Case: On Quote Line Editor, I have picklist configuration attribute with the picklist values 1, 2, 3, 4 and 5. When Product1 is selected, the picklist configuration should be filtered and display ...
0
votes
1answer
29 views

How do i access child fields.Below is the code

trigger ProcdureTrigger on Test1105__Procedure__c (before update) { public map<Test1105__Procedure__c,List<Test1105__Procedure_product__c>> accountContactMap = new map<...
0
votes
0answers
22 views

Can't compile for a package

When trying to create or open a package in Salesforce I get the following error: Bad References Found Please press Recompile All or edit and resave the following items « Back to Package List ...
1
vote
2answers
17 views

Does Apex have a remainder function that works with decimals?

I was trying to use math.mod(decimal,decimal) but I get the following error: Method does not exist or incorrect signature: void mod(Decimal, Decimal) from the type System.Math I know it is easy to ...
0
votes
2answers
20 views

Merge duplicates

In regards to @sfdcfox response to the solution on following thread Batch merging via Apex? Sorry to invoke this old post but I have a question about Merge_From__c lookup field on the custom object. ...
-1
votes
0answers
39 views

Getting Weird error in VF Page

On click of a custom lookup, i am trying the below error. Error: Pg:idForm:idPgBlk:idRoleSec:j_id150:0:check1: An error occurred when processing your submitted information. I have no clue with this ...
-1
votes
1answer
37 views

How to make a date field null on the input form of VF page?

I have a custom VF page and apex controller that mimics the standard Clone for Contracts. Currently, it is copying the date fields as they're from the previous record. However, I want to make the date ...
0
votes
0answers
27 views

Managed package can't differentiate between same API name objects [duplicate]

I have an object Project__c in my managed package. One of the VF pages in the package allows users to retrieve records for any object and filter them with desired fields. I installed the managed ...
0
votes
0answers
26 views

more than 2 dependent pick-lists

I am aiming for creating a dependency among the following pick-lists: Continent Europe Asia Africa Country Spain Netherlands China Korea Morocco City Madrid Barcelona Rabat Casablanca Beijing Macau ...
-1
votes
0answers
9 views

TwilioTwiML : How can I record the call using twilioTwimml in APex [on hold]

I am able to make a call from Salesforce and now I want to record the Call. The Record = true is making Post callBacks again and again which cause to fail the call. How properly can I use Record class ...
-4
votes
3answers
54 views

how to create dynamic query [on hold]

List<Opportunity> opps = [ SELECT Id ,Name ,Amount ,CloseDate ,Stagename ,Near_to_Close_Date__c ...
0
votes
1answer
30 views

Is there a way to change the value of a picklist on a vf page when it is copied from another picklist?

So I have a form that has 2 Address divisions. When the checkbox is checked the field values from one div copy to the other div. There is a country picklist in both the divs. But the value of that ...
-1
votes
0answers
38 views

sending Contact record Id to a web service

I want to use REST API to send the Salesforce Contact ID into a web service whenever a new contact inserted in Salesforce Org after validating few conditions. I was trying Global class with @...
0
votes
0answers
18 views

Streaming API PushTopic VS Trigger and API Callout

I haven't used the Streaming API yet. I was just researching on it actually and I like the option for PushTopics. However it's not clear to me what's the advantage/difference using that versus a ...
0
votes
1answer
20 views

How to do a SOAP api callout from apex

//Generated by wsdl2apex public class RSSInterface { public class TestContractResponse_element { public String TestContractResult; private String[] TestContractResult_type_info = ...
1
vote
2answers
43 views

How can I efficiently loop through opportunities on a list of accounts?

Currently we have a few nested for loops in our codebase that are doing what is mentioned in the question, but if we data load a large amount of records we run into CPU time errors. I am wanting to ...
0
votes
1answer
24 views

Apex (hidden) - How to access the code?

I' like to access the code of an APEX Batch, but it's hidden ... I've already had this issue for a managed package, but this time I don't know where to look ! Any idea ? Edit :
-1
votes
1answer
18 views

In apex how to know the whether a batch is schedule or it's running?

I want to know the status of a batch like whether it is schedule or it's running
0
votes
0answers
11 views

case History or case life cycle [closed]

can someone please help me to create a report on case which is created by client care center assigned to other department and again assigned to client care center I tried to create a field on case ...