apex-code Questions

3

Solved

Is there a way to determine if a trigger is being executed by an API call or through the Salesforce Web Interface? I'd like to do something like this: trigger Update_Last_Modified_By_API on My_Ob...
Lumenhour asked 19/9, 2012 at 13:34

2

Solved

I am trying to generate clean XSL-FO from a VisualForce page. But the xml coming out of the VisualForce page is not valid due to the empty span tags that are being generated by nested apex:outputPa...
Reliquiae asked 15/5, 2012 at 5:17

7

Solved

How do I make a SOQL query like this? SELECT id FROM Account WHERE LastActivityDate = 30_DAYS_AGO This produces an error: MALFORMED_QUERY: Account WHERE LastActivityDate = 30_DAYS_AGO ^
Gilstrap asked 8/3, 2011 at 22:9

4

Solved

I know that this is how to save a record <apex:commandButton action="{!save}" value="Save"/> I want a button to NOT save the current record (ie. Cancel) and navigate to the list of saved r...
Mcgrew asked 19/1, 2012 at 5:25

2

Solved

I was wondering if there is an apex date or datetime function to format a date/time to the ISO formatted timestamp "2007-04-05T12:30-02:00" or would this have to be created by another means? Thank...
Corbel asked 31/8, 2013 at 17:10

2

Solved

When using the SOAP API to work with salesforce.com (SFDC) it seems that the primary key in the underlying database is Id. Well there seems to be two representations of this value as either a 15 ch...
Shriek asked 9/7, 2010 at 14:17

3

Solved

I want to use Enum values in my Apex code as we have some strict types when working with an external service, however when I get a response from the external service I'm struggling to convert the S...
Ellis asked 23/3, 2012 at 11:41

2

Is it possible to Cast SObject dynamically? Example : I know we can do this : (Account) Sobject But I want to do this as the return type of sObject changes based on certain parameters. (Dyna...
January asked 10/9, 2014 at 9:2

6

According to a requirement, i have to change the owner of an account if the user does not have read access to a third object. I need a functionality similar to the isAccessible() method of Describ...
Dehumidify asked 9/5, 2012 at 8:32

3

Solved

I'm trying do develop a visualforce custom component which is an entity chooser. This custom component displays a UI which helps browsing some records. It's possible to select one record, and I'd l...
Muezzin asked 23/5, 2011 at 21:37

5

Solved

Sometimes in Salesforce tests you need to create User objects to run part of the test as a speciifc type of user. However since the Salesforce Summer 08 update, attempts to create both User objec...
Clive asked 5/3, 2010 at 14:39

7

Solved

I would like to know the class of a variable/property at runtime. For example: Integer i = 5; //pseudo-code if (i.className == 'Integer') { System.debug('This is an integer.'); } else { System....
Emie asked 3/3, 2012 at 16:11

2

Using Apex, I want to split a string and then rejoin it with the 'AND' operator as the separator. I split the string successfully but having an issue in rejoining it. String [] ideaSearchText =...
Mott asked 27/2, 2012 at 12:46

1

The trigger below is built to pull the most recent "assigned to" user (or OriginalActorId) from the approval process list, the Approval_started__c field is checked as an initial submission action f...
Indigence asked 14/7, 2018 at 23:10

3

Solved

Is there a way to detect that a record being inserted is the result of a clone operation in a trigger? As part of a managed package, I'd like to clear out some of the custom fields when Opportunit...
Thyroid asked 29/7, 2012 at 6:57

8

From a visualforce page, I need to retrieve our organization's salesforce instance's URL, and not the visual force URL. For example I need https://cs1.salesforce.com instead of https://c.cs1.visua...
Woodall asked 20/2, 2012 at 22:52

5

Solved

Apparently a new feature of the Spring '12 / v24.0 release of Apex in Salesforce.com is that unit tests no longer have access to 'real' data -- thus (if I'm understanding the change correctly) a SO...
Euphroe asked 6/2, 2012 at 18:11

2

Solved

I'm interacting with a custom APEX service which obviously require OAuth authentication. I can easily authenticate and authorise my application. Everything works fine. However, the access token I...
Keefe asked 13/6, 2012 at 22:42

4

Solved

I have added few custom validations using Configuration for an object. I am inserting that object record through visualforce page. I have added <apex:pageMessages/> on my visualforce page. I ...
Polyzoarium asked 23/7, 2012 at 5:41

3

Solved

I have a map object which stores <Id, String> where the Id is a contact Id, and the String is a generated email message. I have successfully looped through the map and have been able to pull...
Betake asked 1/10, 2012 at 21:43

4

Solved

I have a custom field called Current_Address__c which is of datatype textarea. I need to populate this field in the format below. ie a newline char after street and another newline after zip. str...
Langan asked 10/4, 2012 at 5:22

10

Solved

I am integrating our back end systems with Salesforce using the web services. I have production and stage environments running on different URLs. I need to be able to have the endpoint of the web s...
Worldling asked 2/10, 2009 at 4:20

2

I would really appreciate if someone can guide me to check if a particular field is included in update call inside a before/after update trigger. Many thanks.
Mandola asked 5/4, 2011 at 7:30

2

Solved

I am trying to schedule a class to run every 15 minutes. I know we can set in salesforce for every hour, but is there a way to reduce the granularity to 10-15 minutes? global class scheduledMerge ...
Nicks asked 3/2, 2012 at 10:9

3

Solved

i am trying to run a schedulable job i never used schedulable jobs in salesforce here is my code global class scheduledMerge implements Schedulable{ global void execute(SchedulableContext SC) { ...
Retard asked 17/2, 2013 at 12:47

© 2022 - 2024 — McMap. All rights reserved.