Tagged Questions

A proprietary Java-like programming language for the Force.com Platform.

learn more… | top users | synonyms

0
votes
0answers
7 views

Comparing old and new values of user license

How do I compare the old and new values of user license in a trigger? When we change user licenses salesforce strips all the PS assignments. I want to see copy over the permission sets when the ...
1
vote
1answer
23 views

Display limited repeat values in one pdf page

Is there any way of limiting the displayed repeat values in one page? Ex: Display first two values in first page, next two values in the next page etc ? I tried to find a way of doing this but I ...
0
votes
1answer
25 views

Opportunity.IsWon isn't won in test context

I have a code in an Opportunity trigger that makes some updates when the Opportunity is won: if (opp.RecordTypeId == recordTypeId && opp.IsWon) { //do stuff... which works fine ...
4
votes
1answer
24 views

Tooling API - ProfileMetadata not being returned v32

I am attempting to use the Tooling API to retrieve all the data for a particular profile. According to the Tooling API documentation from v32 there is a Profile object which contains a set of ...
0
votes
0answers
7 views

How to update your survey data to a existing record in your SalesforceCRM clickTools

How to update your survey data to a existing record in your CRM clickTools. Ex: I have to update a contact object existing record by using survey (Clicktools) . i have created a field on contact ...
0
votes
2answers
22 views

Accessing a map with dynamic key (a javascript string valiable )

I am in a situation where i have a map in my Apex code and i want to access its data with a key that i am passing through my javascript function. I tried with a couple of things that include directly ...
0
votes
0answers
14 views

Unable to locate Runnig workflow on Case

When i am editing a Case Contact from community portal and changing the value in Contact of that Case, it changes to previous entered value and is not updated. But when i checked the Field history ...
1
vote
0answers
8 views

Decrypt AES256 data that is encrpted in Java

I have AES256 , base64 encrypted data: ...
2
votes
3answers
109 views

Replacement for System.out.println() log statement - Please don't say “Debug Logs”

In java it's easy to throw in a Sytem.out.println() and get some helpful info on the console. The closest I have come to that on Force.com is system.debug(); and then plowing through pages of Debug ...
0
votes
0answers
17 views

Running script in Execute anonymous in developer console gives execution failed error

I am using the execute anonymous window in developer console to execute a particular script in customer environment. The script is correct and is working in our local packaged environment but every ...
0
votes
0answers
19 views

workflow fires without meeting criteria

i have a workflow and it fires only when custom_field__c is not null. an ETL job runs periodically, then this custom_field__c is updating, then the workflow rule fires, i get a email. Surprisingly, ...
1
vote
1answer
41 views

How can I hide & show Lookup in Visualforce Page?

I have two fields. Lookup Preferences Based on my Preferences I want my lookup to be visible and hidden. I am using jquery j$(".class-name").hide() to hide the lookup and ...
1
vote
1answer
24 views

Trigger to change Contact on Case after update

Scenario: When a new Case is created with a specific recordtype I want to change the Case Contact to a default Account Contact instead of the Contact initially set when case is created. (These cases ...
1
vote
0answers
46 views

Record Name not created when creating visualforce page

I have a custom button on a child . This button allows the user to create a new child object in visualforce from the related list on the parent. However, the child's related list are not showing. I ...
0
votes
0answers
37 views

Javascript button issue not updating the checkbox

This update is not happening: sforce.connection.update([quot]); I want show alert message for one profile when date is not equal to today . but update has to happen every time. Thanks in advance ...
3
votes
1answer
55 views

How do we convert a Lead into person accounts in apex?

How can i convert a lead to person accounts using apex? I have done lead conversion which would convert a lead to standard account, contact and opportunity by mostly referring ...
4
votes
1answer
57 views

How can I “close” a Task from the REST API/Apex

Since all picklist values for the Status field on Tasks are configurable I don't think I can simply set the Status to "Completed" as that picklist value could have been deleted/renamed. I tried ...
3
votes
2answers
50 views

Database.SaveResult.getId() returns null

I'm trying to update an account list and I need to get the Ids when the update fails. I use the getId() method but for accounts which fail I get null. It's an update so my account already has an Id. ...
0
votes
1answer
11 views

Does anyone know how can we show Reports via Analytics API in Visualforce with direct linsk to records like in standard report?

I'm trying to show a report in a visualforce page, with some custom filtering. The hurdle that I'm facing is, the report data comes in as static text. I would like to have a link for Lookup fields ...
0
votes
1answer
19 views

Facing a query exception(System.QueryException: unexpected token: LIKE)?

String accountQuery = 'SELECT Name, Phone, Website, BillingState FROM Account '; if(searchString != '' && searchString != null) { accountQuery += 'WHERE Name LIKE \'%' + searchString + ...
0
votes
1answer
14 views

How can I store complex form in cache memory or local server

I have a requirement to store data some where other than the database. My form contains 3 Object records. Basically in constructor first record is displaying I am entering data into that after that I ...
1
vote
1answer
19 views

How to de-duplicate recored in customized object?

I have 250K disordered and duplicated records in a customized object. After i search salesforce help document, i found that merge() function looks like not support customized object. But, if i use ...
1
vote
2answers
20 views

Email Services Binary Attachment Not Working

I am using the Email Services in SFDC, and I am not able to get the attachments I attach to the emails to be uploaded to the new record that is being created. I built my APEX class off of the sample ...
3
votes
1answer
15 views

how to schedule job with start and end?

I want to schedule a apex classes through apex code and need to have a cron expression with a fix startdate & enddate. It needs to be also possible to set the startdate & enddate like below: ...
3
votes
1answer
17 views

Programmatically retrieve list of sandbox IDs linked to a production org

Is there any way to programmatically get a list of sandboxes linked to a production org? I'd also like to do the reverse: get the ID of the production org corresponding to a sandbox -- but from the ...
0
votes
2answers
23 views

GetChildRelationships not finding contact lookups for custom object

I have a custom object with many custom fields. Some of these fields are lookups to contacts. I have a visualforce page on which I need to list all contact fields for this custom object. I am using ...
1
vote
0answers
12 views

Salesforce1 New Event Publisher Action

I have overridden Event new button in salesforce but when I am opening new event action from Salesforce1, its taking me to standard page. I have enabled page for mobile appication too. Please advice.
1
vote
2answers
9 views

Error when using an OR within an IF statement with 'contains' method

Getting an error with the following code snippet of "Save error: expecting a right parentheses, found 'OR'" . It works if I use only the first contains, but then errors when I add the OR and second ...
1
vote
1answer
24 views

Querying from Multiple Objects

I've to Query a field(e.g X) from one object. Say I'm getting 20 records(LIST) Now, I've to Query another object using result of above Query using field X (X field is common to both objects but has ...
3
votes
2answers
87 views

Check whether any field has change in Trigger

I know how to compare fields before/after a trigger. But how can I know whether any field has changed or not (or that a user has 'edited' an object without actually editing anything). It seems a bit ...
0
votes
0answers
36 views

How can I get apex class parent through API?

Is there any way to get parent class ( I mean inheritance, not interface) of an apex class using any API in java? And the same question about class modifiers (like public abstract) - is there any ...
1
vote
2answers
64 views

How do I test an apex trigger that sends an email

Trigger is: trigger emailtemplate on opportunity(after update) { List<opportunity> oList = Trigger.new; List<opportunity> nList = trigger.old; ...
1
vote
2answers
33 views

Can any one correct this one why batch apex is not deleting records?

Here is my batch apex .it is not deleting records global class BatchProcessorder implements Database.Batchable<sObject>{ String query; DateTime lastTwoDays = ...
0
votes
0answers
7 views

Accessing Profile's Administrative Permissions in Apex class

I wanted to access the administrative permissions in the apex controller for e.g. want to check that the "Create and Customize List Views" checkbox is enabled or not. It required in my project to ...
0
votes
1answer
11 views

How to save the value of a form in custom object of salesforce

my apexpage and controller is <apex:page Controller="test_validation"> <apex:form > <apex:pageBlock > <apex:pageblockButtons> ...
1
vote
3answers
31 views

Field level security and API access

Could someone please explain how both of the following two statements are correct: A field hidden by field level security is not visible through the API. A user has not been granted field-level ...
11
votes
2answers
51 views

Test.loadData() - undocumented behavior

Premise I want to load Accounts and their related Contacts using Test.loadData() and StaticResources. How do I do this given that the Contact records must have the ID of their parent Account yet the ...
4
votes
3answers
78 views

Problems parsing JSON in APEX

I am calling a REST endpoint (of another Salesforce instance) and I am getting the following response: [{ "attributes": { "type": "Job__c", "url": ...
4
votes
2answers
36 views

How to generate a random string value based on regex pattern

I'm trying to build a random external ID generator that can take a complex pattern described in RegEx and generate any number of unique strings for unit tests. Ideally something like Xeger which ...
3
votes
2answers
115 views

Check for a picklist value using SOQL

I have the following SOQL and I only need values from Risk__Actions__r WHERE Risk__Status__c(Picklist) equals to 'Open'. But current way i'm doing displays an error. no viable alternative at ...
0
votes
0answers
20 views

How to get the feeds of followed user in Visualforce page

Can anyone tell me how to get the feeds of followed user in vIsualforce page? My code is: <apex:page controller="VFC06_ChatterFollow" standardStylesheets="true" showHeader="false"> ...
1
vote
1answer
33 views

Get Minimum Date from records fitting Specific where clause

Trying to get field with the earliest date from custom object. Here is my current query BomaGroups = [SELECT Name, Location__c FROM Group__c WHERE Location__c =:id]; // Selects the Group I want ...
0
votes
2answers
34 views

How to match the the two string or alphanumeric values in apex?

I have a query regarding the matching of two alphanumeric values. Suppose like i have a first alphanumeric value say 185,Bakers Street,London and the same second one like 185BakersStreetLondon ...
1
vote
2answers
24 views

Image processing in apex salesforce

Is there any way by which apex allows us to process an image, By processing I mean can I read the content of the image if text is available on image using apex .
1
vote
2answers
32 views

Problem with Database.update()

I have some accounts to update but some validation rules can failed. So to avoid this I use the Database.update() function to update accounts even if some DML exception occur. try { ...
0
votes
0answers
16 views

How to use Salesforce PDF Viewer for custom object similar to quote pdf (including save and send email button)?

Need to use custom vf pdf and display that in custom object in salesforce pdf viewer similar to standard quote pdf
0
votes
2answers
42 views

what does this statics means in Trigger?

Hi currently i'm support a former SF developer in my company. I am pretty new in SF and I found that some of the trigger has this statement from my former SF developer :--> statics.runAppProdTrigger ...
1
vote
1answer
16 views

System.LimitException: Apex CPU time limit exceeded error in web service

I have a webservice exposed in SFDC. SFDC will receive account records from external system. Based on the accounts received, its parent and child will be updated. It works fine. However when 1000 or ...
4
votes
3answers
97 views

Date reminder using apex

I want send a reminder to a contact owner for birthday reminder based on the birthday field in the contact object. If the birthday falls on week day notification has to be sent on the same else if on ...
0
votes
0answers
14 views

Batch apex error “Apex CPU Time limit exceeded error” [duplicate]

I have created batch apex class to insert records into salesforce but i got an error i.e."CPU time limit exceeded error" Please help me to solve this error. global virtual class InsertProductData ...