• kshannon
  • NEWBIE
  • 140 Points
  • Member since 2009
  • Senior Developer


  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 29
    Questions
  • 42
    Replies
I apologize if this has already been asked, tried searching with no luck. I have already connected a lighter weight version of our Postgres data to salesforce via REST API bulk uploading, but have some issues with keeping up to sync easily. I was wondering if anyone has dealt with read only from Postgres (possibly even data clips?) in order to update Salesforce. Everything seems to be more salesforce as truth focused, but we're looking to bring app data as truth into salesforce instead.

Example if our users table email updates, we'd want to update the associated email on the person account, etc.. seems simple just looking for an experienced voice on how they did this without costing a fortune and using old ETL strategies and or tons of single API calls.

Thanks for all and any advice!
We currently have our system bringing in leads and being owned by the API user. We then convert these leads to Person Accounts when the criteria is met. What I'm trying to easily do is re-assing the owner of these newly converted leads from the API user to one of our 6 (this number will change) staff users. I tried following steps people had for the round robin lead assignment rules, but that was causing issues. Has anyone experienced this issue previously and have any insight?

Thanks in advance.
Kyle
I have a trigger that is called before insert on "Revenue__c" object. Simply put it is checking the newly entered "Canvas_Id__c" field to match within a custom setting and then take the value from the custom setting and apply it to the Canvas__c field. Pretty straight forward and works with dataloader and native creation, but when running from API call, it seems that it is not able to reference the custom setting details/
 
trigger RevenueCanvasName on Revenue__c (before insert, before update) {
    public static List<Revenue__c> updateRevenueList;
    for (Integer i = 0; i < Trigger.new.size(); i++){
        if(Trigger.new[i].Canvas_Id__c != null || Trigger.new[i].Canvas_Id__c != Trigger.old[i].Canvas_Id__c){
            String cid = String.valueOf(Trigger.new[i].Canvas_Id__c);
            Trigger.new[i].Canvas__c = Canvas__c.getInstance(''+cid+'').Canvas__c;
        }
    }
}

Running on command line API I receive error of:

caused by: System.NullPointerException: Attempt to de-reference a null object

Trigger.RevenueCanvasName: line 6, column 1

Is there a difference referencing custom settings via the API? This has me stumped...
Hey all,

I'm trying to bulkify this trigger I wrote, seems my original setup is causing too many SOQL queries, clearly due to the soql being in the loop. I am working with a few different ways to fix this, but looking for some community guidance if possible. I am triggering on the Revenue object, which is related back to the Account. What I need to do is depending on the Canvas_Id__c, I am updating the overall total per canvas field on the account. 

See code below:
trigger ProductsSoldRollUp on Revenue__c (after delete, after insert, after undelete, 
after update) {
    public static List<Account> accountsList;
    public static List<Revenue__c> updateRevenueList;
    accountsList = new List<Account>();
    
    String ProductRevenueRecordTypeId = [select Id from RecordType where (Name='Product Revenue') and (SobjectType='Revenue__c')].Id;
    String ShippingRevenueRecordTypeId = [select Id from RecordType where (Name='Shipping Revenue') and (SobjectType='Revenue__c')].Id;

    
    for (Integer i = 0; i < Trigger.new.size(); i++)    {
        Integer total_quantity = 0;
    
        Account acct = [SELECT Royalties_Paid__c FROM Account WHERE Id = :Trigger.new[i].Account__c];
        List<Revenue__c> revList = [SELECT Canvas_Id__c, Royalty__c,Quantity__c,RecordTypeId FROM Revenue__c WHERE Account__c = :Trigger.new[i].Account__c];              
            
        for(Revenue__c r : revList){         
            if(r.RecordTypeId == ProductRevenueRecordTypeId && r.Quantity__c != null){
                if(r.Canvas_Id__c == Canvas__c.getInstance('1').Canvas_Id__c.intValue()){ // T-Shirt
                    p_quantity += r.Quantity__c.intValue();
                } else if(r.Canvas_Id__c == Canvas__c.getInstance('2').Canvas_Id__c.intValue()){ // Tank
                    t_quantity += r.Quantity__c.intValue();
                } else if(r.Canvas_Id__c == Canvas__c.getInstance('3').Canvas_Id__c.intValue()){ // Kids
                    e_quantity += r.Quantity__c.intValue();
                }

                total_quantity++;
             }
        }
        acct.p_total__c = p_quantity;
        acct.t_total__c = t_quantity;
        acct.e_total__c = e_quantity;
        
        update acct;
    }
}

I simplified this trigger to just the concept, also need to make the account update into a map so that i'm not constantly updating inside the loop as well.

Thanks all!

Hey,

 

I am trying to create a workflow formula that will check to see if my amount due was changed in my payment detail. but only if the opportunity's stage is equal to one of 3 choices.

 

I have this written out, but continue to struggle with an Extra AND error...

 

ISCHANGED( Amount_Due__c ) AND (ISPICKVAL(Donation__r.StageName , "Agreement Executed")),
(ISPICKVAL(Donation__r.StageName , "Receiving Funding")),
(ISPICKVAL(Donation__r.StageName , "Closed Fully Funded"))
)

 

If someone could please advise.

 

Thanks,

Kyle

Hey,

 

So here is the scenario:

 

I have a custom object that is running the workflow rule: Object A

When I create a record for Object A, I would like the ID of that record to be the field update on the related Contact Record.

 

Is this possible to acheive? I have not been able to see a way to do so without code.

 

Thanks,

Kyle

Hey All,

 

We are pulling event information from our Salesforce onto our website with an API call through PHP.

This call requires Username, Password, and Security Token (obviously). The only issue with this is that passwords are forced to change and the security token changes as well.

Is there anyway to set this up statically so that it will not need to be adjusted every approx 6 months?

 

Thanks,

Kyle

Hey all,

 

I am looking to make a testClass for a apex class that is simply just querying information out of multiple objects.

 

It touches, Contact, ELP_Application__c and ELP_Assessment__c.

 

I have created a basic test, but it is not showing any coverage which is confusing...

 

Here is the code:

 

public class ELPScoreTracker {

    public ELP_Assessment__c EntryAssessment {get; private set;}
    public ELP_Assessment__c Assignment4 {get; private set;}
    public ELP_Assessment__c Assignment5 {get; private set;}
    public ELP_Assessment__c Assignment6 {get; private set;}
    public ELP_Assessment__c Assignment7 {get; private set;}
    public ELP_Assessment__c Assignment8 {get; private set;}
    public ELP_Assessment__c Assignment10 {get; private set;}
    
    public ELP_Assessment__c Perform1 {get; private set;}
    public ELP_Assessment__c Perform2 {get; private set;}
    public ELP_Assessment__c Perform3 {get; private set;}
    
    public ELP_Assessment__c FeedbackBuddy {get; private set;}
    
    public ELP_Assessment__c Average {get; private set;}
    
    public ELP_Assessment__c ELP_A {get; private set;}
    public ELP_Application__c ELP_C {get; private set;}
    public Contact ELP_U {get; private set;}
    
    public ELPScoreTracker(ApexPages.StandardController controller) {
        
    EntryAssessment = [Select Entry_B_Average_Score__c,
                            Entry_STAR_Average_Score__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];   
        
    
    Assignment4 = [Select Assign4_AL_Average_Score__c,
                            Assign4_Final_Decision__c,
                            Assign4_PI_Average_Score__c,
                            Assign4_PM_Average_Score__c,
                            Assign4_STAR_Average_Score__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
    Assignment5 = [Select Assign5_AL_Average_Score__c,
                            Assign5_Final_Decision__c,
                            Assign5_PI_Average_Score__c,
                            Assign5_PM_Average_Score__c,
                            Assign5_STAR_Average_Score__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];

    Assignment6 = [Select Assign6_PI_Average_Score__c,
                            Assign6_Final_Decision__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
    Assignment7 = [Select Assign7_AL_Average_Score__c,
                            Assign7_STAR_Average_Score__c,
                            Assign7_PI_Average_Score__c,
                            Assign7_PM_Average_Score__c,
                            Assign7_Final_Decision__c
                                From ELP_Assessment__c
                                Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];

    Assignment8 = [Select Assign8_AL_Average_Score__c,
                            Assign8_STAR_Average_Score__c,
                            Assign8_PI_Average_Score__c,
                            Assign8_IPL_Average_Score__c,
                            Assign8_Final_Decision__c
                                From ELP_Assessment__c
                                Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                                
    Assignment10 = [Select Assign10_AL_Average_Score__c,
                            Assign10_STAR_Average_Score__c,
                            Assign10_PI_Average_Score__c,
                            Assign10_IPL_Average_Score__c,
                            Assign10_Final_Decision__c
                                From ELP_Assessment__c
                                Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                            
    Perform1 = [Select Perf_Convo1_B_Average_Score__c,
                            Perf_Convo1_RD_Average_Score__c,
                            Perf_Convo1_STAR_Average_Score__c,
                            Perf_Convo1_PI_Average_Score__c,
                            Perf_Convo1_IPL_Average_Score__c,
                            Perf_Convo1_Final_Decision__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];     

    Perform2 = [Select Perf_Convo2_B_Average_Score__c,
                            Perf_Convo2_RD_Average_Score__c,
                            Perf_Convo2_AL_Average_Score__c,
                            Perf_Convo2_PI_Average_Score__c,
                            Perf_Convo2_Final_Decision__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
/*  Perform3 = [Select Perf_Convo3_Final_Decision__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              */
    FeedbackBuddy = [Select Feedback_Buddy_IPL_Average_Score__c
                            From ELP_Assessment__c
                            Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];   
                              
    Average = [Select Belief_Overall_Average__c,
                        Relentless_Drive_Overall_Average__c,
                        Adult_Leadership_Overall_Average__c,
                        Student_Achievement_Overall__c,
                        Personal_Improvement_Overall__c,
                        Project_Management_Overall_Average__c,
                        Interpersonal_Leadership_Overall__c
                        
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
    ELP_A = [Select ELP_Application__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
    ELP_C = [Select Applicant__c, CohortYear__c, Preferred_City__c
                              From ELP_Application__c 
                              Where Id = :ELP_A.ELP_Application__c LIMIT 1];
                              
    ELP_U = [Select LastName, FirstName
                              From Contact 
                              Where Id = :ELP_C.Applicant__c LIMIT 1];

}

public static testmethod void ELPScoreTracker() {
    

    
       Account acct = new Account(Name='test acct');
        insert acct;
        
        Contact testContact = new Contact(
            LastName = 'Test Contact'
        );
        testContact.accountId = acct.Id;
        insert testContact;
        
        ELP_Application__c testApp = new ELP_Application__c(
            Name = 'Test App',
            CohortYear__c = '2012-2013'
        );
        testApp.Applicant__c = testContact.Id;
        testApp.Application_Date__c = System.today();
        insert testApp;
        
        Contact Test_C = [Select LastName
                              From Contact 
                              Where Id = :testContact.Id LIMIT 1];
        
        ELP_Assessment__c testAss = new ELP_Assessment__c(
            Name = 'Test Assess',
            ELP_Application__c = testApp.Id,
            Entry_B_Average_Score__c = 4,
            Entry_STAR_Average_Score__c = 3
            
        );
        insert testAss;
        
            
            
            ELP_Application__c ELPApp = [SELECT Id FROM ELP_Application__c WHERE Id = :testAss.ELP_Application__c];
        
        
        
       System.assertEquals(testContact.LastName, Test_C.LastName);
       System.assertEquals(4, testAss.Entry_B_Average_Score__c);
       System.assertEquals(testAss.ELP_Application__c, ELPApp.Id);
        
}
}

I have worked with modifying much existing code and basic triggers and pieces, but never actually coded something this simple... If someone could give a little linsight, I'd really appreciate it.

We have a user who is trying to import into a campaign, he is already a marketing user and has edit functionality on campaigns, but for the life of me I can NOT find the Import Leads permission.. where is this located?

Just reaching out to see if anyone has accomplished this? If so, what was your provider/vender and what did it take to accomplish?

 

Thanks,

Kyle

Hey All,

 

I copied a Site that has a page with Contact Object fields on the landing page. When I access the page via the sites link, the contact fields are missing. When I go to the page directly /apex/page all of the fields are showing.

 

Clearly this is a permissions issue, but I am unable to locate it.

 

I have compared the Profile of the site to the Sandbox and everything seems to be ok.

I have checked field level security on the contact and no red flags...

 

Any ideas?

 

Thanks,
Kyle

Hey,

 

I have a visualforce page that is using a template. Inside the template it is defined that standardstyle="false" as well as on the vf page itself. I'm using my own stylesheet, yet the force.com logo and logout link are still being used as a header... how can I remove this? Also the footer has a powered by salesforce.. is this a default setting?

Hey,

 

I am looking to add additional fields to a picklist. It has multiple values as it is... and I'm trying to just add more onto it..

 

Would I do a += or a .= for the actual value? I don't want it to replace, I want it to concatenate.

Hey all, I have a trigger that is looping through all opportunities that have been updated and syncing the information to any contracts that are existing. I have a for loop going through each opportunity effected and then my test class is getting caught up on

 

newmonthcontracts = OppIDs[0].Term_Yrs__c.intValue() * 12;

 

I have the similar code in the test class that does this feature and have a systemassertequals to check it, but its still not covering the code.

 

Do I need to do something in perticular for the loop so that it validates? It seems to only be the code in the loop.

16:5:11.693|METHOD_ENTRY|[10,9]|LIST:Id.add(Id)
16:5:11.693|EXCEPTION_THROWN|[10,9]|System.NullPointerException: Attempt to de-reference a null object
16:5:11.693|METHOD_EXIT|[10,9]|add(ANY)
16:5:11.693|FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object

 

is the system log...

 

the code is:

 

 

trigger LapsedFunderToFunder on Opportunity (after insert) {


List<Id> effectedAccounts;

for(Opportunity o : Trigger.new){

system.debug('accountid - ' + o.AccountId);

effectedAccounts.add(o.AccountId);

 Not sure why an Id won't add to the List<Id>... strange.. There must be something I'm missing.

 

I am setting the recordType of a newly created recorded in apex.

 

I have it inserting the new opportunity and am receiving an error on this line:

 

opportunity.recordtype = chosenRecType;

 

chosenRecType is a value passed to the controller via javascript.

 

The error is: Error: Compile Error: Illegal assignment from String to SOBJECT:RecordType

 

Is there a way to convert this string to be read properly?

 

Thanks.

Hey, I have a trigger on the allocation that is trying to loop through the associated opportunities. Here is the code:

 

List<Opportunity> donations; for(Payment_Detail__c pd :Trigger.new){ donations.add(pd.Donation__c); system.debug(pd.Donation__c); for(Opportunity o : donations){ // do action here

} }

 

Incompatible element type Id for Opportunity, although it is the field that holds the ID of the Opportunity (Donation)

 

Hey I'm trying to write a trigger on the one record we have Years for the term. The other one we have months for the term.

 

What I tried doing is:

 

double newmonths;

 

for(Contract c : contractrecords){

        newmonths = o.Term_Yrs__c * 12;

 

c.ContractTerm = newmonths;

 

Error: Compile Error: Illegal assignment from Double to Integer

 

How would one accomplish changing the type so that I can do the math and enter it in properly?

 

Message Edited by kshannon on 03-19-2010 08:34 AM

I'm trying to add fields via a trigger to a picklist that has existing fields.

 

If I have cities and it already has chicago, but this trigger now says put New York, how would this be completed?

 

I tried doing += and it did not work.

 

Thanks.

Hey all,

 

I have a custom button that redirects to a VF page.

This page and its controller are allowed for the profile of the user.

Also the page security and class security allow this profile as well.

Yet still I'm getting insuficient access for my user that is trying to click the button.

 

 Thanks.

I have a trigger that is called before insert on "Revenue__c" object. Simply put it is checking the newly entered "Canvas_Id__c" field to match within a custom setting and then take the value from the custom setting and apply it to the Canvas__c field. Pretty straight forward and works with dataloader and native creation, but when running from API call, it seems that it is not able to reference the custom setting details/
 
trigger RevenueCanvasName on Revenue__c (before insert, before update) {
    public static List<Revenue__c> updateRevenueList;
    for (Integer i = 0; i < Trigger.new.size(); i++){
        if(Trigger.new[i].Canvas_Id__c != null || Trigger.new[i].Canvas_Id__c != Trigger.old[i].Canvas_Id__c){
            String cid = String.valueOf(Trigger.new[i].Canvas_Id__c);
            Trigger.new[i].Canvas__c = Canvas__c.getInstance(''+cid+'').Canvas__c;
        }
    }
}

Running on command line API I receive error of:

caused by: System.NullPointerException: Attempt to de-reference a null object

Trigger.RevenueCanvasName: line 6, column 1

Is there a difference referencing custom settings via the API? This has me stumped...
Hey all,

I'm trying to bulkify this trigger I wrote, seems my original setup is causing too many SOQL queries, clearly due to the soql being in the loop. I am working with a few different ways to fix this, but looking for some community guidance if possible. I am triggering on the Revenue object, which is related back to the Account. What I need to do is depending on the Canvas_Id__c, I am updating the overall total per canvas field on the account. 

See code below:
trigger ProductsSoldRollUp on Revenue__c (after delete, after insert, after undelete, 
after update) {
    public static List<Account> accountsList;
    public static List<Revenue__c> updateRevenueList;
    accountsList = new List<Account>();
    
    String ProductRevenueRecordTypeId = [select Id from RecordType where (Name='Product Revenue') and (SobjectType='Revenue__c')].Id;
    String ShippingRevenueRecordTypeId = [select Id from RecordType where (Name='Shipping Revenue') and (SobjectType='Revenue__c')].Id;

    
    for (Integer i = 0; i < Trigger.new.size(); i++)    {
        Integer total_quantity = 0;
    
        Account acct = [SELECT Royalties_Paid__c FROM Account WHERE Id = :Trigger.new[i].Account__c];
        List<Revenue__c> revList = [SELECT Canvas_Id__c, Royalty__c,Quantity__c,RecordTypeId FROM Revenue__c WHERE Account__c = :Trigger.new[i].Account__c];              
            
        for(Revenue__c r : revList){         
            if(r.RecordTypeId == ProductRevenueRecordTypeId && r.Quantity__c != null){
                if(r.Canvas_Id__c == Canvas__c.getInstance('1').Canvas_Id__c.intValue()){ // T-Shirt
                    p_quantity += r.Quantity__c.intValue();
                } else if(r.Canvas_Id__c == Canvas__c.getInstance('2').Canvas_Id__c.intValue()){ // Tank
                    t_quantity += r.Quantity__c.intValue();
                } else if(r.Canvas_Id__c == Canvas__c.getInstance('3').Canvas_Id__c.intValue()){ // Kids
                    e_quantity += r.Quantity__c.intValue();
                }

                total_quantity++;
             }
        }
        acct.p_total__c = p_quantity;
        acct.t_total__c = t_quantity;
        acct.e_total__c = e_quantity;
        
        update acct;
    }
}

I simplified this trigger to just the concept, also need to make the account update into a map so that i'm not constantly updating inside the loop as well.

Thanks all!

I'm sending a query to SalesForce (using the SOAP API) that includes an IN clause, however, I keep getting a MALFORMED_QUERY error.  Could someone point me in the right direction of what the query syntax is when using the IN clause?  I've tried the following without success (the ids are made up in these examples):

 

SELECT Id FROM Lead WHERE Id IN {'000000000000000','111111111111111'}

SELECT Id FROM Lead WHERE Id IN '0000000000000','111111111111111'

 

Thanks.

Hey,

 

I am trying to create a workflow formula that will check to see if my amount due was changed in my payment detail. but only if the opportunity's stage is equal to one of 3 choices.

 

I have this written out, but continue to struggle with an Extra AND error...

 

ISCHANGED( Amount_Due__c ) AND (ISPICKVAL(Donation__r.StageName , "Agreement Executed")),
(ISPICKVAL(Donation__r.StageName , "Receiving Funding")),
(ISPICKVAL(Donation__r.StageName , "Closed Fully Funded"))
)

 

If someone could please advise.

 

Thanks,

Kyle

Hey,

 

So here is the scenario:

 

I have a custom object that is running the workflow rule: Object A

When I create a record for Object A, I would like the ID of that record to be the field update on the related Contact Record.

 

Is this possible to acheive? I have not been able to see a way to do so without code.

 

Thanks,

Kyle

Hey all,

 

I am looking to make a testClass for a apex class that is simply just querying information out of multiple objects.

 

It touches, Contact, ELP_Application__c and ELP_Assessment__c.

 

I have created a basic test, but it is not showing any coverage which is confusing...

 

Here is the code:

 

public class ELPScoreTracker {

    public ELP_Assessment__c EntryAssessment {get; private set;}
    public ELP_Assessment__c Assignment4 {get; private set;}
    public ELP_Assessment__c Assignment5 {get; private set;}
    public ELP_Assessment__c Assignment6 {get; private set;}
    public ELP_Assessment__c Assignment7 {get; private set;}
    public ELP_Assessment__c Assignment8 {get; private set;}
    public ELP_Assessment__c Assignment10 {get; private set;}
    
    public ELP_Assessment__c Perform1 {get; private set;}
    public ELP_Assessment__c Perform2 {get; private set;}
    public ELP_Assessment__c Perform3 {get; private set;}
    
    public ELP_Assessment__c FeedbackBuddy {get; private set;}
    
    public ELP_Assessment__c Average {get; private set;}
    
    public ELP_Assessment__c ELP_A {get; private set;}
    public ELP_Application__c ELP_C {get; private set;}
    public Contact ELP_U {get; private set;}
    
    public ELPScoreTracker(ApexPages.StandardController controller) {
        
    EntryAssessment = [Select Entry_B_Average_Score__c,
                            Entry_STAR_Average_Score__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];   
        
    
    Assignment4 = [Select Assign4_AL_Average_Score__c,
                            Assign4_Final_Decision__c,
                            Assign4_PI_Average_Score__c,
                            Assign4_PM_Average_Score__c,
                            Assign4_STAR_Average_Score__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
    Assignment5 = [Select Assign5_AL_Average_Score__c,
                            Assign5_Final_Decision__c,
                            Assign5_PI_Average_Score__c,
                            Assign5_PM_Average_Score__c,
                            Assign5_STAR_Average_Score__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];

    Assignment6 = [Select Assign6_PI_Average_Score__c,
                            Assign6_Final_Decision__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
    Assignment7 = [Select Assign7_AL_Average_Score__c,
                            Assign7_STAR_Average_Score__c,
                            Assign7_PI_Average_Score__c,
                            Assign7_PM_Average_Score__c,
                            Assign7_Final_Decision__c
                                From ELP_Assessment__c
                                Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];

    Assignment8 = [Select Assign8_AL_Average_Score__c,
                            Assign8_STAR_Average_Score__c,
                            Assign8_PI_Average_Score__c,
                            Assign8_IPL_Average_Score__c,
                            Assign8_Final_Decision__c
                                From ELP_Assessment__c
                                Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                                
    Assignment10 = [Select Assign10_AL_Average_Score__c,
                            Assign10_STAR_Average_Score__c,
                            Assign10_PI_Average_Score__c,
                            Assign10_IPL_Average_Score__c,
                            Assign10_Final_Decision__c
                                From ELP_Assessment__c
                                Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                            
    Perform1 = [Select Perf_Convo1_B_Average_Score__c,
                            Perf_Convo1_RD_Average_Score__c,
                            Perf_Convo1_STAR_Average_Score__c,
                            Perf_Convo1_PI_Average_Score__c,
                            Perf_Convo1_IPL_Average_Score__c,
                            Perf_Convo1_Final_Decision__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];     

    Perform2 = [Select Perf_Convo2_B_Average_Score__c,
                            Perf_Convo2_RD_Average_Score__c,
                            Perf_Convo2_AL_Average_Score__c,
                            Perf_Convo2_PI_Average_Score__c,
                            Perf_Convo2_Final_Decision__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
/*  Perform3 = [Select Perf_Convo3_Final_Decision__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              */
    FeedbackBuddy = [Select Feedback_Buddy_IPL_Average_Score__c
                            From ELP_Assessment__c
                            Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];   
                              
    Average = [Select Belief_Overall_Average__c,
                        Relentless_Drive_Overall_Average__c,
                        Adult_Leadership_Overall_Average__c,
                        Student_Achievement_Overall__c,
                        Personal_Improvement_Overall__c,
                        Project_Management_Overall_Average__c,
                        Interpersonal_Leadership_Overall__c
                        
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
    ELP_A = [Select ELP_Application__c
                              From ELP_Assessment__c 
                              Where Id = :ApexPages.CurrentPage().getParameters().get('id') LIMIT 1];
                              
    ELP_C = [Select Applicant__c, CohortYear__c, Preferred_City__c
                              From ELP_Application__c 
                              Where Id = :ELP_A.ELP_Application__c LIMIT 1];
                              
    ELP_U = [Select LastName, FirstName
                              From Contact 
                              Where Id = :ELP_C.Applicant__c LIMIT 1];

}

public static testmethod void ELPScoreTracker() {
    

    
       Account acct = new Account(Name='test acct');
        insert acct;
        
        Contact testContact = new Contact(
            LastName = 'Test Contact'
        );
        testContact.accountId = acct.Id;
        insert testContact;
        
        ELP_Application__c testApp = new ELP_Application__c(
            Name = 'Test App',
            CohortYear__c = '2012-2013'
        );
        testApp.Applicant__c = testContact.Id;
        testApp.Application_Date__c = System.today();
        insert testApp;
        
        Contact Test_C = [Select LastName
                              From Contact 
                              Where Id = :testContact.Id LIMIT 1];
        
        ELP_Assessment__c testAss = new ELP_Assessment__c(
            Name = 'Test Assess',
            ELP_Application__c = testApp.Id,
            Entry_B_Average_Score__c = 4,
            Entry_STAR_Average_Score__c = 3
            
        );
        insert testAss;
        
            
            
            ELP_Application__c ELPApp = [SELECT Id FROM ELP_Application__c WHERE Id = :testAss.ELP_Application__c];
        
        
        
       System.assertEquals(testContact.LastName, Test_C.LastName);
       System.assertEquals(4, testAss.Entry_B_Average_Score__c);
       System.assertEquals(testAss.ELP_Application__c, ELPApp.Id);
        
}
}

I have worked with modifying much existing code and basic triggers and pieces, but never actually coded something this simple... If someone could give a little linsight, I'd really appreciate it.

We have a user who is trying to import into a campaign, he is already a marketing user and has edit functionality on campaigns, but for the life of me I can NOT find the Import Leads permission.. where is this located?

Hey,

 

I have a visualforce page that is using a template. Inside the template it is defined that standardstyle="false" as well as on the vf page itself. I'm using my own stylesheet, yet the force.com logo and logout link are still being used as a header... how can I remove this? Also the footer has a powered by salesforce.. is this a default setting?

Hey all, I have a trigger that is looping through all opportunities that have been updated and syncing the information to any contracts that are existing. I have a for loop going through each opportunity effected and then my test class is getting caught up on

 

newmonthcontracts = OppIDs[0].Term_Yrs__c.intValue() * 12;

 

I have the similar code in the test class that does this feature and have a systemassertequals to check it, but its still not covering the code.

 

Do I need to do something in perticular for the loop so that it validates? It seems to only be the code in the loop.

Some of our clients are experiencing random "Insufficient Privileges" errors on our managed Visualforce page that's embedded inside the Case object.  It appears to be happening on both IE, Safari and Firefox, but goes away after some time or if they switch browsers...

 

Any ideas on what might be causing this?

Thanks,

Jon

 

 

 

16:5:11.693|METHOD_ENTRY|[10,9]|LIST:Id.add(Id)
16:5:11.693|EXCEPTION_THROWN|[10,9]|System.NullPointerException: Attempt to de-reference a null object
16:5:11.693|METHOD_EXIT|[10,9]|add(ANY)
16:5:11.693|FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object

 

is the system log...

 

the code is:

 

 

trigger LapsedFunderToFunder on Opportunity (after insert) {


List<Id> effectedAccounts;

for(Opportunity o : Trigger.new){

system.debug('accountid - ' + o.AccountId);

effectedAccounts.add(o.AccountId);

 Not sure why an Id won't add to the List<Id>... strange.. There must be something I'm missing.

 

Hey, I have a trigger on the allocation that is trying to loop through the associated opportunities. Here is the code:

 

List<Opportunity> donations; for(Payment_Detail__c pd :Trigger.new){ donations.add(pd.Donation__c); system.debug(pd.Donation__c); for(Opportunity o : donations){ // do action here

} }

 

Incompatible element type Id for Opportunity, although it is the field that holds the ID of the Opportunity (Donation)

 

Hey I'm trying to write a trigger on the one record we have Years for the term. The other one we have months for the term.

 

What I tried doing is:

 

double newmonths;

 

for(Contract c : contractrecords){

        newmonths = o.Term_Yrs__c * 12;

 

c.ContractTerm = newmonths;

 

Error: Compile Error: Illegal assignment from Double to Integer

 

How would one accomplish changing the type so that I can do the math and enter it in properly?

 

Message Edited by kshannon on 03-19-2010 08:34 AM

Hey all,

 

I have a custom button that redirects to a VF page.

This page and its controller are allowed for the profile of the user.

Also the page security and class security allow this profile as well.

Yet still I'm getting insuficient access for my user that is trying to click the button.

 

 Thanks.

Hi All,  We recently brought our schedule balancing app, DayBack, to Salesforce. DayBack is a JavaScript web app and bringing it to Salesforce was  intimidating--more learning a new culture than a new language--but it went really well and now DayBack works seamlessly with Salesforce and is Lightning and Mobile1 ready.

We've packaged up what we've learned in this process as an opensource Canvas App Starter Kit. This is the reasource I wish we'd had when we got started. It consolidates a lot of the docs and best practices from around the ecosystem and includes a simpler Hello World application more tuned to JS devs.

So if you have a web app you'd like to bring to the App Exchange, I hope this gives you a big head start. (Feedback MUCH appreciated.)

Starter Kit Splash Screen