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

learn more… | top users | synonyms

3
votes
1answer
31 views

How can that code ever produce a NullReference in the last line?

I am getting a System.NullPointerException: Attempt to de-reference a null object in the last line (the one with the return) of the following code. ... AggregateResult result = getResult(...); ...
3
votes
2answers
42 views

Email not sent from within catch or finally when exception is rethrown. Why?

As I am otherwise unable to debug a long running batch process in a customer org (logs are lost when I am not logged in all the time via subscriber support) of our managed ISV package, I tried to send ...
2
votes
0answers
44 views

System.LimitException: Too many code statements: 200001

Below is my code. companyList = [ Select a.Id,a.Name, a.Phone, a.Website, etc... From Account a Where a.RecordType.Name = 'Blah' ]; String csvString = ''; ...
0
votes
1answer
24 views

Scheduled Batch Apex Hangs in Queued Status

This is my first crack at a scheduled batch Apex class. Copied the code from the manual but missing something. When I run class MassDeleteSchedules in Anonymous block, it works fine. But when I use ...
1
vote
1answer
15 views

Variable Name field

I have le following fields: Gigabytes_tier_1__c Gigabytes_tier_2__c Gigabytes_tier_3__c Gigabytes_tier_4__c I would like write like this: for (Integer i=1;i<5; i++) { ...
1
vote
1answer
28 views

Error: The Connect API is not enabled for this user type

I am working on creating a Force.com site and I have a VF page which displays fields from a custom object record and also displays its Chatter feed. I achieved displaying the Chatter feed using the ...
3
votes
1answer
22 views

Get Name from a lookup table (ID)

I'm not sure if this is allowed but I wanted to clarify something. I have a lookup table field. For the sake of an example, let's call it AccountId. I want the specific name from a specific AccountId. ...
1
vote
1answer
39 views

Are batch jobs guaranteed to run sequentially?

I encounter an UNABLE_TO_LOCK_ROW error in a batch job where I do an upsert on a custom object. The problem is that I am not able to guarantee that a particular record is only upserted in one single ...
2
votes
1answer
50 views

Solve: System.ListException: List index out of bounds: 0

i'm getting the following exception from my code: caused by: System.ListException: List index out of bounds: 0 Class.tempsection4.getconvalues: line 38, column 1 My controller for the VF page is: ...
3
votes
1answer
22 views

Force.com Ide (Eclipse) shortcuts for right click submenu

Is it possible to add shortcut key for the commands like 'Refresh from Server' as shown below (in Eclipse aka force.com IDE)? Note: I tried going to Preferences => General => Keys .. doesn't work.
1
vote
2answers
18 views

associating event with lead(Activity history)…?

I am inserting events and inserting multiple invitees(Lead/Contacts) to event using EventRelation. EventRealtion er = new EventRelation(EventId = '00UD0000005zijH', RelationId = '003D000000Q8adV'); ...
1
vote
1answer
29 views

Dynamic Tab visibility

Is it possible to hide a custom objects' tab dynamically for a user? Also does hiding a tab means visibility to custom object is gone?If not do we need to update the sharing rules as well My deciding ...
1
vote
1answer
19 views

Getting an initial term of field expression must be a concrete SObject error:

I'm getting the following error: Save error: Initial term of field expression must be a concrete SObject: LIST Force.com save problem Here are the snippets of code in question: List ...
1
vote
1answer
19 views

Set Product for new opportunity lineitem

in a trigger i'am going to create a new opportunitylineitem for an opportunity: OpportunityLineItem newOpptLineItem = new OpportunityLineItem(); ...
0
votes
2answers
21 views

New Tab for PageReference

I want to open my Vf page on new tab please guide me what i need to do to get the process done my code : public PageReference totalbookedClick(){ date myDate = date.today(); integer ...
0
votes
2answers
44 views

Visualforce Error System.TypeException: Invalid decimal:

I have written Apex code and VF page for uploading records for my custom object. While uploading the CSV file into system via programatically I am getting the error "Visualforce Error System.Type ...
0
votes
1answer
27 views

how to cross the SOSl query Limit

I have a class with SOQL and SOSL query. the SOQL query fetches List of unique emails from an object.The emails in the List are then passed to the SOSl query. the Problem is the List has more than 20 ...
1
vote
1answer
36 views

Bind the picklist with other objects

I am showing one pick-list of a custom object on one VF page now I want to bind this Picklist on the other Custom object means, On the selection of picklist record all the fields of another object ...
-2
votes
0answers
18 views

Need Columns to use picklist values as headers and show flitered (picklist value) in each column

What I need is for each picklist value from Account_Management_Type__c to be a column and for the Overall_Status__c for each type of Account Management Type to show up under the correct header. I have ...
2
votes
1answer
40 views

Javascript alert on button click

I want to prevent users from being redirected when they click a button and picklist value is false. I have a custom button on Opportunity related list on account. If the value of Account type is ...
0
votes
1answer
20 views

Invalid Foreign Key Relationship

I have the following snippet of code: List<ID> AccountIDx = new List<ID>(); List<ID> ContactIDx = new List<ID>(); List<ID> OppIDx = new List<ID>(); ...
0
votes
1answer
17 views

When in Managed Package config/development is the namespace absolutely required?

I'm working to develop a process for developing managed code in an unmanaged environment, and I'm unable to find a comprehensive list of places where adding the namespace in config/code is absolutely ...
0
votes
1answer
10 views

Using site.getName() with custom settings method getInstance()

I have two identical statements that I am running in execute anon and I am getting different results based on the which org I am running it against. In my packaging org if I run the code below, I get ...
1
vote
1answer
24 views

Link to download Chatter file download in VF

I have attached a File to my custom object record. I want to display a link to the file on a VF page which also shows information about my custom object. I tried doing something like this. APEX: ...
0
votes
2answers
36 views

Why am I not getting the Record Type name when I use RecordType.Name

Shouldn't I be able to get the Record Type name with RecordType.Name ? In the following code I am able to get the ID by using RecordType.ID - but I get a null value in the string if I use ...
1
vote
1answer
21 views

Assigning set with a soql query

Does anyone know why below code returns me with only 1 record set<account> myset = new set<account>([select id from account limit 100]); system.debug('SETTT' + myset); But when i say ...
0
votes
2answers
19 views

External id specification in child object foreign key reference field

This is the reference for this code :http://bobbuzzard.blogspot.co.nz/2012/03/create-parent-and-child-records-in-one.html What exactly happens behind the scenes,when we say Account acc=new ...
1
vote
1answer
13 views

Selection of Second Look up on basis of First Loook up data

I have one Custom object "Client and other one is Facility", there is look up relation in this When I Save any Facility record Client is Mandatory. Now I am giving both these object records into third ...
1
vote
2answers
31 views

Insert list of children from parent object

Why is below code not possible Parent__c myparent = new parent__C(); myparent.child__r = new list<child__c>(); when i try to execute this,i am getting a compile error.,field is not writable. ...
0
votes
1answer
19 views

reference field Display

Below is my code to fetch parent account data and it works as well.But when i try to see the data in system.debug Account__r data wont get displayed.(although when i loop through list it does display) ...
3
votes
1answer
24 views

Error when I populate lookup with external id using .put method

You can populate lookup fields using an object with an external id field populated like so: Custom_Object__c o = new Custom_Object__c(Account__r=new Account(External_ID__c='123')); insert o; ...
3
votes
1answer
41 views

updating the data with new field impacting lastmodifiedby and salesforce internal error

I have the ContentVersion object, where I have a custom field called Year__c, which was initially set as text but I need to change it to a number field. but If I change it to number field, Salesforce ...
1
vote
1answer
52 views

Avoid SOQL 100 error by querying outside of the loop

I'm currently running a program which limits a query to 95 items in order to avoid the SOQL 100 queries error. THe relevant snippet of the program looks like this: while(x!=0){ ...
1
vote
1answer
23 views

How to access all the public groups relatedto an user in apex

I am trying to find out all the public groups related to an user and display it on a vf page. Is this doable? Step 1: from Groupmember I get the group Id related to a user using ...
0
votes
0answers
28 views

What is the best practice for creating unique compound primary keys in salesforce? [duplicate]

I have a custom object in salesforce where I want to enforce uniqueness across two lookup fields and a date field. I do not want to allow two records to have all three of those fields in common, but ...
3
votes
0answers
22 views

Also_Called_on Trigger

I am trying to write trigger for doing following updation on Call__c object Call__c is having M-D relationship with account. Account has fields ---------- co-owner field, call_by other_c ...
1
vote
0answers
24 views

I have provided a authorization is security for page

I am new in salesforce. I have created a page in my page i Have one form with standard controller. When I run that page I got this error -- Authorization Required You must first log in or register ...
1
vote
1answer
28 views

servlet logic with Apex

I want to implement for the below flow. I do post http request to the another end point url. that end point system will do http posting to the return url that I have specified for more information. ...
2
votes
1answer
31 views

get groups whithout activity the last 3 mounth and the user (Owner) SOQL

how we can get list of (group.Name , group.LastFeedModifiedDate, user.Name , User.Username Form User & CollaborationGroup where group.OwnerId = user.Id And group.LastFeedModifiedDate < ...
2
votes
3answers
43 views

Best way to prevent form to be submitted more than once

We have a multistep wizard form where we have a next button which is a command link. We would like to prevent the users from double clicking the button. We tried to disable the command link using ...
1
vote
1answer
30 views

How to copy standard Opportunity objects into a custom object?

I have a standard Opportunity object with the appropriate standard and custom fields. Now I have been asked to create a custom object that will have its respective standard and custom fields populated ...
2
votes
1answer
33 views

Contract / Warranty Creation from Asset

The code I am attempting to fix today revolves around Contracts and Customer Assets. The idea being that when a customers asset is generated or updated the account manager will check off "Support ...
4
votes
1answer
37 views

Multiple controller extensions communication

I have a Visualforce page with two controller extensions. Is there any way to get a reference to one of the extensions in the other one?
4
votes
2answers
63 views

Salesforce List constructor

I created a list of contacts Inserted into database Create a new list and passed the previous list as a constructor parameter. Now when i make any changes in my new list,it gets reflected in my ...
1
vote
1answer
42 views

http post for mulitpart form

am trying to post the csv data through http post to end point url. Below is my code. string test = 'test1,[email protected]'; // which will be get from DB and make as CSV string String ...
4
votes
2answers
42 views

Visualforce inputFile component allows selecting Multiple Files but doesn't upload all?

Does anyone know how to catch all Selected files from a visualforce page in its controller APEX class from: <apex:inputFile value="{!fileName}" /> The issue is, I've implemented a file upload ...
2
votes
1answer
54 views

Show Apex message at another page

I want to display the message at another page when user click a button. Such as the user clicks button at Page A, then my action method will redirect user to Page B and show the message which is ...
6
votes
2answers
69 views

Error while upserting Opportunity Team members

I am trying to create Opportunity Team Member using External id's for Opportunity and User. First of all I create an instance of Opportunity and User using their respective External Id's User ...
3
votes
1answer
34 views

Visualforce: Displaying from nested query

Hi I am new to Salesforce and am trying to learn my way through APEX. I am trying now to display some chatter information for a custom object record in Visualforce. This page will end up in a ...
5
votes
1answer
50 views

HttpCalloutMock Interface where there is more than 1 callout

Here is some background- I have an apex future method which is being called from an trigger. The future method then performs 3 different http calls to an external system (same endpoints). All requests ...

1 2 3 4 5 28