• jwalsh
  • NEWBIE
  • 120 Points
  • Member since 2010

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 23
    Replies

Hi,

Am unable to refresh any of the resources in the IDE from the server.

When am trying to refresh a page from the web, getting an Exception saying:

 

 

Unable to refresh resource 'MileaeExension.cls':
com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Unable to refresh resource 'MileaeExension.cls':


com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Please assist to rectify the issue. 

 

Thanks in advance,

VNath

Hey all,

I refreshed my Sandbox (Configuration only) today and when running tests, I see a lot of unexpected failures.  Most of them have this message:

caused by: line -1, column -1: Previous load of class failed: MetaDataSearch.SearchResultsController: line 1, column 21: Entity is not org-accessible: []

Anyone seen this before?

 
Hey all,

Wondering if anyone can suggest reasons as to how code coverage could suddenly drop in a production org.

We have a development shop with several developers working on our code base.  Yesterday at around noon, one of us successfully deployed a change set with no issues.  Later in the afternoon, another change set failed for the same developer, citing "Code Coverage Error".  The funny thing is, it doesn't appear to have actually tried to run the tests, as the "Run Apex Tests" chart doesn't show any progress.

We thought that perhaps some flows/workflow rule changes could be to blame, but our setup audit trail doesn't show any changes to these.

We are also seeing some odd behaviour on test execution in our production org, with the apex test execution page showing tests failed, but when you click the line to see detail, it shows as passed.  It also displays a weird message, naming the class by id?

odd apex test runner output
  • March 10, 2015
  • Like
  • 0
Hey all,

Anybody taking the Process Bulider for a walk yet?  (I've heard it called the Process Builder, Visual Workflows, etc).

I'm trying to do something I do a lot in code; drop some breadcrumb objects when an object moves between two states.  To do this, I link to the object changin and set a "From" and "To" filed value.  In apex, I do this in a before update trigger and grab the values from oldMap and newMap.

In the process bulider, I can access "Priorvalue" in a decision block.  During the "Create" action, however, I can't get at the old value; I only have access to select [Object].field, or to "hard code" the value I want to go into the field.

Anyone else out there trying to do something similar?
  • October 28, 2014
  • Like
  • 0
Hey all,

I'm trying to use the Analytics API to call into some dashboards to get metadata on some components, using the below endpoint:

/services/data/v30.0/analytics/dashboards/01ZC00000013jEk

When I call one of my dashboards, all is well and I get the data.

When I call the other, I get a 500 Server Error with the following content:

[
    {
        "message": "An unexpected error occurred. Please include this ErrorId if you contact support: 1934229877-168288 (-1719484254)",
        "errorCode": "UNKNOWN_EXCEPTION"
    }
]

I don't have the necessary service level to open a case with support about APIs and Integration so I'm hoping someone here has seen specific dashboards fail in the past and has resolved why.

We use the reports functionality of the api heavily and have never seen an issue like this one before.

Jeremy
  • October 07, 2014
  • Like
  • 0

It would be super awesome if Eclipse/Force.com IDE had rudimentary understanding of Apex code and supported normal IDE features like find usages, click-through to method definitions, etc.  Shouldn't be a huge stretch to do this, should it?

Hey there Apexers,

 

I'm trying to deploy some code from my Sandbox to my production Enterprise org.  While deploying, the code generates a number of failures and as such cannot deploy.  My issue is that I cannot figure out why it fails.  

 

Running "All Tests" on both my production and sandbox org produces no errors

  • note: actually 14 failures, but they're all in managed packages from 3rd party vendors; marketo, geopoint, etc.
  • note 2: this is a functionality update to code previously deployed from sandbox to production

The "Deployment Results" page lists a table of failures, the rightmost column saying: 

 

 

Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, NewCampaignMemberTrigger: execution of AfterInsert caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or c...

 

As the text is truncated, I'm not really getting any information about why it failed.  This is compounded by the fact that running the named test on both production and sandbox produces a pass; both as an individual test run and as a result of clicking "Run All Tests" from the Apex Class home page.

 

I've searched google with chunks of the message and found points about non-selective queries, etc, but as I have a lot of triggers I can't track down exactly what query is giving the problem.

 

 

  • February 15, 2012
  • Like
  • 0

Hey all,

 

On the "Schedule Apex" page (/setup/Monitoring/Scheduled Jobs) there's a "Manage" button next to each job I have set up.  I initially set up a job to expire on the 1st of Nov and now I want to edit the "End" to push it out a few months into the future. The page you get when you hit "Manage" alows you to edit the different fields (start, end, days of the week, time of day) but there's no save button; only Cancel and Delete.  Hitting the enter key on a field to submit the form doesn't doesn't save my changes.  I know I can delete this one and enter another one on the same code, but it seems like the save button was just forgotten on this page.  Any thoughts?

  • November 22, 2011
  • Like
  • 0

Hello all,


Seeing some odd behaviour during some data cleanup.  We had a Contact c on the wrong Account a1 with an OpportunityContactRole ocr1 on Opportunity o1, o1.accountid=a1.id.
C was actually supposed to be attached to Account a2, with Opportunity o2.accountid = a2.id.  C was edited to move over to a2, ie c.accountid = a2.id.
After this move, all of the tasks on o1 associated with c stayed put on o1.  I wrote a small script to scrape o1's tasks, detect what needed to be moved over, and moved them (ie whatid=o2.id).  This worked fine for most of the tasks.
However, there are some tasks left over with whoid=c.id and whatid=o1.id.  When I go to o1's detail page in the sfdc ui, they still show in the related activities list.

 

The odd part:
Querying for tasks (using force.com explorer) related to o1 doesn't return the problem task that should have moved but didn't.   Further, I tried to query for pt's info in Force.com explorer:  select id, whoid, whatid, subject from task where id='00T8000001JEj18'.  Much to my surprise, this query returned no result.

 

Question:
Under what circumstance will the front end show you an object, but that object cannot be queried from the database?  As a further note, I also queried "Event" for the same id and get nothing; I'm slightly confused by the Task/Event/Activity dual-/tri-ality so I figured I'd give it a shot; however the detail page for the object I'm looking for has the Task layout and says "Task" in the top of the detail page.


  • September 21, 2011
  • Like
  • 0

Hey all,

 

Apex newbie here.  Tried researching this here and through google, can't seem to find an answer.

 

I have a trigger on CampaignMember, after insert.  I'm trying to do a basic lead scoring implementation by counting the number of campaigns that Contacts enter.  I'm writing out values with debug statements and it would seem to me that everything hooks together as it should, but after the event, the Contacts don't retain the values set by the trigger.  Is it that you cannot modify a Contact from a CampaignMember trigger?  If so, is there a place where you can see these types of rules laid out?  I read through all the Trigger documentation in the Apex Developers Guide and can't see any such restrictions.

 

Here's the jist of the code:

 

 

trigger NewCampaignMemberTrigger on CampaignMember (after insert) 
{
    //CampaignHelper and ContactHelper are utility classes that house some convenience methods.  
    //I've outlined the SOQL queries that take place in comments under each call
    Set</*Campaign*/ID> campaignIDs = CampaignHelper.getCampaignIDs(Trigger.new);
        //rolls up Trigger.new[n].campaignID into a Set and returns
    Set</*Contact*/ID> contactIDs = ContactHelper.getContactIDs(Trigger.new);
        //rolls up Trigger.new[n].contactID into a Set (where not null) and returns
    
    Map</*Campaign*/ID, Campaign> campaignMap = CampaignHelper.getCampaignMapByID(campaignIDs);
        //return new Map<ID, Campaign>(
        //  [select id, buyers_cycle_score__c from Campaign where id in: campaignIDs]
        //);
    Map</*Contact*/ID, Contact> contactMap = ContactHelper.getMapByID(contactIDs);
        //return new Map<Id, Contact>(
        //    [select id, AccountId, buyers_cycle_score__c from Contact where id in: contactIDs]
        //);
    List<Contact> updatedContacts = new List<Contact>();
    
    for(CampaignMember cm: Trigger.new)
    {
        if(cm.contactID != null)
        {
            Contact contact = contactMap.get(cm.contactID);
            
            Decimal campaignScore = campaignMap.get(cm.campaignID).buyers_cycle_score__c;
            System.debug('Campaign Score:' + campaignScore);
            //in this example: 5.00
            Decimal existingOpportunityScore = contact.buyers_cycle_score__c == null ? 0 : contact.buyers_cycle_score__c ;
            System.debug('Exist Opportunity Score:' + existingOpportunityScore);
            //in this example: 0.00
            contact.buyers_cycle_score__c = existingOpportunityScore + campaignScore;
            System.debug('Buyers Cycle Score:' + contact.buyers_cycle_score__c);
            //in this example: 5.00
            updatedContacts.add(contact); 
        }
    }
    
    try 
    {
     update updatedContacts;
    }
    catch (DMLException e)
    {
        System.debug('contact update failed: '+e);
     }
}

 

  • November 17, 2010
  • Like
  • 0
Hey all,

I refreshed my Sandbox (Configuration only) today and when running tests, I see a lot of unexpected failures.  Most of them have this message:

caused by: line -1, column -1: Previous load of class failed: MetaDataSearch.SearchResultsController: line 1, column 21: Entity is not org-accessible: []

Anyone seen this before?

 
Hi folks,

I am getting problem with test coverage.
I am getting test coverage of 0%
Actually i don't know how to link the test class with the Apex class.

Here is my APEX Code

global class RenewalOpportunity implements Schedulable {
       global void execute(SchedulableContext SC) {
           
                RenewalOpp R= new RenewalOpp();
           
           
       }
    
    public class RenewalOpp{

RenewalOpp(){
Date d = Date.Today();


for(Account a:[select id,Name,Service_End_Date__c,Customer_Success_Manager__c,ARR__c
    from Account acc
    where
     (Id NOT IN (select AccountID from opportunity
    where AutoCreatedFlag__c = true ))])
{
    if(a.Service_End_Date__c!=NULL){
        
    // Difference between Service End date and Current date    
    Integer numberDaysDue= d.daysBetween(a.Service_End_Date__c);
    
    if(numberDaysDue<=60)  {  
        
    // Creating a new opportunity  
    Opportunity O= new Opportunity();
    o.Name=a.Name;
    o.StageName='Legal';
    o.Amount=a.ARR__c;
    o.AccountId=a.ID;
    o.CloseDate=Date.today();
    o.Customer_Success_Manager__c=a.Customer_Success_Manager__c;
    o.NextStep='Won';
    o.OwnerID='005d0000001Kt9D';
    o.AutoCreatedFlag__c = true;
        insert o;
        
       // Create a Pricebook Entry for Product
        
        List<OpportunityLineItem> oliList = new List <OpportunityLineItem>();
        Pricebook2 stdpb = [SELECT Id FROM Pricebook2 WHERE IsStandard = true]; // Select Price Book
        List<PriceBookEntry> entryList = new List<PriceBookEntry>();
        PriceBookEntry pe= new PriceBookEntry();
        pe.Pricebook2Id=stdpb.Id;
        pe.Product2Id='01tJ0000003qkr0';
        pe.UnitPrice=10;  // Standard Price
        pe.IsActive=true;
        Integer counter = [select count()  FROM PriceBookEntry where Product2.Id='01tJ0000003qkr0' And
        PriceBook2.isStandard=true AND UnitPrice=10];
        
        entryList.add(pe);
        if(counter==0){
        insert entryList;
        }
        
        List<PriceBookEntry> priceBookList = [select Id, Product2Id, Product2.Id, Product2.Name FROM PriceBookEntry where Product2.Id='01tJ0000003qkr0' And
        PriceBook2.isStandard=true LIMIT 1 ]; // Get the Price Book entry ID that we entered in the previous step
        OpportunityLineItem oli = new OpportunityLineItem(); // Create new Opportunity Product
        oli.OpportunityId = o.Id;                           
        oli.PricebookEntryId=priceBookList[0].Id;       // PricebookentryID of the existing pricebook entry for the specific product
        oli.UnitPrice =a.ARR__c;                       // Sales Price (or List Price)
        oli.Quantity=1;
        insert oli;
                          
              }
    }
}
 }
 
 }
    
    
    
    }



My Test Code

@isTest (seeAllData=true)  

public class RenewalTest{
    
    static testmethod void RenewalTest() {
    
    Date d = Date.Today();
    Date dueDate = date.newInstance(2015, 3, 20);
   // CSM__c csm= new CSM__c(Name='Chidanand',Customer_Success_Manager__c='Chidanand',Email='Chidanand@knstek.com');  
   // insert csm;
    Campaign c = new Campaign(Name='Chidanand');
    insert c;
    
    Product2 prod = new Product2(Name = 'Laptop X200',
            Family = 'Hardware');
        insert prod;
        
        
    
    
    Account a = new Account(Name='KNS',Service_End_Date__c=dueDate,Customer_Success_Manager__c='Jeff Tucker',ARR__c=500);
    insert a;
    Opportunity o = new Opportunity(Name='abc',AccountId=a.Id,CampaignId=c.Id,
                    StageName='Legal',Amount=5000,CloseDate=d,NextStep='Open',AutoCreatedFlag__c=false);
                    
    for(Account acc:[select id,Name,Service_End_Date__c,Customer_Success_Manager__c,ARR__c
    from Account acc
    where
     (Id NOT IN (select AccountID from opportunity
    where AutoCreatedFlag__c = true ))]){
    
    if(a.Service_End_Date__c!=NULL){
    
        Integer numberDaysDue= d.daysBetween(a.Service_End_Date__c);
        
        if(numberDaysDue<=60)  {
        
            Opportunity Op= new Opportunity();
            op.Name=a.Name;
            op.StageName='Legal';
            op.Amount=a.ARR__c;
            op.AccountId=a.ID;
            op.CloseDate=Date.today();
            op.Customer_Success_Manager__c=a.Customer_Success_Manager__c;
            op.NextStep='Won';
            op.OwnerID='005d0000001Kt9D';
            op.AutoCreatedFlag__c = true;
            insert op;
            
           // Id pricebookId = Test.getStandardPricebookId();
           List<PriceBookEntry> entryList = new List<PriceBookEntry>();
           Pricebook2 stdpb = [SELECT Id FROM Pricebook2 WHERE IsStandard = true]; // Select Price Book
           PricebookEntry standardPrice = new PricebookEntry(
           Pricebook2Id = stdpb .Id, Product2Id = prod.Id,
           UnitPrice = 10, IsActive = true);
          // entryList.add(standardPrice );
           
           
           Integer counter = [select count()  FROM PriceBookEntry where Product2.Id=:prod.Id And
        PriceBook2.isStandard=true AND UnitPrice=10];
        
        entryList.add(standardPrice );
        if(counter==0){
        insert entryList;
        }
           
           
           
          // insert entryList;
           
           String z=prod.Id;
           
           
           List<PriceBookEntry> priceBookList = [select Id, Product2Id, Product2.Id, Product2.Name FROM PriceBookEntry
           where (Product2.Id=:z) And (PriceBook2.isStandard=true) LIMIT 1 ]; // Get the Price Book entry ID that we entered in the previous step
        OpportunityLineItem oli = new OpportunityLineItem(); // Create new Opportunity Product
        oli.OpportunityId = op.Id;                           
        oli.PricebookEntryId=priceBookList[0].Id;       // PricebookentryID of the existing pricebook entry for the specific product
        oli.UnitPrice =10;                       // Sales Price (or List Price)
        oli.Quantity=1;
        insert oli;
           
           
        
        }
    
    }
    
    
    }
    
    
    
    
    
    
    
    
    
    
    
    }
    
    }



 
Hey all,

Wondering if anyone can suggest reasons as to how code coverage could suddenly drop in a production org.

We have a development shop with several developers working on our code base.  Yesterday at around noon, one of us successfully deployed a change set with no issues.  Later in the afternoon, another change set failed for the same developer, citing "Code Coverage Error".  The funny thing is, it doesn't appear to have actually tried to run the tests, as the "Run Apex Tests" chart doesn't show any progress.

We thought that perhaps some flows/workflow rule changes could be to blame, but our setup audit trail doesn't show any changes to these.

We are also seeing some odd behaviour on test execution in our production org, with the apex test execution page showing tests failed, but when you click the line to see detail, it shows as passed.  It also displays a weird message, naming the class by id?

odd apex test runner output
  • March 10, 2015
  • Like
  • 0
I have a new field I created called Client lead Source.  I would like to name that field required based on 2 other picklist fields called "Primary Lead Source" and "Secondary Lead Source".  Once the picklist value for both is equal to "Client", this new field would be required.  I am not exactly sure how to accomplish this.
Hey all,

Anybody taking the Process Bulider for a walk yet?  (I've heard it called the Process Builder, Visual Workflows, etc).

I'm trying to do something I do a lot in code; drop some breadcrumb objects when an object moves between two states.  To do this, I link to the object changin and set a "From" and "To" filed value.  In apex, I do this in a before update trigger and grab the values from oldMap and newMap.

In the process bulider, I can access "Priorvalue" in a decision block.  During the "Create" action, however, I can't get at the old value; I only have access to select [Object].field, or to "hard code" the value I want to go into the field.

Anyone else out there trying to do something similar?
  • October 28, 2014
  • Like
  • 0
I am part of the flow trigger pilot.

I have a custom object that tracks parts on a bill of materials (product parts). I have another object that tracks a simple production forecast for the products (MRP Forecast) - I have built a flow trigger that evaluates the MRP forecast and creates individual requirements records on a 3rd custom object that is Master Detail to the forecast object for each product on the bill of materials for the product specified in the forecast. (Bills of Material can be anywhere from 1 to 200 part numbers)

It works perfectly if I add or edit a forecast in the native salesforce interface - but we have hundreds of products, and each product needs a separate forecast for each month - so I need to be able to upload my forecast records en mass.

I tried an upload of 30 forecast records and it failed on the record insert: "common.exception.ApiException: record limit reached. cannot submit more than 200 records into this call".

Is there anyway I can "bulkify" the flow so that it collects multiple requests and handles them more elegantly?

Thanks!
-R

Hi,

 

I am using ANT migration tool to deploy components between the sandboxs and  prod. during the deployment  If there are any failures  where can i check debug logs. 

 

 

Thanks,

Shan

Hey there Apexers,

 

I'm trying to deploy some code from my Sandbox to my production Enterprise org.  While deploying, the code generates a number of failures and as such cannot deploy.  My issue is that I cannot figure out why it fails.  

 

Running "All Tests" on both my production and sandbox org produces no errors

  • note: actually 14 failures, but they're all in managed packages from 3rd party vendors; marketo, geopoint, etc.
  • note 2: this is a functionality update to code previously deployed from sandbox to production

The "Deployment Results" page lists a table of failures, the rightmost column saying: 

 

 

Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, NewCampaignMemberTrigger: execution of AfterInsert caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or c...

 

As the text is truncated, I'm not really getting any information about why it failed.  This is compounded by the fact that running the named test on both production and sandbox produces a pass; both as an individual test run and as a result of clicking "Run All Tests" from the Apex Class home page.

 

I've searched google with chunks of the message and found points about non-selective queries, etc, but as I have a lot of triggers I can't track down exactly what query is giving the problem.

 

 

  • February 15, 2012
  • Like
  • 0

I'm trying to use the Force.com Migration Tool to make a Developer Edition org an exact copy of what we've configured and developed in our Production org. Retrieving the metadata hasn't been an issue but I've hit some roadblocks while attempting to deploy everything to the Developer org. From the looks of it, the errors are mostly due to dependencies.

 

Has anyone successfully done this? If so, I'd appreciate it if you could share any tips or lessons learned as it would save me some time trying to figure it out. Let me know if you need additional info from me as well.

 

 

Hey all,

 

On the "Schedule Apex" page (/setup/Monitoring/Scheduled Jobs) there's a "Manage" button next to each job I have set up.  I initially set up a job to expire on the 1st of Nov and now I want to edit the "End" to push it out a few months into the future. The page you get when you hit "Manage" alows you to edit the different fields (start, end, days of the week, time of day) but there's no save button; only Cancel and Delete.  Hitting the enter key on a field to submit the form doesn't doesn't save my changes.  I know I can delete this one and enter another one on the same code, but it seems like the save button was just forgotten on this page.  Any thoughts?

  • November 22, 2011
  • Like
  • 0

Hello all,


Seeing some odd behaviour during some data cleanup.  We had a Contact c on the wrong Account a1 with an OpportunityContactRole ocr1 on Opportunity o1, o1.accountid=a1.id.
C was actually supposed to be attached to Account a2, with Opportunity o2.accountid = a2.id.  C was edited to move over to a2, ie c.accountid = a2.id.
After this move, all of the tasks on o1 associated with c stayed put on o1.  I wrote a small script to scrape o1's tasks, detect what needed to be moved over, and moved them (ie whatid=o2.id).  This worked fine for most of the tasks.
However, there are some tasks left over with whoid=c.id and whatid=o1.id.  When I go to o1's detail page in the sfdc ui, they still show in the related activities list.

 

The odd part:
Querying for tasks (using force.com explorer) related to o1 doesn't return the problem task that should have moved but didn't.   Further, I tried to query for pt's info in Force.com explorer:  select id, whoid, whatid, subject from task where id='00T8000001JEj18'.  Much to my surprise, this query returned no result.

 

Question:
Under what circumstance will the front end show you an object, but that object cannot be queried from the database?  As a further note, I also queried "Event" for the same id and get nothing; I'm slightly confused by the Task/Event/Activity dual-/tri-ality so I figured I'd give it a shot; however the detail page for the object I'm looking for has the Task layout and says "Task" in the top of the detail page.


  • September 21, 2011
  • Like
  • 0

Trouble with change sets:

 

1. Create change set in Full Copy sb, moving to Prod.

2. Upload set.

3. Set deploy fails because of missing field (in this case I forgot to add Record Types).

4. Go back to Sandbox, clone Change Set, Add Record Types.

5. Click Upload...get an error message:

 

Validation Errors While Saving Record(s) There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Package member already exists". 

 

Uhhh...what? Why?

 

I deleted the old failed change set in production in case there was some channel conflict or something weird but that doens't help. Nothing I do resolves the issue. I'm forced to completely recreate the change set and hope for the best the second time around.

 

Anyone else see this?

 

By the way:

Using Chrome - when trying to 'remove' a component.. the removal happens except the FIRST component in the list of components is removed! not the component I was trying to remove!... logged in with Firefox and the removal mechanism works as expected. Argh. Bugs. : (

Hey all,

 

Apex newbie here.  Tried researching this here and through google, can't seem to find an answer.

 

I have a trigger on CampaignMember, after insert.  I'm trying to do a basic lead scoring implementation by counting the number of campaigns that Contacts enter.  I'm writing out values with debug statements and it would seem to me that everything hooks together as it should, but after the event, the Contacts don't retain the values set by the trigger.  Is it that you cannot modify a Contact from a CampaignMember trigger?  If so, is there a place where you can see these types of rules laid out?  I read through all the Trigger documentation in the Apex Developers Guide and can't see any such restrictions.

 

Here's the jist of the code:

 

 

trigger NewCampaignMemberTrigger on CampaignMember (after insert) 
{
    //CampaignHelper and ContactHelper are utility classes that house some convenience methods.  
    //I've outlined the SOQL queries that take place in comments under each call
    Set</*Campaign*/ID> campaignIDs = CampaignHelper.getCampaignIDs(Trigger.new);
        //rolls up Trigger.new[n].campaignID into a Set and returns
    Set</*Contact*/ID> contactIDs = ContactHelper.getContactIDs(Trigger.new);
        //rolls up Trigger.new[n].contactID into a Set (where not null) and returns
    
    Map</*Campaign*/ID, Campaign> campaignMap = CampaignHelper.getCampaignMapByID(campaignIDs);
        //return new Map<ID, Campaign>(
        //  [select id, buyers_cycle_score__c from Campaign where id in: campaignIDs]
        //);
    Map</*Contact*/ID, Contact> contactMap = ContactHelper.getMapByID(contactIDs);
        //return new Map<Id, Contact>(
        //    [select id, AccountId, buyers_cycle_score__c from Contact where id in: contactIDs]
        //);
    List<Contact> updatedContacts = new List<Contact>();
    
    for(CampaignMember cm: Trigger.new)
    {
        if(cm.contactID != null)
        {
            Contact contact = contactMap.get(cm.contactID);
            
            Decimal campaignScore = campaignMap.get(cm.campaignID).buyers_cycle_score__c;
            System.debug('Campaign Score:' + campaignScore);
            //in this example: 5.00
            Decimal existingOpportunityScore = contact.buyers_cycle_score__c == null ? 0 : contact.buyers_cycle_score__c ;
            System.debug('Exist Opportunity Score:' + existingOpportunityScore);
            //in this example: 0.00
            contact.buyers_cycle_score__c = existingOpportunityScore + campaignScore;
            System.debug('Buyers Cycle Score:' + contact.buyers_cycle_score__c);
            //in this example: 5.00
            updatedContacts.add(contact); 
        }
    }
    
    try 
    {
     update updatedContacts;
    }
    catch (DMLException e)
    {
        System.debug('contact update failed: '+e);
     }
}

 

  • November 17, 2010
  • Like
  • 0

Hi,

Am unable to refresh any of the resources in the IDE from the server.

When am trying to refresh a page from the web, getting an Exception saying:

 

 

Unable to refresh resource 'MileaeExension.cls':
com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Unable to refresh resource 'MileaeExension.cls':


com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Please assist to rectify the issue. 

 

Thanks in advance,

VNath

Morning all,

     I've been looking at this for a day or so now but I cannot find a way to do what I'm after..maybe someone here has an idea.

 

We have a workflow that sets the case status to PENDING when an incoming email is received on a case (we use email2case).  That works fantastic and easily lets the engineer know they have work to do on this case.  Further, we "auto nag" every 1,2,4 hours if the email hasn't been read.

 

However.  Currently, the engineer has to manually change the case status when they have read the email to stop the nagger.  I'd like to change this automatically when they have read the email (where read is defined as reading in SF.com).  So I have a new workflow on the Email object that says:

 

(Email Message: Status equals Read) and (Email Message: Is Incoming equals True)
Given that the email message status changes from NEW to READ when you read the email in SF.  My problem?  The workflow isn't firing even though the email status is changing.  I have the eval critiera on the workflow set to "Every time a record is created or edited" but I've also tried "...did not previously meet".
So the question.  Is there a way with workflows to change the case status when an email is read?
Thanks!
Dave
  • February 18, 2010
  • Like
  • 0

Hey guys,

 

needed a way to convert from a 15 digit ID to an 18 digit one.

Found the javascript version for just such an action here: http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=13148

 

tried to make my own apex version but the last digit keeps coming out wrong.  Any Ideas?

 

Thank's

 

 

 

String id = '001Q0000002NXad'; //a sample id

 

String suffix = '';

for(integer i=0;i<3;i++){

Integer flags = 0;

for(integer j=0;j<5;j++){
String c = id.substring(i*5+j,i*5+j+1);

if(c >= 'A' && c <='Z'){

flags += 1 << j;
}
}

if (flags <= 25) {

suffix += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.substring(flags,flags+1);

}else suffix += '012345'.substring(flags-26,flags-26+1);
}

System.debug('15-DIGIT:'+Id);
System.debug('18-DIGIT:'+Id + suffix);

 

 

 

Message Edited by astro on 05-01-2009 10:04 PM
Message Edited by astro on 05-01-2009 10:10 PM
  • May 01, 2009
  • Like
  • 0