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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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
1answer
10 views

Convert string time to datetime with timezone

I have a requirement where I want to convert a String time "15:00" (pstTime String) in PST timezone to a string time "08:00"(gmtTime String) in GMT. The date is immaterial. The way I'm trying to ...
0
votes
0answers
11 views

Access the Controller of Visualforce Page from Page Component

I have a visualforce page that named as "CaseDetailPage" which has a controller "CaseDetailController". On my CaseDetailPage, I used a page component "CaseCollaborator". I want to access the method I ...
0
votes
3answers
12 views

How to remove time from date?

The following code returns the time of the current date: System.debug('Current date: ' + Date.today().toStartOfMonth()); Output: 2018-08-01 00:00:00 How to remove time from date?
0
votes
2answers
25 views

Basic Map And I am Stuck in FOR Loop

Here is my Map Map<id,List<Custom_Report_2__c>> mapreports= new Map<id,List<Custom_Report_2__c> >(); for( Custom_Report_2__c cr:cr1){ mapreports.put(cr....
0
votes
1answer
18 views

ActionFuntion not rerendering data on UI

Visualforce : <apex:page id="ContactSearchPage" controller="ContactSearchController" sidebar="false" showHeader="false" standardStylesheets="false" showChat="false" docType="html-5.0"&...
1
vote
1answer
95 views

Is it Possible to use the Result of Callout1 in Callout2?

I need to generate an access token with an HTTP callout and make use of that access token in another HTTP callout. These 2 HTTP callouts are future methods being called inside a Scheduled class. Is it ...
0
votes
0answers
9 views

Update most recent (newest) Opportunity Created Date should remain Closed Won

enter code hereI am working on a requirement which goes like something bleow: We have Accounts and Opportunities. Opportunities has a record type as Surgery. 1. If the account has more then one ...
0
votes
0answers
8 views

Fetching external references through symbol table

Can anyone suggest a way to obtain the external references, with the help of symbol table results obtained. Am able to fetch dependencies, but when it comes to external references, am getting it as ...
-4
votes
0answers
15 views

Unable to create a test class for Cancel button

I am unable to create the test class for cancel button. I tried but got error   Argument 1 cannot be null. Please provide the test class for following code public pagereference cancel() { ...
0
votes
2answers
15 views

How do I iterate over my Set in a Batch Class?

I'm trying to iterate over a Set that is sent to my Batch Class, I am getting an error stating the following: Class FileCleanup must implement the method: void Database.Batchable.execute(Database....
0
votes
2answers
22 views

Error -[Cannot read property 'style' of null]

Error ID: -270960303 This page has an error. You might just need to refresh it. Error in $A.getCallback() [Cannot read property 'style' of null] Failing descriptor: {c:CommunityBreakingNews} ...
0
votes
0answers
20 views

Glitches on after some code is uploaded

I use WebStrom + Illuminated Cloud 2 to upload code to my sandboxes. Sometimes I'm uploading some component and apex classes, and in my log view confirms that my code was completely uploaded. example ...
0
votes
0answers
10 views

How to use Visualforce Tab in Community portal

We have recently purchased a E Learning Application and wanted to link Community portal so that Portal users can click on particular link which will click Visualforce Tab and redirect to new ...
0
votes
1answer
20 views

Default CreatedBy/ModifiedBy user for the records created by a Batch Class?

I am just wondering, which Salesforce Admin user will be the CreatedBy/Modified for the records that are upserted in a batch class? Is there a special setting where I can see/modify/choose a specific ...
1
vote
2answers
26 views

Dynamic field for Database.Upsert

I am trying to use a dynamic field for my Database.Upsert command as follows: String extField = objVariable + fieldVariable; Database.UpsertResult[] up = Database.upsert(toUpsert, extField); This ...
0
votes
1answer
27 views

Moving values across lists to delete a subset isn't working

Hoping you can help. I am trying to move some specific tasks over to a list that I can delete. It's more of a practicing apex thing than a necessity. I know I can use data loader to do it quickly, but ...
1
vote
1answer
23 views

Upserting on Dynamic List in Apex [duplicate]

I am trying to upsert a dynamic list of objects into Salesforce using Apex, before point of upsert I have casted a new list to explicitly describe which object this is but I still receive the ...
0
votes
1answer
16 views

Need help with Error Debug

I am getting the following error when running my code from Developer Console. public static void findShortestSubstring(String stringObj) { Integer stringLength = stringObj.length(); List<...
-2
votes
0answers
24 views

What are the best options to extract LDV from SFDC? [on hold]

Use Case :: Able to import SFDC Data [LDV] in a prescribed format [Pipe Delimited | Tab | JSON | XML]. User should have the choice of selecting the format option and think to build a utility. Please ...
0
votes
2answers
28 views

How to attach a document in lightning, not a ContentDocumentLink

We are finally rolling into lightning, but I am having an issue as sometimes we have user that upload a certain doc type into the system, when this type of files are uploaded it triggers some special ...
0
votes
0answers
24 views

SOQL and SOSL questions [on hold]

I have a list of questions that I am unsure of. There's a few questions on SOQL and SOSL. SOQL Questions: Can you do joins in SFDC? I have only learned the Parent Child relationship way for SOQL and ...
0
votes
0answers
14 views

Method does not exist or incorrect signature: void method() from the type DebugNameUpdateSchedulable Stack Trace: null [on hold]

when i am validating while deployment via change set getting above error, could you please help me on this , Thank you, Mahesh,
3
votes
1answer
28 views

What fields deploy with NamedCredential?

I have a callout where we use a Named Credential and it looks something like the following: public class MyClass { public MyClass() { inputHttpHeaders_x = new Map<String, String>...
0
votes
1answer
25 views

Get RecordTypeID by Name for Lightning Component

I am beginning to look at using a Lightning Component to quick create records, I have been able to get quite far but have got a little stuck when trying to set the record type id of the destination ...
1
vote
2answers
24 views

Is the Phone field type ever searchable?

Is the Phone field type ever searchable? Have platform dev questions about searchable fields but have come across conflicting answers. Basically I just want to understand is Phone field type ...
1
vote
1answer
25 views

Not sure what to do next with JSON2Apex generated output

I'm not sure what to do next with my JSON2Apex generated output since I only need to see the values for three JSON keys. My generated output is approximately 300 lines long and below is a snippet of ...
1
vote
1answer
28 views

how to clone a Profile programmatically?

How can I clone a salesforce Profile? I'd prefer to use Apex or DX/CLI. Our normal process for setting up an Org is to clone standard profiles, and then customize those clones. This probably ...
0
votes
1answer
25 views

Invalid conversion from runtime type String to Map<String,ANY> not working

I have a requirement to call a external service with post method. When i tested in anymonous block.It's working fine. But when i try to set up test classes i got this error. in line Map results ...
1
vote
1answer
25 views

Posting a JSON to REST resource in Salesforce

Before I go ahead and describe my issue, I have looked at a resolution as described below and does not seem to help in my case. is that possible to pass(POST) below JSON to REST endpoint? So, I have ...
0
votes
0answers
10 views

How do I deploy salesforce Apex code programmatically using metadataAPI?

I am developing an application that is supposed to connect with clients' salesforce accounts and deploy some apex code to them. I am doing this in Groovy - but Java works same. After looking at the ...
0
votes
1answer
30 views

Authorization using certificates

I want to know the process of authorization or authentication using self-signed certificates. I am trying to integrate two salesforce dev orgs using REST callouts. I have created a self-signed ...
0
votes
1answer
17 views

Conversion of a list to map with key as Account and map as account's corresponding contacts from a list of accounts

I have a list accountList which contains corresponding contacts aswell. Now I am trying to make a map from that list with key as single account and corresponding associated contacts as value. public ...
1
vote
1answer
25 views

get SObject field name using the field label? [duplicate]

When I google I find a lot of answers on how to get field label using field name. For example: SObjectType type = Schema.getGlobalDescribe().get('Account'); Map<String,Schema.SObjectField> ...
3
votes
1answer
24 views

recalculateFormulas() throws an unexpectedException. Unable to create/update fields

I have a function in Apex that sets a few fields on my custom object and that also calls the recalculateFormulas() function on the object. I call my function from Salesforce through a custom button. ...
0
votes
0answers
20 views

when selecting a field from dropdown, on the next page i need to give value to that field and update that value in opportunity records

public with sharing class updateoppclass2 { public updateoppclass2(ApexPages.Standardcontroller controller){ } public PageReference gotopage1(){ PageReference pref2=New ...
-1
votes
0answers
17 views

Not able to authenticate aws from apex in salesforce

Continuing from my old thread https://salesforce.stackexchange.com/a/228572/59004 Thanks for pointing out the mistakes ,I corrected some after going through the AWS doc as suggested by you however I ...
0
votes
1answer
13 views

Javascript remote object skipping a decimal when this is 0

I am using remote object to bring some values into a VF page, basically the user as it types it calculates and update the opportunity, so the remote is "constantly" updating the page. Then I have a ...
1
vote
2answers
31 views

Visualforce page can't find my method?

Firstly, let me apologize in advance for my extreme naivete' in this matter. I'm quite new to VF and could not find documentation to cover what should be an incredibly simply issue. I have a quick ...
0
votes
1answer
20 views

Unable to create Auto EventRelation record via trigger

I am trying to create an EventRelation record on insert of an Event. Basically I am trying to add WhoID of Event into invitees automatically. Am I missing anything. I am not getting any error also. ...
-1
votes
1answer
26 views

How to get push notification in salesforce1 when a record is created?

We want a mobile push up notification when a record is created in custom objects ? Is it possible ? If yes, how can we do that ? I have checked Push notification in Salesforce1 But this answer ...
-3
votes
1answer
23 views

Test class coverage help when using if statement

I am having trouble testing each condition of the do_init method in the test class and I am thinking I have some sort of scoping mind block. How can I write the test class to test each condition? I ...
0
votes
0answers
15 views

First error: ContentPublication Limit exceeded [duplicate]

I am receiving the above error upon executing anonymous code of a test class. All I am executing is database insert of 200 records each time (total 14000 records). The primary aim is to insert all the ...
0
votes
0answers
48 views

String Extraction

This is probably an easy one but for the life of me I can't seem to find the right syntax to get this to compile and return what I actually want. List<User> lstUsers = New List<User>()...
-1
votes
0answers
26 views

Display & update picklist values in custom object

I've a custom object which has a picklist field. I've one visualforce page which shows values from this custom object picklist field to visualforce pagepicklist field. When user first time opens the ...
0
votes
1answer
28 views

how to create opportunity in related list of contact from anonymous window

I want to create a chain record like contact is related list of account and opportunity is related list of that contact which is connect to account(same account). i am able to insert them ...
0
votes
0answers
26 views

Attempt to de-reference a null object on dynamic binding visualforce Component

Here I am trying to get related object and their fields dynamically.In debug I am getting related objects and fields but error is while loading VF page.Here is my code: Apex Class: public class ...
0
votes
1answer
18 views

How to identify, which class is associated with which custom/standard object in salesforce? [on hold]

Can you guys tell me how to find which class is associated with which object in Salesforce?
0
votes
1answer
34 views

Re-render issue (JS wipes off and also doesn't display data from controller)

I have a vf page where i'm fetching data from controller. I face issue when i click on a button and the panel get refreshed. After refresh i sometime get's the data on vf page from controller and ...
1
vote
1answer
36 views

How to bulkify this Apex code?

I wrote the following code, but I know that it is not properly bulkified. I have tried to bulkify it, but facing some issues. Please guide me on how to bulkify this code, so that I can use it as ...
0
votes
1answer
30 views

Hide apex:column with IF condition

I want to hide the headerValue of Billing Account column, IF Entitas_X__c == 'Pusat'.. I tried using render inside the apex:column tag but nothing happen.. <apex:column headerValue="Billing ...