The apex-code tag has no wiki summary.
1
vote
2answers
23 views
using workflow rule to notify of contact changes
is there a way to create a workflow rule to send an email every time a contact's last name change or home address change? or would I need to create a trigger for this?
thanks in advance.
1
vote
1answer
16 views
Unable to upsert edited values
I have built a VF page with few checkboxes as columns. I'm able to inline edit, but cannot commit the changes to database. This is what I have tried so far...
public class UserController{
public ...
0
votes
0answers
14 views
standardsetcontroller fails if list view contains filter condition [on hold]
I am developing a mass edit functionality by using Standard Set Controller.It is working fine for few List View filter conditions but fails for some other list views.Please suggest me if you people ...
0
votes
1answer
23 views
Trigger not Updating Associated Record
The trigger below was created to update a custom check box field on the standard account object called "Billed" when a field called "Balance is 0.00 in zuora" is true. The issue is that field is not ...
2
votes
1answer
98 views
rendered= expressions and use of the ! operator
I have an apex element which relies on the output of two Boolean methods to be rendered.
At the moment, both methods are evaluating to true, yet the apex element is not rendering. If I reverse one of ...
1
vote
1answer
39 views
SOQL Parent child relating issue
I have to pass a child record's field value while iterating by Parent records. I am getting invalid Foreign key relationship error. Can someone please help me here?
Code snippet:
global class ...
0
votes
1answer
27 views
Query result optimization
I have a custom object Call2_vod__c which is detail of Account.There might be 100 calls for one Account.I need any one call record with that Account. How should I do the query?
Please find my piece of ...
1
vote
0answers
8 views
Proxy issue while calling dataloader from c# code
I am using a c# code to execute dataloader command in order to upload a csv to salesforce.
ProcessStartInfo dataLoaderProcessInfo = new ProcessStartInfo();
dataLoaderProcessInfo.FileName = ...
0
votes
2answers
73 views
Heap Storage Limit exception while creating attachment
I have a custom object Call2_vod__c which is detail to Account.
It has a Signature_vod__c field that is in encoded base64 format.
Now for one Account, I can create an attachment from any of the ...
0
votes
2answers
24 views
field value contained in list
I have an apex class where I need to check if a field value of a particular record is contained in a pre-defined list. Please find my code here.Can someone please help?
Apex class:
global class ...
1
vote
1answer
31 views
Advice on writing basic Apex Unit Test
The purpose of the controller below is to return the value of the one__c field on the Acc_Plan__c object, and then pass it into the getIsOneTrue() method.
The controller works fine, but I have to ...
1
vote
3answers
69 views
Pass result of SOQL query into a variable
I have the following query:
public List<My_Main_Object__c> data;
data = [Select My_Object__r.Id FROM My_Main_Object__c where id=:XXXX];
How can I pass the result of this query into a ...
0
votes
1answer
19 views
Hitting Soql Governor Limit in my method
I've to test my sharing code. In my test classs I have to test if user1 creates record then it is visible to all user(400)..for that I have to get all manager id(399 user) based on user1 id...
...
1
vote
1answer
19 views
Call variable from extension with JavaScript
This is my controller:
public with sharing class MyController {
public myObject__c myObj {get; set;}
public String myObjectId;
public Boolean one;
public Boolean two;
public ...
-3
votes
0answers
23 views
Test code Failure
Can anyone tell me what is the problem in my test class??
Apex Trigger:
trigger Test_Share on Test__c (after insert) {
Id UserId=UserInfo.getUserId();
Boolean bln=false;
...
2
votes
3answers
172 views
How do I assign the returned query values to each Boolean?
If I have the following variables and query, how can assign the values of each field to their corresponding boolean?
The fields are Checkboxes on the 'myObj' object.
public with sharing class MyClass ...
0
votes
3answers
39 views
Getting All Manager Id
Can anyone tell me how to get the Id of all managers based on the user Id?
user-->manager1-->manager2-->manager3--->manager4
I wanna get all manager id
My code is:
public static List<Id> ...
0
votes
1answer
33 views
Apex error: Initial term of field expression must be a concrete SObject
I have to update bulk records by apex class which is called from an apex trigger. Please find my class and trigger below.
Batch class:
global class UpdateAccountArea implements ...
1
vote
1answer
26 views
Display List values in apex page
I have apex class below having my_list as a List. I need to display in apex page.
Apex class:
global with sharing class poistionController {
List<HCP_Depth_Tracker_OAPI__c> my_list = new ...
-1
votes
1answer
35 views
multiple Standardcontroller
I have to use VF page of a custom object in Account page layouts.Please find my apex class as below.
Apex class:
global with sharing class poistionController {
public HCP_Depth_Tracker_OAPI__c ...
1
vote
2answers
46 views
How to get the values of a button dynamically
My main motto is to get the respective button name,status with toggle property(if i clicked the same 2nd time,the seat name must be removed from the list and status value must be changed) from the ...
0
votes
0answers
23 views
Notification on chatter feed
Below is the question on the chatter feed on the case object .. Anyone can you help me on this ..
Custom field on Case 'Public Chatter Posts' Number(18,0)
Custom field on Case 'Unread Public Chatter ...
0
votes
1answer
30 views
How do I write a test class for the below trigger? [closed]
I have just created the below trigger that is deigned to create a new custom object record(Services) when a custom date field (Service_Date__c) on another custom object (Unit)is equal to "This Month".
...
2
votes
0answers
39 views
Decrypt base64 signature
I have to decode a long Signature field value to generate signature image. Please find code below. Can someone help me here?
public class AccountPDF111
{ Public void AccountPDF111(){}
Public ...
1
vote
1answer
28 views
Apex Triggers to solve my Opps and Contracts problem - The Other Half
So, thanks to @BarCotter I have managed to get the first half of my problem sorted. I now have an Apex trigger to create a record in a custom object upon creation of an opportunity.
What I need to do ...
1
vote
2answers
84 views
PDF from Salesforce
I have a requirement to create separate pdf files with informations of HCPs having been called where samples are dropped. I can extract in csv, but how to do that in a presentable format in pdf? ...
0
votes
1answer
33 views
How to test PageReference in testmethod API 27.0
My Code coverage is 43%. I am not able to test the Method which returns PageReference method.
In my case method is pass().
public static testmethod void test1()
{
String strGUID1 = ...
8
votes
2answers
191 views
Debugging Apex Code using Checkpoints?
I currently run the Apex code using Anony exec/test class and Check the system debug logs or write system.debug to check the logs. But I feel the need to check line by line debugging of the code, with ...
3
votes
2answers
117 views
How to Calculate the Office Hours except holidays hours In Salesforce
I have the three field like below and I want to calculate the business hours but need to reduce the hour if the exist the holiday.
I have write this code into the apex class and call this class form ...
10
votes
0answers
178 views
Does an Apex or VisualForce code style guide exist?
Has anyone written an Apex or VisualForce code style guide, in the way of the Ruby Style Guide or jslint, or PEP-8, or any number of Java guides? I'm in the process on creating one for internal use ...
1
vote
2answers
43 views
External Entry Point Issue - Any Suggestion/Solution
Here is my Class
public with sharing class MassDeleteLeadController {
public MassDeleteLeadController (ApexPages.StandardSetController controller) {
currentStep = '1';
...
3
votes
1answer
46 views
Displaying messages on redirected VF page
This is roughly the same question as in here, I can't comment so I'm re-asking.
My problem is that if the redirect is created in the method assigned to apex:page action attribute, the messages are ...
2
votes
1answer
35 views
How do I truncate a field data in an email?
I have an visual force email template that is looking at email conversation and so including email body as a 'note' in an email notification to the Support team that needs to be made aware of the ...
1
vote
2answers
80 views
Using an Apex Repeat in a VisualForce template, do not include particular data from that field
I have this visual force template that is creating a repeat on the below field. However I don't want it to include BMCServiceDesk__actionId__c = 'Email Sent' within the email body but to include all ...
3
votes
1answer
145 views
System.DmlException: Delete failed.SELF_REFERENCE_FROM_TRIGGER
Hi All I have written the apex trigger.It working in sandbox but not in Production.While upload the csv file by using apex data loader in production it throws an exception below.
Exception:
...
0
votes
2answers
90 views
Saleforce Apex Test Coverage
Following is my Apex class:
public class lastViewed{
public Datetime cDT;
public String LongDate;
public String firstname;
public String lastname;
public String userid;
...
6
votes
2answers
65 views
How can I retrieve Actions by Apex?
I have a custom object and under Buttons, Links and Actions section I have several Actions created. Now I would like to retrieve somehow the Actions related to my custom object via code.
I was ...
1
vote
1answer
48 views
Help with calculating dates are that in range between another set
Hi what I am trying to do is write a validation rule in a trigger for a custom object where users can pass in a from and to date. Now I am trying to make sure that they can't put another record that ...
1
vote
1answer
50 views
System Debug not displaying inside constructor
If I add the Debug statements inside the constructor it is not displaying in the log.
Please suggest why this is happening.
Thanks in Advance
Dhiliban.
1
vote
1answer
85 views
issues with GET callout from salesforce
In my scenario i invoke a PUT callout to an external system
After that GET callout is invoked that is supposed to get the updated record values
Problem:
the output of step 2 shows the old record ...
3
votes
1answer
42 views
Dynamic Form How To Process Saved Posted Values
I fear this is a path well trod, littered with the bodies of dead developers. Upvote me if you too have wasted time on this.
So I've got a page rendered programmatically by adding textboxes, labels ...
-2
votes
1answer
62 views
Test class passed, but main class only 44%
Good Morning Salesforce Stackexchange
I have the following test class called “DeactivateUsers_Test” which has passed however main class “DeactivateUsers” is only getting code coverage of 44% ...
2
votes
1answer
36 views
Id attribute on apex elements, not the same as html elements?
Does the 'Id' attribute work the same for apex elements as it does for html elements?
The anchor tag below, gets the background image, but the outputlink does not.
Am I doing somthing wrong? Can ...
5
votes
2answers
152 views
Does Batch Apex fire off triggers?
For example, If I have a bunch triggers that aren't bulkified, so I'll end up hitting the governing limits were to do 100 insert opportunities in an separate apex class.
For batch apex, if I were to ...
0
votes
0answers
42 views
Can some one please help me with this code?
I'm a total newbie to Apex and have diligently searched and searched through out the forums for a solution to my problem...
I Need to auto populate productionsubscription__c(multi piclist on contact). ...
3
votes
2answers
57 views
unable to assign number to a field
I have a requirement where I need to check if Revision_Number__c number field is blank. If its blank than assign 1 else increment by 1. Following is what I tried.
...
0
votes
1answer
41 views
How can I create a campaign map that returns a list of all the campaign members associated with it?
In the Force.com Explorer I can perform the following query:
SELECT Id, (SELECT Id,LeadId,ContactId FROM CampaignMembers) FROM Campaign
It displays every campaign.Id in one column and the next ...
5
votes
2answers
270 views
Trigger to determine when a field was last populated
After extensive research I think I know what I need to do, but I don’t know how to get there
basically, I need to create a trigger to determine when a field was last populated.
I know this can be ...
3
votes
2answers
291 views
How to perform validations to input fields in page block table or <apex:repeat>?
I have a page block table with 5 columns - First Name, Last Name, email and phone number. 4 of them are apex:input component and one remove command button. And i can add new rows on click of a "Add ...
6
votes
3answers
212 views
Do Apex collections implement iterable?
Do Apex collection classes implement Iterable interface? I want to write a generic function that can take any of the collection classes that support foreach. Is this possible?