Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 4368

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.

5 votes

Fetch Record Type Id based on Developer Name without SOQL?

update - it will be possible from Summer'18 https://releasenotes.docs.salesforce.com/en-us/summer18/release-notes/rn_apex_developer_name.htm
user682217's user avatar
  • 1,171
3 votes
3 answers
2k views

trigger design pattern

I was watching some videos on apex best practises and I spotted some discrepancies in advice people give. I wonder how you people code your triggers. …
user682217's user avatar
  • 1,171
3 votes
1 answer
111 views

request parameters contain org address

(target page uses opportunity standard controller) In the url I specify apex page and a parameter ...?retUrl={! … Typically when I append parameters in apex I get only the value I provided. Is what I observed documented anywhere? I would gladly read more on the subject. …
user682217's user avatar
  • 1,171
2 votes
1 answer
261 views

Apex Business Hours calculation glitch

I'm using the standard apex method BusinessHours.add() to calculate future dates and looks like I'm hitting a magic number. Everything works fine if I add less than 60 days to the current date. …
user682217's user avatar
  • 1,171
1 vote

How to get subtopic related to Community topic in apex?

The children become visible when you provide the depth parameter Integer depth =2; ConnectApi.ManagedTopicCollection topics = ConnectApi.ManagedTopics.getManagedTopics(communityId,ConnectApi.ManagedTo …
user682217's user avatar
  • 1,171
4 votes
2 answers
3k views

checking FLS in triggers

I've seen loads of code examples of triggers and helper classes. They never check for object or field level permissions. I wonder if this was done for code clarity or is this something one does onl …
user682217's user avatar
  • 1,171
5 votes
2 answers
1k views

Does one use savepoints in triggers?

One doesn’t get enough of best worst/practice examples with Apex. Maybe this will help other people. I’ve never seen Database.operations() in triggers. And I’ve read a few books by famous names. …
user682217's user avatar
  • 1,171
0 votes
1 answer
4k views

After delete trigger SOQL returns no rows

I need help I'm losing my mid. I have a working trigger and I'm writing a test class. My data is isolated ( no @seeAllData=true) I create a master and children objects in my set up. I insert the …
user682217's user avatar
  • 1,171
1 vote
0 answers
366 views

default picklist values magick

I have a strange one. Org has an object Test_Object__c with a picklist field Status__c and record types. Default value is set on each record type and profiles are configured to default record type xTy …
user682217's user avatar
  • 1,171
4 votes
1 answer
996 views

visualforce and inheritance

I have a parent controller class with a string variable called source and two classes, Display and Basket, that inherit from it. Basket is used by a component embedded in the display page. On the disp …
user682217's user avatar
  • 1,171
2 votes
1 answer
321 views

InvocableMethod read only

I'm writing my first plugin for use with process builder. I read the docs, I've seen a few code examples and I don't see what I'm doing wrong. The flow is defined on update of my custom SObject. I ne …
user682217's user avatar
  • 1,171
0 votes
1 answer
209 views

CalloutException: you have uncommitted work pending - without DML? [duplicate]

6000000 Number of callouts: 0 out of 100 Number of Email Invocations: 0 out of 10 Number of future calls: 0 out of 50 Number of queueable jobs added to the queue: 0 out of 50 Number of Mobile Apex … 6000000 Number of callouts: 0 out of 100 Number of Email Invocations: 0 out of 10 Number of future calls: 0 out of 50 Number of queueable jobs added to the queue: 1 out of 50 Number of Mobile Apex
user682217's user avatar
  • 1,171
6 votes
1 answer
4k views

Tabular report data via analytics API

I was wondering if I could run my tabular report via API and create a csv file by traversing the result. I had a look at the examples and wrote a piece of code but.... Unfortunately I have no idea how …
user682217's user avatar
  • 1,171
1 vote
1 answer
1k views

Business Hours difference calculation during BST

Hello I need help understanding how business hours difference is calculated with the Apex class. The documentation is rather poor and doesn't explain the input parameters assumptions. …
user682217's user avatar
  • 1,171
1 vote
1 answer
1k views

How to download a file with remote action

I need to create a csv file based on passed parameters. I want to call my function from angular service using controller's remoteAction. How can I make the browser save the string output as a file?
user682217's user avatar
  • 1,171