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.

0
votes
0answers
26 views

Test class for pagereference in a method [duplicate]

I am unable to get code coverage for my pagreference, my code is code: public class selectedcase { public list<recordtype> record {get; set;} public id ids; public selectedcase(){ ...
0
votes
0answers
13 views

connect salesforce to Microsoft azure using apex callout [closed]

I have a requirement when ever employee is marked as active we need to create Microsoft azure id with first name . last name ? any idea about how we can authenticate the Microsoft azure active ...
-2
votes
0answers
24 views

want to write helper class that can be call in after insert, after update trigger [closed]

I am having one child object where 2 fields are status and date. the parent object is opp. so want to create a field on opp looking to child object so that this new field will populate whenever the ...
0
votes
1answer
17 views

Insert a List collection into a Map Collection with the same index

I am trying to add a List of collection to a Map Collection with the same Index. I have this Code: List<Account> accountContactList = [SELECT Id,Name FROM Account]; Map<Integer,List<...
3
votes
1answer
118 views

Trigger: Find out the name of the object the trigger is firing for?

Is it possible for the trigger to see the name of the object it's firing for? Say can I make the OpportunityTrigger be aware that the object name it's firing for is Opportunity without hardcoding the ...
2
votes
1answer
23 views

Subquerying filtering on main query field

My intention is to filter the child records which are != to a field of the master. Account: Master Application__c : Child Using Subquery: select acc.id,acc.Callista_Org_Unit_Code__c , (select ...
0
votes
1answer
14 views

Validation rule for non testing context

In Apex to separate code execution for test and non-test context we use the following method Test.isRunningTest() Do we have any such thing for validation rules i.e the validation rule should be ...
0
votes
1answer
39 views

Need Help on Modifying Code [closed]

I found this example on a dynamic hierarchy for Accounts and I need help as to how to modify it to display an account hierarchy. I am unable to figure out why I recieve this error message when testing ...
0
votes
1answer
27 views

Help With Method Increment A Score

I have a class that increments a custom field on the Contact record. If the contact has a campaign member status of Opened then the Pardot_Emails_Opened__c field increases by 1. If the status is ...
0
votes
1answer
31 views

How to Loop through a map that contains multiple object IDs?

Must be really simple but I am struggling with how to loop through this map. Gone through some examples but was unable to figure it out. Question is, how to loop through user IDs from TargetActorMap ...
0
votes
0answers
29 views

Lightning Error Message Question

I'm trying to create my own Account Hierarchy link that displays more than 500 accounts and its children utlizing lightning componenets and lightning out. I keep recieving this error whenever testing ...
0
votes
0answers
35 views

Get Values for a Picklist Field Based on RecordType [closed]

When I hit this URI: /ui-api/object-info/{objectApiName}/picklist-values/{recordTypeId}/{fieldApiName} I get this response: System.HttpResponse[Status=Not Found, StatusCode=404] I am receiving ...
-2
votes
0answers
26 views

ASCII Characters [closed]

I have one requirement where submitting answers in the field boxes the user should only be able to submit ASCII characters in visualforce page.
0
votes
1answer
46 views

call Messaging Queue every 5 Minutes [closed]

I want to make Integration between Salesforce and ActiveMQ(Is is a messaging server where the company send and save messages in this service). The Context: Every 5 Minutes should salesforce a ...
0
votes
0answers
30 views

Test class for RequestData class [duplicate]

@HttpPost global static List<HHSurvey> getHHSurveyList() { RestRequest req = RestContext.request; RequestData mRequestData = (RequestData)JSON.deserialize(req.requestBody.toString()...
0
votes
1answer
23 views

Working on Search Criteria and limit the number of filters displayed on Search Criteria section

I am working on a Search Function using custom controller. I have 4 Filters (Account Name, Country, Account Type, Contact Name) in my Search Criteria Section. I have a requirements that, it must have ...
0
votes
1answer
20 views

Passing array from Visualforce Javascript to apex class

Before posting this question let me tell you all i have already referred below posts for reference Post1 Post2 But was unable to proceed with the solutions provided.So posting my query here As my ...
0
votes
0answers
20 views

Test method for doGet() [closed]

@RestResource(urlMapping='/getTL/*') global class WS_GetTLList { @HttpGet global static User doGet() { RestRequest req = RestContext.request; User user=new User(); String ...
-1
votes
0answers
18 views

Append case id in subject on reply to email

I am working on email to case. My requirement is: Whenever a user send email from outside to salesforce generated email service address, case record should be created. After that user should receive ...
1
vote
1answer
14 views

Issue with matching password with javascript in Visualforce Page

Here I had write javascript to match password and confirm password < script > function check() { var p1 = $('.password11').attr('value'); var p2 = $('.confirm_password').attr('...
0
votes
1answer
20 views

Trouble writing Help Class for JSON de

This test class is driving me crazy. I have can prove an array is passing through the class from the test class, but I can't seem to get code coverage. I did use the Json2Apex tool to build the class. ...
2
votes
2answers
34 views

Salesforce: Issues in removing the entire child node in an xml

I have an xml , and I tried to remove an entire child nodes using the xml DOM process. Even i use the remove child method , the result says true but if i print the dom it still holds that child ...
0
votes
1answer
18 views

How to have Apex Trigger post Chatter field updates in one post?

I currently have an apex trigger that posts to chatter for when a field is updated on a record. Currently, the trigger works but posts each update as a separate chatter message: I want to have it ...
0
votes
1answer
16 views

How to update contact owner value

I have this SOQL: SELECT Id, mudouProprietario__c,(SELECT Id, AccountId, OwnerId FROM Contacts) FROM Account I need get value of owner account and set the value at the contact owner I created a ...
0
votes
0answers
16 views

Lightning - Context URL - Get get Id from URL

We are using Lightning. Context URL https://stiyej--sdsd.lightning.force.com/lightning/r/ContentDocument/0690D00000sdsdRQAS We want to get the conten id from the url in Apex. Is there any way we ...
0
votes
2answers
46 views

Race condition Soql with order by

I have a lead owner assignment logic with many conditions. When user presses a button "Get lead" a lead in the org is searched and ordered by the field rank (Soql order by rank__c), and when the lead ...
0
votes
1answer
45 views

Multiple Nested Loops in Apex

Background: I have 3 objects: Contacts, Accounts, Campaign, that are involved in the scenario. Contact is the parent object, Accounts and Campaigns are child objects to contact(Related Lists) There ...
0
votes
1answer
21 views

Why does number field comes as Decimal type even if Decimal places is 0 in field definition

A very basic question. We define a number type of custom field and try to fetch it in apex. After this suppose I write following code : Set<Integer> validCounts= new Set<Integer>{1,3,6,9}...
-2
votes
0answers
21 views

can we disable inline editing for a particular data type for a particular field? [closed]

I have used InlineEditSupport in VF. I have a Number field and I want if user try to insert any text in that field then the input will not take , but user can insert or change the field value with any ...
0
votes
0answers
25 views

Lightning Custom Caching

Hello Lightning Experts, How to implement custom caching in Client Side for Lightning. Is HTML 5 Web Storage is right option for this? Use Case: Based on the service address, show the service ...
0
votes
1answer
18 views

Json2apex - Message consuming unrecognized property

I am not able fetch all details for message & text fields node. Getting error as: Message consuming unrecognized property: name, Message consuming unrecognized property: userId, Message ...
1
vote
1answer
32 views

Test Class for Controller Extension Visual Force Page

I am trying to test my controller extension, Although the final score coverage hit into 100% but when i checked my tests log in my dev console i got Error. This is the ERROR Message: System....
0
votes
0answers
11 views

Do Einstien Analytics Support Long text area field filter

I have a saql which is filtered using Long Text Area. When I remove the field the query is working fine but when it is included, it is throwing this error Query Exception is failing Please find ...
0
votes
1answer
14 views

Schedules Apex Failing - Attempt to de-reference a null object

I am getting the following error for a Scheduled Apex Job and don't know how to fix it (not a developer, just adapting some existing code). The aim is to update a field every night to trigger ...
0
votes
1answer
8 views

How to solve this error Unknown constructor 'MassDelete.MassDelete(ApexPages.StandardController controller)'

// Apex Class //This problem is occurred while I Use extension concept in VisualForce Page it give error Here is Code// public class MassDelete { public List<Account>accounts{set;get;} ...
1
vote
1answer
30 views

Page getContent / getContentAsPDF not retrieving the updated data

I'm able to get all the data by calling the Page.getContentAsPDF() function by selecting all the record from Account object. Basically, I'm loading the pdf content based on query from page ...
0
votes
0answers
19 views

Upload a Profile Photo For Community Users In base64 Format [closed]

While Uploading am getting "ConnectApi.ConnectApiException: The file you uploaded doesn't appear to be a valid image" This error, Any Suggessions
0
votes
1answer
16 views

Salesforce CPQ: Block Pricing with Configuration Attribute

Block pricing is very useful to set the price based on the quantity of the product. But can it be used with a configuration attribute?. For ex: Block Pricing 0-99 - $1000 100-199 - $2000 200-299 -...
0
votes
0answers
14 views

How to Upload a Profile photo in base64 format For Community Users Using ConnectApi.UserProfiles.setPhoto

Am Uploading Profile Photo for Community Users in base64 format By Using ConnectApi.UserProfiles.setPhoto Method. But am getting "ConnectApi.ConnectApiException: The file you uploaded doesn't appear ...
0
votes
0answers
8 views

How do I convert a checkbox functionality to a radiobuttons on a visualforce page?

There is a functionality I need to achieve. I have 2 checkbox fields. But on the vf page I need to show both of them as radio buttons. So if the 'Yes' radio button is selected it should work like the ...
1
vote
1answer
22 views

Setting a From Address while sending Email

How do we set From Address while sending email using messaging.SingleEmailMessage. I have got a solution which uses setOrgWideEmailAddressId to set from address, OrgWideEmailAddress[] owea = [...
0
votes
0answers
46 views

Apex heap size too large: 6125236

I have a visualforce page which is throwing me the error "Apex heap size too large: 6125236" I have referred to couple of similar issues here on stackexchange but this seems to be a different issue. ...
0
votes
1answer
22 views

Map<String,wrapper> returned from apex class, not received by the helper controller!

I am returning a map value from the apex controller, but the helper controller doesn't receive anything data. Here the system.debug outputs the right values to be received by the controller. Plz ...
1
vote
1answer
28 views

Jenkins fails to create Scratch Org

I have a CI process runnning in Jenkins. The script is pushing everything to the devHub org and creating a package version. Next, it's trying to create a scratch org but is failing and throwing this ...
0
votes
0answers
18 views

How could I build a new dataset for new events at Event Monitoring Analytics apps?

I need to monitor events which don't have a pre-built dashboard and dataset (DocumentAttachmentDownloads, Logout, PackageInstall, Search, SearchClick), and I would like to know if there is any method ...
0
votes
1answer
21 views

Error Message Question

I'm new to salesforce and am unsure how to approach this error message. I had created this class that rolls down a Contact Role from a Contact created on a Parent to its children and a trigger that ...
0
votes
1answer
25 views

Custom Setting vs Custom metadata for keys/client Ids [closed]

We want to move all of our secrets (api keys, endpoints, public/private keys, etc) related to several services to custom setting or to custom metadata, we are not sure what place is better. These ...
4
votes
1answer
49 views

Future method with higher limits

Has @Future method with higher limits been removed from Spring 19 release? I'm asking it because Future Methods with Higher Limits (Pilot) page has been removed from Apex Developer Guide.
0
votes
1answer
20 views

is actionFunction or jQuery init function running first?

I am now responsible for a chunk of code that is big and old enough that no one is certain how it works. I have a few questions I'm hoping you can help with. I have a page called PolicyDetails.page ...
0
votes
0answers
32 views

TooManyLockFailure : Too many lock failure 200 Trying again later

I have a requirement to provide a particular group of records to one user.But record sharing criteria depends on formula field. So, I'm not able to share through sharing rules. So, I have created an ...