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 10254

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
Accepted

What is the (API name) Edit Date field in Leadhistory Report

The "Edit Date" you're mentioning actually is the CreatedDate field on the Lead History object. On reports this appears as "Edit Date" because the history is created upon lead edition. In my opinion …
Péqueño's user avatar
  • 321
2 votes

Test Class for Trigger not providing full coverage

First things first, you should NEVER (like really) call DML operations in a for loop. This can hit the governors limits on your org provoke errors. Update your trigger code to this: trigger deleted …
Péqueño's user avatar
  • 321
2 votes
Accepted

Using Metadata API to query

Try executing the following query: Select MasterLabel, QualifiedApiName, KeyPrefix, DurableId From EntityDefinition Where IsCustomizable = true And QualifiedApiName Like '%_mdt' This will retrie …
Péqueño's user avatar
  • 321
2 votes

Wrapping a Visualforce page / delaying page load

public PageReference redirect() { // Construct a redirection url String redirectUrl = ''; // Make your checks if(oOpportunity.Amount < 100) { redirectUrl = '/apex … id=' + oOpportunity.Id; }else { redirectUrl = /apex/oppOverride? …
Péqueño's user avatar
  • 321
1 vote

How to create a condition for apex:inputField value field which gets a boolean expression fr...

I would tend to say that you need to set the inputfield value to your custom field "Case.Reason__c", this way it can also be updated manually as you have set it to required. Then in your constructor …
Péqueño's user avatar
  • 321
0 votes

how to avoid null values in sobject

I don't know of your field type (text/integer/other ?) but you should give a try to this: String pdfContent = ''; for(Invention_Disclosure_New__c inv : idfs) { String invVal = String.valueOf(i …
Péqueño's user avatar
  • 321
1 vote

how to cover code for catch block?

Looking at your code, it is quite simple to provoke the exception there, just create another Contact with the same email address in your test data, this will throw a query exception since you're casti …
Péqueño's user avatar
  • 321
0 votes
1 answer
2k views

How to create or clone reports in Apex

I thought about creating reports from apex, it would be great to use a "template" report, and creatin a new one from it with record-specific parameters, still I couldn't manage to find any good documentation … The Salesforce Reports and Dashboards API via Apex documentation only provides information on how to retrieve reports data, but not if it is possible to create some using apex. …
Péqueño's user avatar
  • 321
0 votes
Accepted

How to create or clone reports in Apex

Actually managed to clone reports and dashboards using Apex and the Metadata Api provided by Andrew Fawcett on Github. …
Péqueño's user avatar
  • 321
0 votes

Modify dependent inputField style

Figured out how to do it, still I think that it's not the best way to do it but it works and since the inputFields are rendered as select picklists in html and they all need the same style I added the …
Péqueño's user avatar
  • 321