The class tag has no wiki summary.
4
votes
2answers
45 views
Can someone recommend a solid option to help me “get my feet wet”?
I've been interviewing with a company that uses Salesforce as their CRM. I'm a sales professional and have had to use Seibel before but never salesforce.
I am hoping someone could supply me with a ...
1
vote
2answers
53 views
Trigger Hel(p) Code Coverage 0%
As a followup to my previous posts (Again, many many thanks) I am still having trouble with the trigger.
The code seems to function and I created a test class and the code itself is 100% covered.
...
2
votes
2answers
40 views
Help with Triggers / Classes for Case Creation Part II — Test classes
Thank you for all the help on my other question. I was so happy to see a community that doesn't have trolls.
So the good news is that the code compiles with no errors.
The bad news is that I have ...
1
vote
1answer
44 views
Help with Triggers / Classes for Case Creation based on Field Change in Customer_Asset
I am new to Salesforce and haven't coded in quite awhile, so please forgive my rookie mistake(s).
I am attempting to write a trigger to do the following:
Our company manufactures equipment that ...
1
vote
2answers
64 views
Turning into Batch Apex using Database.QueryLocator
I want to turn my trigger code into a batch Apex, however, i am encountering a number of problems with it. Posting both the original and the batch codes. Please can anyone suggest what changes to add ...
3
votes
2answers
37 views
Accessing an Outer Class's Members from an Inner Class
public class Foo {
public foo() { }
}
public class Outer {
public Foo foo {get; set;}
public class Inner {
public Inner() {
system.debug(foo);
}
}
...
1
vote
1answer
57 views
Validating that at least one record in a class has a specific field checked
I have a class that allows users via VF to select custom contact roles for their opportunity. I need them to select at least one (or only one) of the contacts as primary. I know this should be ...
5
votes
1answer
62 views
Is there a Class.forName() equivalent for Apex
I'm looking to dynamically instantiate a class by its name. How can I do that in Apex? I thought about a factory method with a series of if-else statements, but am not satisfied with that as it isn't ...
8
votes
1answer
98 views
How to avoid circular dependancy and understand how salesforce compiles classes
I have 4 classes which are dependent on each other and i am always running into circular dependencies which is causing the code not to compile.
I have a controller which has a reference to a ...
3
votes
1answer
93 views
Is anyone using classes in anonymous apex?
I can't find anyone writing about this, but this works when executed anonymously:
public class foo {
public void bar() {
system.debug('\n\n#### FOO BAR ####\n\n');
}
}
foo f = new ...
1
vote
1answer
46 views
Code Coverage - Blue versus Red
I have various ranges of code that never show as "covered" in Apex Tests. Here are two examples. Could someone give me some guidance on them? How would I cover them?
One: ((Just the ...
0
votes
1answer
74 views
Test Code:Error: Compile Error: Invalid type: CustomLead_c at line 9 column 14
I am receiving "Error: Compile Error:Invalid typr; CustomLead_c at line 9 column 14".
Can any pls tell me how to fix this error.
*Code:*
public class LeadConversion {
public PageReference ...
1
vote
1answer
96 views
Best way to implement a singleton class in Apex
I am trying to create a singleton class for one of my apex classes and i am running into challenges. I created some static variables to control the instances but still i am running into multiple ...
3
votes
2answers
129 views
Increment Record based on field
I'd like to increment fields based on the quote field, so when a quote is created, a custom field will increment depend on the region (each field will have format of "ZO - {000}). Each region should ...
2
votes
2answers
69 views
Apex - Calling Class Fails After Altering PUBLIC statement in Class
(thanks to @JCD for helping me clean up my Class for Trigger.old vs .new checking...)
My call to the class/function below now fails. I presume that now that my PUBLIC statement is looking for two ...
0
votes
1answer
369 views
Apex - Checking Trigger.OLD versus Trigger.NEW
(thanks to @JesseAltman for help with the initial code)
I am trying to make sure this fires once each time the IF comes true (checking if the field was previously something different). I am doing ...
1
vote
2answers
71 views
Apex - Setting RecordType error
I am trying to set a Case.RecordType and cannot figure out how.
I tried:
caseToAdd.RecordType = '012600000005DYN';
and for the heck of it I tried the Label itself which of course failed. With the ...
2
votes
2answers
92 views
How to invoke a method of an apex class at run time
We have a usecase where we need to invoke an instance of a class and invoke a method at run time using string. I know with reflection i can instantiate a class. But how do we invoke a method of a ...
2
votes
2answers
68 views
Extracting number values in a text field then summing up
I have this field that gets populated by an external service and I want to extract the number values from it then sum the numbers up.
For instance, see the text below
United Kingdom: 3, Ireland: 1, ...
6
votes
3answers
115 views
Dynamic implementation of class using with sharing or without sharing based on certain conditions
I have one checkbox on my vf page.when i select this i want that the class to which this VF page is referring should work in with sharing mode and when i deselect it class should work in without ...
0
votes
2answers
187 views
Unknown property 'String.plancount' visual force
My code is in visualforce page :-
Something {!r.plancount} {!rep.name} for something
Getting error :-
Error: Unknown property 'String.plancount'
for !rep.name I ma not getting any error..
...
2
votes
1answer
281 views
Structure for classes to call inner or sub classes
I don't have a Java background and am working on a class where I'd like to be able to call inner classes from withing methods of the outer class. As much of Apex is implicit and I'm still learning, I ...
9
votes
2answers
88 views
Incomplete code blocks vulnerability
I've submitted my application for Security Review and I've got this problem in the report.
I'm not sure how to fix it.
Let's see the First case:
I have some classes that don't have any code like ...
0
votes
1answer
266 views
Use an intermediary Custom Object in Trigger handler class
I have a rather simple Trigger. When fired it determines its own type and calls an appropriate function in Trigger handler class.
trigger Project_Trigger on Acme_Project__c (before insert, after ...
2
votes
2answers
252 views
Deleting Triggers/Classes from Production
I was recently told ( Deleting a Class with IDE - cannot delete from Production? ):
You cannot delete a class in production directly. You will need delete
*the class from your sandbox* and then ...
1
vote
2answers
139 views
Deploying an Apex Class for a Custom Button - Too Many DML Statements Error
I am attempting to deploy an Apex Class from a sandbox environment to a production environment of Salesforce and I am having issues with the deployment. I am very new at this, so please forgive my ...
1
vote
1answer
68 views
Deleting a Class with IDE - cannot delete from Production?
When trying to delete a Class using IDE (simply right click and delete, and confirming I want it deleted in SF as well), it fails with the following screenshot. I have seen a couple posts via Google ...
2
votes
5answers
66 views
Deleting a class with IDE - can't connect to SF?
Can anyone shed some light on this error? I cannot connect to either Production OR my Sandbox with the IDE. :-( Thanks.
This happens after entering user/pass/token in and selecting to get ...
0
votes
3answers
352 views
Code Coverage on Triggers - no coverage for IF…TRUE?
I am woefully lacking in my Class writing skills. I'm curious if anyone can tell me (or give an example that works) why I cannot seem to get many, if any, IF...TRUE statements to be covered by Code ...
0
votes
1answer
33 views
Test Class returning error
Can anyone substantiate why this is?
Opportunity o2 = new Opportunity();
o2.Name = 'DSGTestClassRecord Opportunity 2';
o2.StageName = 'New';
o2.CLoseDate = Date.today();
insert ...