• Art Smorodin
  • NEWBIE
  • 204 Points
  • Member since 2014
  • Senior Business Systems Analyst / SFDC Admin
  • Bullhorn

  • Chatter
    Feed
  • 6
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 41
    Replies
Hi All,

Is there is any standard method to convert the following string value to salesforce date format

december 14, 2014 To salesforce date format
  • December 30, 2015
  • Like
  • 0
Hi,
I am new to apex trigger and got stuck while doing a requirement to wite trigger to update parent record status to completed when all its child is status is completed. Paretnt is a custom object and child (task) is sobject. The issue is folloiwng trigger always update the parent status to 'Completed' whenever a child status is set to 'Completed' eventhough there are child records which are not in completed status. Expected here is since there are not 'Completed' child records exist, parent status should not have been updated to completed. Any help is greately appriciated.  

trigger UpdateMilestoneStatus on Task (after insert, after update) {
    Set<String> whatId = new Set<String>();
    Integer counter = 0;
    for (Task t : Trigger.new) {
        whatId.add(t.WhatId);
    }
    List<Milestone__c> milestn = [SELECT Id, Status__c FROM Milestone__c WHERE Id =: whatId];
  
    for (Task t : Trigger.new){
                   
              
                if(t.Status != 'Completed')
                {
                  counter++;
                }
            
        }
         
    for (Milestone__c c: milestn) {
        
        
            c.Status__c = 'Completed';
           
   
    }
    
    if (counter == 0){
    update milestn;}

}
Hi all, is it possible to use an opporunity line item as a master object in a master detail relationship, i want something like:

Opp lineitem
      Opp lineitem breakdown

thanks
Team,

I have created an Apex Trigger and Class to populate a field based on the values in 2 other fields.  

The trigger works like a charm, however I can not get the test class I created past 51 percent.  

Can anyone save the day by looking over the following Triiger, class, and test class to advise me where I need to beef up the test class to promote to my production environemnt?

Thank you in advance for your help!

Shawn

Trigger Code

trigger TimeZoneextract on SVMXC__Service_Order__c (before insert, before update) {

List<SVMXC__Service_Order__c> Service_Orders = Trigger.new;
    TimeZoneOffsetextraction.TimeZoneextract(Service_Orders);

Class Code

public class TimeZoneOffsetextraction {
    public static void TimeZoneextract(List<SVMXC__Service_Order__c> Service_Orders) {
   
        for (SVMXC__Service_Order__c w:Service_Orders){
        
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'GMT'){
        w.Time_Zone_Offset__c = '-8';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'GMT'){
        w.Time_Zone_Offset__c = '-7';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'GMT'){
        w.Time_Zone_Offset__c = '-6';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'GMT'){
        w.Time_Zone_Offset__c = '-5';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'GMT'){
        w.Time_Zone_Offset__c = '-10';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'GMT'){
        w.Time_Zone_Offset__c = '-10';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'AST'){
        w.Time_Zone_Offset__c = '-4';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'AST'){
        w.Time_Zone_Offset__c = '-3';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'AST'){
        w.Time_Zone_Offset__c = '-2';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'AST'){
        w.Time_Zone_Offset__c = '-1';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'AST'){
        w.Time_Zone_Offset__c = '-6';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'AST'){
        w.Time_Zone_Offset__c = '-6';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'EST'){
        w.Time_Zone_Offset__c = '-3';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'EST'){
        w.Time_Zone_Offset__c = '-2';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'EST'){
        w.Time_Zone_Offset__c = '-1';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'EST'){
        w.Time_Zone_Offset__c = '-5';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'EST'){
        w.Time_Zone_Offset__c = '-5';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'EST'){
        w.Time_Zone_Offset__c = '-0';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'CST'){
        w.Time_Zone_Offset__c = '-2';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'CST'){
        w.Time_Zone_Offset__c = '-1';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'CST'){
        w.Time_Zone_Offset__c = '-0';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'CST'){
        w.Time_Zone_Offset__c = '+1';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'CST'){
        w.Time_Zone_Offset__c = '-4';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'CST'){
        w.Time_Zone_Offset__c = '-4';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'MST'){
        w.Time_Zone_Offset__c = '-1';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'MST'){
        w.Time_Zone_Offset__c = '-0';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'MST'){
        w.Time_Zone_Offset__c = '+1';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'MST'){
        w.Time_Zone_Offset__c = '+2';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'MST'){
        w.Time_Zone_Offset__c = '-3';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'MST'){
        w.Time_Zone_Offset__c = '-3';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'PST'){
        w.Time_Zone_Offset__c = '-0';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'PST'){
        w.Time_Zone_Offset__c = '+1';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'PST'){
        w.Time_Zone_Offset__c = '+2';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'PST'){
        w.Time_Zone_Offset__c = '+3';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'PST'){
        w.Time_Zone_Offset__c = '-2';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'PST'){
        w.Time_Zone_Offset__c = '-2';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'AHST'){
        w.Time_Zone_Offset__c = '+2';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'AHST'){
        w.Time_Zone_Offset__c = '+3';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'AHST'){
        w.Time_Zone_Offset__c = '+4';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'AHST'){
        w.Time_Zone_Offset__c = '+5';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'AHST'){
        w.Time_Zone_Offset__c = '-0';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'AHST'){
        w.Time_Zone_Offset__c = '-0';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'CET'){
        w.Time_Zone_Offset__c = '-9';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'CET'){
        w.Time_Zone_Offset__c = '-8';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'CET'){
        w.Time_Zone_Offset__c = '-7';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'CET'){
        w.Time_Zone_Offset__c = '-6';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'CET'){
        w.Time_Zone_Offset__c = '-11';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'CET'){
        w.Time_Zone_Offset__c = '-11';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'EET'){
        w.Time_Zone_Offset__c = '-10';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'EET'){
        w.Time_Zone_Offset__c = '-9';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'EET'){
        w.Time_Zone_Offset__c = '-8';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'EET'){
        w.Time_Zone_Offset__c = '-7';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'EET'){
        w.Time_Zone_Offset__c = '-12';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'EET'){
        w.Time_Zone_Offset__c = '-12';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'BT'){
        w.Time_Zone_Offset__c = '-11';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'BT'){
        w.Time_Zone_Offset__c = '-10';
        }
        IF (w.Account_Time_Zone__c == 'cST' && w.My_Time_Zone__c == 'BT'){
        w.Time_Zone_Offset__c = '-9';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'BT'){
        w.Time_Zone_Offset__c = '-8';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'BT'){
        w.Time_Zone_Offset__c = '-13';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'BT'){
        w.Time_Zone_Offset__c = '-13';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'CCT'){
        w.Time_Zone_Offset__c = '-16';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'CCT'){
        w.Time_Zone_Offset__c = '-15';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'CCT'){
        w.Time_Zone_Offset__c = '-14';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'CCT'){
        w.Time_Zone_Offset__c = '-13';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'CCT'){
        w.Time_Zone_Offset__c = '-18';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'CCT'){
        w.Time_Zone_Offset__c = '-18';
        }
        IF (w.Account_Time_Zone__c == 'PST' && w.My_Time_Zone__c == 'JST'){
        w.Time_Zone_Offset__c = '-17';
        }
        IF (w.Account_Time_Zone__c == 'MST' && w.My_Time_Zone__c == 'JST'){
        w.Time_Zone_Offset__c = '-16';
        }
        IF (w.Account_Time_Zone__c == 'CST' && w.My_Time_Zone__c == 'JST'){
        w.Time_Zone_Offset__c = '-15';
        }
        IF (w.Account_Time_Zone__c == 'EST' && w.My_Time_Zone__c == 'JST'){
        w.Time_Zone_Offset__c = '-14';
        }
        IF (w.Account_Time_Zone__c == 'AKST' && w.My_Time_Zone__c == 'JST'){
        w.Time_Zone_Offset__c = '-19';
        }
        IF (w.Account_Time_Zone__c == 'HST' && w.My_Time_Zone__c == 'JST'){
        w.Time_Zone_Offset__c = '-19';
        }
               }
 
            }        
        }

Test Class

@isTest(SeeAllData = true)
private class TestTimeZoneOffsetextraction {
    //test method
    static testMethod void testService_Order() {
       
      
       SVMXC__Service_Order__c w = New SVMXC__Service_Order__c (
       SVMXC__Case__c = '5004000000bSVJt',
       SVMXC__Company__c = '0014000000OCOao',
       SVMXC__Contact__c = '0034000001CZCxg',
       SVMXC__Order_Status__c = 'Open',
       SVMXC__Order_Type__c = 'Field Service',
       SVMXC__Priority__c = 'P4',
       Escallations__c = 'Tier 1 - AVI-SPL Field Techs',
       Is_Billable_new__c = 'No',
       SVMXC__Purpose_of_Visit__c = 'Testing',
       SVMXC__Billing_Type__c = 'Contract',
       Alert_Message__c = 'Testing',
       Criticality__c = 'T&M',
       Rate_Category_wm__c = 'Metro 6-8pm',
       After_Hours_or_Holiday__c = 'No',
       Day__c = 'Weekday',
       Internal_Comments__c = 'Testing',
       Initial_Room_Availability__c = 'Testing',
       wm_desired_skills__c = 'Testing',
       Technician_wm__c = 'Test Tester',
       Technician_email_wm__c = 'test@test.com',
       SVMXC__City__c = 'Tampa',
       SVMXC__Street__c = '123 Anywhere street',
       SVMXC__Zip__c = '33615',
       SVMXC__Country__c = 'United States',
       SVMXC__State__c = 'WA',
       My_Time_Zone__c = 'MST',
       Time_Zone_Offset__c = '-1',
       SVMXC__Problem_Description__c = 'Testing',
       Dispatch_Detail__c = 'Testing');
       
       insert w;


        SVMXC__Service_Order__c pop1 = [SELECT Id, Account_Time_Zone__c FROM SVMXC__Service_Order__c Where ID =:w.ID];

system.debug(pop1.Account_Time_Zone__c);
       }
       
     
       
    }
Dear Salesforce developers,

I am new to APEX. I've been Salesforce support and consultant only within the scope of admin and configuration.
I am learning how to write trigger these days and I've been successful with most of it, but just this;

============================================================
trigger HW_CountContactQuant on Contact (after delete, after update, after insert) {
    List<Account> accList = new list<Account>();
    integer i = [SELECT Count() FROM Contact];
    
 if(Trigger.isAfter){
     if(Trigger.isInsert || Trigger.isDelete || Trigger.isUpdate){
         for(Contact gh1 : Trigger.old || Trigger.new){
         Account.ContactQuantity__c = i;
         }
     }
 }


}
================================

I am trying to create a trigger whenever Contact is inserted, updated and deleted, it will count the number of records and update certain field in "Account". Like, rollup summary.
there seems to be no error in my syntax but I keep having "Expression cannot be assigned".

Someone please please help? T_T
I am looking to create a trigger on attachments on the opportunity object. I want the trigger to look at the attachments area and if it sees attachment fill in the checkbox on the opportuntity for has attachments. This is what I have but I am receiving an error for line item 15 that says "expecting semi-colon received opptyids".. What does this mean and what would my fix be?

//*************************************************************************************
//Name : Does Opportunity Have Attachments
//Description : Completes the Attachments checkbox on opportunity to signify that
// there are attachments on this opportunity
//Created By : Rachel Linder (rlinder@insightinvestments.com)

//************************Version Updates**********************************************
//
//Version Updated Date Updated By Update Comments
//1 10/22/2014 Rachel Linder Initial creation of trigger
//
//*************************************************************************************
trigger AttachmentTrigger on Attachment (before insert) {
List opportunityList = new List();
Set opptyIds = new Set()
for(Attachment : trigger.New){
//Check if added attachment is related to the Opportunity or not
if(att.OpportunityID.getSobjectType() == Opportunity.SobjectType){
opptyIds.add(att.OpportunityID:);
}
}
opportunityList = [select id, Has_attachments__c from Opportunity where id in : opptyids];
if(opportunityList!=null && opportunityList.size()>0){
for(Opportunity oppty : opportunityList){
oppty.Has_attachments__c = true;
}
update opportunityList;
}
}

Thanks.
Hi all,
question which is bugging me, how do I take away permission from users to re-assign case owners.
Basically my problem is that some support reps in our org take easy tickets from the queue and leave the rest just hang there. We want to take it away from most people and just leave this functionality avalable just for few users.

What I am trying to achive: if the case is in the queue (aka owner is a queue and not a user), people with "Customer Support" profile can not click on the [Change] button next to ticket owner field. Only people with "customer Support manager" profile should be able to so so.
I have already taken away the "transfer records" permission from them, but the [Change] button is still there.
My current Organization-Wide Defaults on cases are set to Private and Grant Access Using Hierarchies is enabled (it is a Standard object and this option can not be modified).

Any input will be apreciated.
 
Hi All, 
question when I query TaskRelation table it comes back with a TaskId column ( for exapmle 00TU000000Sp000000). When I take this ID and paste it into URL it takes me dorectly into the Task, all look good. 
But now I try to query Task table (SELECT Id,OwnerId,Status,Subject FROM Task WHERE Id = '00TU000000Sp000000') it comes back empty: 
"Sorry, no records returned."
How is this possible? 
Please help. 
Hi can someone explain to me how Platform Licenses work? 

For example, all our users currently have Salesforce (Sales Cloud - Enterprise Edition) licenses, which as far as I understand gives you access to SF1 platform anyway. Now, we do have a field sales team which mostly works remotely using SF1 app and does not create too many records in the system (in most cases records are assigned to them by BRD's or RSM's), but mostly updates them. 

Is it possible for us to just purchase Platform licenses for that team instead of regular Salesforce Sales Cloud licenses (since they are cheaper)? This way these users will still be able to own records assigned to them by the RSM, make changes to the records. They will only need access to standard CRM functionality (Accounts, Contacts, Opportunities, Leads)

So in my mind I see it as this: new field sales person is hired, instead is purchasing a new Sales Cloud license for him/her at $125, I will just buy Force.com Enterprise App License at $25.  

Possible? Any Input will be appreciated. 
 
Hi, 

very general question. Can the record owner be someone other than "Salesforce" license user? 

I mean when I create a new user in the User Licnse type drop down I have 3 oprions: "Salesforce", "Chatter External" and "Chatter Free". If I create a new User X with "Chatter Free" license type, I can not assign any records to him/her, correct? 

Just want to check that my logic is correct, that only "Salesforce" type users can own records.  Are there any other type of user Licenses that can own records?
Hi all, 

Has anyone played around with Data Loader in Win Server? I have written some scritps in my PC, which runs Win 7 and they work like a charm. But after I copy them over to our local VM which runs Win Sever, they appear not to be working correctly. I have even tryied re-doing the entire proess from scratch, doing new keys and everything, still no luck. 

If you are interested in looking at the errors, here they are: 
C:\Users\myUser\Salesforce.com\Data Loader\bin>process.bat "C:\Users\myUser\Salesforce.com\Data Loader\Newtest" csvAccountExtractProcess
2015-07-02 14:03:11,499 INFO  [main] controller.Controller initLog (Controller.java:389) - Using built-in logging configuration, no log-conf.xml in C
\Users\myUser\Salesforce.com\Data Loader\bin\log-conf.xml
2015-07-02 14:03:11,515 INFO  [main] controller.Controller initLog (Controller.java:391) - The log has been initialized
2015-07-02 14:03:11,515 INFO  [main] process.ProcessConfig getBeanFactory (ProcessConfig.java:103) - Loading process configuration from config file:
:\Users\myUser\Salesforce.com\Data Loader\Newtest\process-conf.xml
2015-07-02 14:03:11,609 INFO  [main] support.AbstractApplicationContext prepareRefresh (AbstractApplicationContext.java:495) - Refreshing org.springf
amework.context.support.FileSystemXmlApplicationContext@1be0f0a: startup date [Thu Jul 02 14:03:11 EDT 2015]; root of context hierarchy
2015-07-02 14:03:11,671 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:315) - Loading XML bean definition
 from URL [file://C:/Users/myUser/Salesforce.com/Data Loader/Newtest/process-conf.xml]
2015-07-02 14:03:16,233 ERROR [main] process.ProcessConfig getProcessInstance (ProcessConfig.java:96) - Error loading process: csvAccountExtractProce
s configuration from config file: C:\Users\myUser\Salesforce.com\Data Loader\Newtest\process-conf.xml
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from URL [file://C:/Users/myUser/Salesforce.com/D
ta Loader/Newtest/process-conf.xml]; nested exception is java.net.UnknownHostException: C
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:13
)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
        at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
        at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:84)
        at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(ProcessConfig.java:105)
        at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(ProcessConfig.java:93)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRunner.java:287)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRunner.java:273)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:246)
Caused by: java.net.UnknownHostException: C
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.NetworkClient.openServer(Unknown Source)
        at sun.net.ftp.FtpClient.openServer(Unknown Source)
        at sun.net.ftp.FtpClient.openServer(Unknown Source)
        at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Source)
        at org.springframework.core.io.UrlResource.getInputStream(UrlResource.java:125)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
        ... 17 more
2015-07-02 14:03:16,248 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) - Failed to create process
com.salesforce.dataloader.exception.ProcessInitializationException: Error loading process: csvAccountExtractProcess configuration from config file: C
\Users\myUser\Salesforce.com\Data Loader\Newtest\process-conf.xml
        at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(ProcessConfig.java:97)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRunner.java:287)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRunner.java:273)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:246)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from URL [file://C:/Users/myUser/Sales
orce.com/Data Loader/Newtest/process-conf.xml]; nested exception is java.net.UnknownHostException: C
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:13
)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
        at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
        at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:84)
        at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(ProcessConfig.java:105)
        at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(ProcessConfig.java:93)
        ... 3 more
Caused by: java.net.UnknownHostException: C
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.NetworkClient.openServer(Unknown Source)
        at sun.net.ftp.FtpClient.openServer(Unknown Source)
        at sun.net.ftp.FtpClient.openServer(Unknown Source)
        at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Source)
        at org.springframework.core.io.UrlResource.getInputStream(UrlResource.java:125)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
        ... 17 more

Any input will be highly appreciated.

Thank you,
Art.
 
Hi all, 

I am trying to make some changes to the class "ChatterAnswersAuthProviderRegistration" (in particular I want to disable the "UserPermissionsChatterAnswersUser" setting). But the funny thing is that I can only see this class in Production and not in the Sandbox. I thought that something is simply not enbaled in the Sandbox, but the behaviour in Sandbox and Prod is identical. This tells me that this class is there but is invisible for some reason. 

Any ideas what might be going on? 
Hi All, 

question regarding Formula field Export. We are currently performing data cleaning in our Org and would like to see the actuall formulas behind the formula filds in order to determin if they are useful or not. What I mean is that for example if I have a formula on the Lead which pulls Owner's Division value I would actually like to see $Owner.Division 

So when I run a report/export/some tool I would see something like:

Lead Owner Division ,   Lead_Owner_Division__c,   Formula (Text) ,   $User.Division

Do you know of any such tool available or if I can actually do it via DataLoader or the Workbench? 

Thanks,
Art.
Hi All, 

looking to see if anyone else had this problem before. I am trying to crate some new custom activity fields. We were somewhat close to the limit, so before creating new custom formula type fields I removed a few unused/redundant fields from the Activity object. Now, we have more than enough fields available but every time I try to create a new formula field i am receiving and error message: 
Unable to Access Page
The value of a parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.
Any idea what might be cuasing this? 

I saw some post saying that it might be due to Roll-up Summary feilds, but it has been more than 72 hours, surly by now they should have completed re-calculating. SF support has not responded yet so I an asking you guys. 

Please help. 


 
Hi All, 

Looking to see if someone had similar issue and how did you solve it. 
Our current process: When you create a new Task and select one of particular “Sales Activity Type”  the “Comments” field on the task will be updated right away using  JS with a template. Those templates are stored as a static resource “WinTemplates”. On the home page we have an HTML areal component which makes the JS call and does the injection of the text if conditions are met. But in Summer 15 release this component will no longer be supported.

From what I was able to find online, it is recommended to use VF pages, but there is not way I can make it all happen in the next few days (out SF instance gets updated this weekend, June 13th). We have something near 14 different Task record types and page layouts for different Profiles. So, I guess it wiuld involve a lot of programing to meet our criteria.

Have anyone seen an easier workaround this issue? Something I can implement in a day or two? 

I have found this solution, but could not make it work (http://salesforce.stackexchange.com/questions/38918/end-of-javascript-sidebar-workarounds).

Any input will be appreciated. 
 
Hi all, 

I am having some problems with a trigger I have developed on a Task object. The idea is that if a Task is created and "Name" (WhoId) field is populated with a Lead, it will capture some fields from that Lead and store them on the Task. 

Now, when I have a Lead already in the system and manually create an Activity/Task from it everything works perfectly. Task is being created and fields on the Task are being populated with values from that Lead. But, we also have Marketo integrated with out SF. The way it works is as follows: when a certain score is reached by a Lead inside Marketo, that Lead is pushed into SF. And at the same time Task is being created on that Lead and also pushed into SF. And this is where I am having problems. I can see new Leads pushed into SF and Task being ceated for those Leads as well (all done by Marketo Integration usaer). But fields are not populated. 

Looking at the debug logs it does look to me that my trigger is being invoked, but no fields are populated. 

What am I missing? Any ideas. 
 
trigger Inquiry_Tracking on Task (after insert) {
    BypassTriggerUtility u = new BypassTriggerUtility(); 
    if (!u.isTriggerBypassed())     // custom setting we have to bypass triggers when doing mass update/insert
    { 
    
      Task[] TskIdNew = Trigger.new;  
      Task[] TskIdOld = Trigger.old;
      List <Task > myTskList = New List<Task >();
      List <Lead > FindLead = New List<Lead >();
      String MAN;
      String LR;
      String LHQS;
      
      InquiryClass INQ = new InquiryClass();    // the class where queries are ran
      
      myTskList =INQ.returnthistskid(trigger.new[0]);
      if(checkRecursive.runOnce()){
      for (Task TaskLoop :myTskList){
        FindLead = INQ.FindLead(TaskLoop.WhoId);
        if (TaskLoop.RecordTypeId == '012U0000000aTe4IAE' && TaskLoop.WhoId != NULL){  
            System.debug('Entered if');
            
                System.debug('FindLead zise is'+ FindLead.size());
                if (FindLead.size() != 0){
                    System.debug('Entered SIZE if');
                    MAN = FindLead[0].Last_Lead_Source__c;
                    System.debug('MAN = ' +MAN);
                    LR = FindLead[0].last_Lead_Source_Detail__c;
                    System.debug('LR ='+LR);
                    LHQS = FindLead[0].State;
                    System.debug('LHQS ='+LHQS );
                    TaskLoop.Marketing_Activity_Name__c = FindLead[0].Last_Lead_Source__c;
                    //TaskLoop.Last_Referrer__c = FindLead.last_Lead_Source_Detail__c;
                }
                
            TaskLoop.Marketing_Activity_Name__c =   MAN;
            TaskLoop.Last_Referrer__c = LR;
            TaskLoop.Lead_HQ_State__c = LHQS;
        }
        update myTskList;
        }
      }//FOR
    }
}
 
public with sharing class InquiryClass {
  
  Public Static List<Task> TskList= New List<Task>();
  List <Lead > FindLead = New List<Lead >();
  
  Public List<Task> returnthistskid (Task TskRec){
      TskList= [ Select id, RecordTypeId, WhatId, WhoId,   Marketing_Activity_Name__c, Last_Referrer__c, Offer_ID__c from Task WHERE Id =:TskRec.Id];
      return TskList;
    }
    
    Public List<Lead> FindLead (Id whoId){
        FindLead = [ Select id, Last_Lead_Source__c, last_Lead_Source_Detail__c, State from Lead where id =: whoId];
        return FindLead;
    }
}

Thank you in advance,
Art.
Hi, 

Please halp me with a problem I am having. Here is what I want to happen: from the Task which is assigned to me I click a button and I get to an Opp create wizard and some of the fields are pre-populatd using values form that Task. I am having some success, but am stuck at one point. 

First of all my Task has 4 custom fields wich I want to grab and use their values to pre-populate fileds on an Opp. User-added image

Now, I created a new button and placed it on the Task layout. The button is Detail Page Button and I am trying to use "URL Hack" to pre populate some of the fields. Here is the code for my button 
/006/e?
ent=Opportunity
&nooverride=1
&RecordType=012U0000000ZW7x
&00NU0000003aXaU=New
&opp4={!Account.Name}
&CF00NU0000003aZwA ={!Contract.Id}
&00NK0000001jB5V = {!Task.Type}      // custom field 
&00NK0000001jB5G = {!Task.Marketing_Activity_Name__c}   // custom field 
&00NK0000001jB5L = {!Task.Last_Referrer__c}   // custom field 
&00NK0000001jB5Q = {!Task.Offer_ID__c}   // custom field 
&retURL=%2F006%2Fo

As you can see I have 4 new fields on an Opportunity Object to accomodate the mapping, I grab their IDs and try to force task field values on them. 

Now the stange part. When I click on the "Create Opportunity" button it does take me to the Opp create wizard and my fields are blank, BUT the Opp wizard URL shows that values are there.

User-added image

Here is the full URL I get once on the Opp create wizard page:
https://cs9.salesforce.com/006/e?ent=Opportunity&nooverride=1&RecordType=012U0000000ZW7x&00NU0000003aXaU=New&opp4=Test+Account+05&00NK0000001jB5V%20=%20Outbound+Prospecting&00NK0000001jB5G%20=%20Marketo+Push+2&00NK0000001jB5L%20=%20www.wsj.com&00NK0000001jB5Q%20=%209876543210&retURL=%2F006%2Fo

Any ideas what might be causing this behaviour? I am completely lost. My "URL Hack" works for some othe fields, but not for these. 

Any input will be appreciated.
Hi, 

I have been recieving an Apex governor limit warning (Number of SOQL queries: 97 out of 100) after making an update on an Opportunity and decided to look into reasons behind it. Now I am confused and need help. 

Here is the deal. We have 3 or 3 different triggers on an Opportunity object, but for now lets concentrate on one. Trigger name is "Update_Split_Quota" and it is after update type trigger. Here is the code (I know it is not idel, it is still work in proggress):
trigger Update_Split_Quota on Opportunity (After Update) {
     
     Opportunity[] OppIdNew = Trigger.new;
     Opportunity[] OppIdOld = Trigger.old;
     if (Trigger.isAfter){
         List<Opportunity> olis = [SELECT Id,AccountId FROM Opportunity WHERE Id IN: Trigger.newMap.keySet()];
      for(Opportunity opp: olis){
          List<OpportunitySplit> oppsplit = [SELECT Id, OpportunityId, SplitOwnerId, Sales_Quota__c, Legal_Accepted_Date__c FROM OpportunitySplit WHERE OpportunityId = :opp.id];
            Account[] account = [Select OwnerId FROM Account Where ID = :opp.AccountID];
            if(OppIdNew[0].Order_Type__c=='Services Only'&& OppIdNew[0].StageName == 'Closed Won'){
                opp.OwnerId = account[0].OwnerId;
                //update opp;
            }          
          for (OpportunitySplit os:oppsplit) {
              if(os.Legal_Accepted_Date__c != null) { //Only run the trigger if legal accepted
                  date Month_Start = os.Legal_Accepted_Date__c.toStartOfMonth();
              
                  //date Month_End = Month_Start.addMonths(1);
                  List<Sales_Quota__c> sales = [SELECT Id, User__C,Month__c, Quarter__c FROM Sales_Quota__c WHERE (User__C = :os.SplitOwnerId) AND (Month__c=:Month_Start) LIMIT 1];//(Quarter__c = THIS_YEAR) AND (User__C = :oppsplit.SplitOwner.id)
                  
                  if(sales.size()!=0) { //for users who do not have quotas
                      Sales_Quota__c s = sales.get(0);
                      os.Sales_Quota__c=s.ID;//Sales_Quota__c = s.ID;
                      update oppsplit;
                  }
              }
          }
      }
      }
}
But when I do an update on an Opportunity it does exactly what I want it to do, and I immidiatly get an email with governor limit warning. So I decided to run a debug log to see what is going on, and this is the confusing part. In the log I see that this trigger is being called 6 different time. Each time it is called 3 Select statements inside it are run, and it add up to a lot (18 out 100 possible). My question is WHY DOES IT GET CALLED 6 DIFFERENT TIMES if I only update a single Opportunity (I update an existing Opp, not creating a new one. I simply switch the stage to "Closed Won").

Attached is a small snapshot of the Debug log file showing how my trigger is called and the number of time it is being called

Debug log snapshot
 
Hi all,

has anybody else experiensed this strange behaviour? When I login to my SF1 app ( Android 4.4.4) and want to enable push notifications for Tasks (the name of the option is "Assigns you tasks") I can not select it. Every timr I click on it, the app would either crash or will go back to the Home screen. I have tried uninstalling and re-installing the app, but it did not help. Also all the other options are working just fine and are selectable.

User-added image 

Any input will help. I am also creating a Support case for Salesforce, but I thought this community might be able to answer this qucker. 

-Art.
Hi all,
 
would love some advice from people in regards to future career. I currently work as a BA/SFDC Administrator. Have 3 years of experience working as an Admin and have both ADM 201 and ADM 211 certifications. Reason why I am looking for an advice is because our company is rather large (300+ users) but I am tied to the Sales department and due to high volume of requests coming from Sales I do not have much time left to work on anything else. I am currently the only one in the entire company to hold ADM 211 cert, and there are a lot of things I can do and help. Don't get me wrong, I love what I do, but I feel like I can be advancing much quicker and learn a lot more if I was able to get more exposure and work with other departments. 
So, in the future if I want to move to a more strategic position and work across an entire organization, what can I do right now to prepare for that? I want to learn more about Service cloud, but again I am limited when it comes to real life, hands-on experience. I do a lot of development work at the moment and planning on tacking DEV 401 in January.

Have any of you been in similar position? What did you do? What position did you move to next?
Would really appreciate any input.
-Art.
Does anyone else uses static resources on Task? 
This functionality was deployed before I joined the company, so now I try and wrap my head around it. 

How it currently works: Now VF Pages are used, the New Task button is Standard and has not been overwritten. When I create a new task and choose record type I see a normal edit window for tasks. But, where is a field called "Sales Activity Type", and if it is set to "Won" or "Won - Renwal", Comments field gets pre-populated with a template. I do not have to save the task to see pre-populated text. As soon as I pick "Won" from the list, it appears right away. Reminds me of JS behavior, but again it does not appear to me that VF Pages are used. 

I know exactly where this template is stored (in Static Resources) and its name, but I am trying to locate where this call is being made.  
Hi All, 

question regarding Formula field Export. We are currently performing data cleaning in our Org and would like to see the actuall formulas behind the formula filds in order to determin if they are useful or not. What I mean is that for example if I have a formula on the Lead which pulls Owner's Division value I would actually like to see $Owner.Division 

So when I run a report/export/some tool I would see something like:

Lead Owner Division ,   Lead_Owner_Division__c,   Formula (Text) ,   $User.Division

Do you know of any such tool available or if I can actually do it via DataLoader or the Workbench? 

Thanks,
Art.
Hi all,

I have created a new field within Campaign Members called "Role". A campaign member may have a role of "Author" for instance. What I'm trying to do is display the name of the Campaign Member with that Role within the Campaign page layout. So for instance:

I have a campaign called "Book Discussion" and there are a number of Campaign Members:

Name: Mike Smith
Role: Janitor

Name: Bill Smith
Role: Author

Name: Sandra Smith
Role: Assistant

When I click the Campaign I want to see a field (likely a formula field, read only) showing which of those members has the role of "Author". One of the reasons I want this is because I want to create a view that will show who has the Author "role".

Is there a way to do this? I tried to do this using formulas but I don't have the experience necessary.

Any help would be greatly appreciated.

Thank you,
Alan Miller
 

Hello all,

I have a list of accounts for which I am the product owner. I modified them all today for testing purposes, in order to have my custom field Last_Update__c = today.

In my VF page, I call my custom constructor which does something very simple (please note that I removed the code handling the exceptions for brevity reasons
 

public Account getAccount() 
{
    account = [SELECT Id, Name, Last_Status__c,Additional_Information__c,Ongoing_Problem__c,Last_Update__c FROM      Account WHERE (OwnerId = :UserInfo.getUserID()) AND (Type <> 'Dead') AND (Last_Update__c = LAST_N_DAYS:150) 
ORDER BY Last_Update__c LIMIT 1];
     return account;
 }

The idea should be to retrieve an account only when three conditions are all met. Third one is 
Last_Update__c = LAST_N_DAYS:150. In my understanding, this should mean: "select an account if Last Update was done more than 150 days ago". However, I get every account in the list as a result, even if they all have today as last_update__c field. What am I doing wrong?

Thanks in advance for your help on this.

Cheers, A.

I have added new fields to the picklist in "competitor's lost to" they are showing in the picklist at set-up but are not updating in the account field. How do I respolve this?  
I have a twe date/time fields: Date1__c and Date2__c.

I need to calculate working days between two date/time field excluding weekends with fraction value.

Eg., Date1__c = '2015 - 07 - 08 13:00'
        Date2__c = '2015 - 07 - 10 15:00'
        difference: 2.08
Hi all, 

I am trying to make some changes to the class "ChatterAnswersAuthProviderRegistration" (in particular I want to disable the "UserPermissionsChatterAnswersUser" setting). But the funny thing is that I can only see this class in Production and not in the Sandbox. I thought that something is simply not enbaled in the Sandbox, but the behaviour in Sandbox and Prod is identical. This tells me that this class is there but is invisible for some reason. 

Any ideas what might be going on? 
Hi All, 

looking to see if anyone else had this problem before. I am trying to crate some new custom activity fields. We were somewhat close to the limit, so before creating new custom formula type fields I removed a few unused/redundant fields from the Activity object. Now, we have more than enough fields available but every time I try to create a new formula field i am receiving and error message: 
Unable to Access Page
The value of a parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.
Any idea what might be cuasing this? 

I saw some post saying that it might be due to Roll-up Summary feilds, but it has been more than 72 hours, surly by now they should have completed re-calculating. SF support has not responded yet so I an asking you guys. 

Please help. 


 
Hi, 

Please halp me with a problem I am having. Here is what I want to happen: from the Task which is assigned to me I click a button and I get to an Opp create wizard and some of the fields are pre-populatd using values form that Task. I am having some success, but am stuck at one point. 

First of all my Task has 4 custom fields wich I want to grab and use their values to pre-populate fileds on an Opp. User-added image

Now, I created a new button and placed it on the Task layout. The button is Detail Page Button and I am trying to use "URL Hack" to pre populate some of the fields. Here is the code for my button 
/006/e?
ent=Opportunity
&nooverride=1
&RecordType=012U0000000ZW7x
&00NU0000003aXaU=New
&opp4={!Account.Name}
&CF00NU0000003aZwA ={!Contract.Id}
&00NK0000001jB5V = {!Task.Type}      // custom field 
&00NK0000001jB5G = {!Task.Marketing_Activity_Name__c}   // custom field 
&00NK0000001jB5L = {!Task.Last_Referrer__c}   // custom field 
&00NK0000001jB5Q = {!Task.Offer_ID__c}   // custom field 
&retURL=%2F006%2Fo

As you can see I have 4 new fields on an Opportunity Object to accomodate the mapping, I grab their IDs and try to force task field values on them. 

Now the stange part. When I click on the "Create Opportunity" button it does take me to the Opp create wizard and my fields are blank, BUT the Opp wizard URL shows that values are there.

User-added image

Here is the full URL I get once on the Opp create wizard page:
https://cs9.salesforce.com/006/e?ent=Opportunity&nooverride=1&RecordType=012U0000000ZW7x&00NU0000003aXaU=New&opp4=Test+Account+05&00NK0000001jB5V%20=%20Outbound+Prospecting&00NK0000001jB5G%20=%20Marketo+Push+2&00NK0000001jB5L%20=%20www.wsj.com&00NK0000001jB5Q%20=%209876543210&retURL=%2F006%2Fo

Any ideas what might be causing this behaviour? I am completely lost. My "URL Hack" works for some othe fields, but not for these. 

Any input will be appreciated.
Please help me resolve the following errors in the deployment settings of the production :

Component Errors

 

API Name
Type
Line
Column
Error Message
0 0 TestAllClass.Test_ApprovalCommentTrackOnQuote(); TestAllClass.Test_Stageupdate_Quote(), Details: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process was found.: []: [] Class.TestAllClass.Test_ApprovalCommentTrackOnQuote: line 254, column 1; System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process was found.: []: [] Class.TestAllClass.Test_Stageupdate_Quote: line 164, column 1
0 0 SendEmailForTaskEscalation, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is requiredPrevious (1 - 2 of 2) NextApex Test Failures

 

Class Name
Method Name
Error Message
TestAllClass Test_ApprovalCommentTrackOnQuote System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process was found.: []: []
Stack Trace: Class.TestAllClass.Test_ApprovalCommentTrackOnQuote: line 254, column 1
TestAllClass Test_Stageupdate_Quote System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process was found.: []: []
Stack Trace: Class.TestAllClass.Test_Stageupdate_Quote: line 164, column 1
I got following error in production.

Apex script unhandled exception by user/organization: 00580000005FYRy/00D80000000PQ16

Failed to invoke future method 'public static void updateSubs(List)' on class 'MDLiveIntegration' for job id '7078000001iFGgq'

caused by: System.DmlException: Update failed. First exception on row 0 with id a0q8000000QlTHsAAN; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, SubscriberUpdateTrigger: execution of AfterUpdate

caused by: System.AsyncException: Future method cannot be called from a future or batch method: MDLiveIntegration.deleteSubs(String, Id)

Trigger.SubscriberUpdateTrigger: line 55, column 1: []

Class.MDLiveIntegration.updateSubs: line 247, column 1

But in sandbox i don't get any error. Please give your suggestions.
Hi, 

I have been recieving an Apex governor limit warning (Number of SOQL queries: 97 out of 100) after making an update on an Opportunity and decided to look into reasons behind it. Now I am confused and need help. 

Here is the deal. We have 3 or 3 different triggers on an Opportunity object, but for now lets concentrate on one. Trigger name is "Update_Split_Quota" and it is after update type trigger. Here is the code (I know it is not idel, it is still work in proggress):
trigger Update_Split_Quota on Opportunity (After Update) {
     
     Opportunity[] OppIdNew = Trigger.new;
     Opportunity[] OppIdOld = Trigger.old;
     if (Trigger.isAfter){
         List<Opportunity> olis = [SELECT Id,AccountId FROM Opportunity WHERE Id IN: Trigger.newMap.keySet()];
      for(Opportunity opp: olis){
          List<OpportunitySplit> oppsplit = [SELECT Id, OpportunityId, SplitOwnerId, Sales_Quota__c, Legal_Accepted_Date__c FROM OpportunitySplit WHERE OpportunityId = :opp.id];
            Account[] account = [Select OwnerId FROM Account Where ID = :opp.AccountID];
            if(OppIdNew[0].Order_Type__c=='Services Only'&& OppIdNew[0].StageName == 'Closed Won'){
                opp.OwnerId = account[0].OwnerId;
                //update opp;
            }          
          for (OpportunitySplit os:oppsplit) {
              if(os.Legal_Accepted_Date__c != null) { //Only run the trigger if legal accepted
                  date Month_Start = os.Legal_Accepted_Date__c.toStartOfMonth();
              
                  //date Month_End = Month_Start.addMonths(1);
                  List<Sales_Quota__c> sales = [SELECT Id, User__C,Month__c, Quarter__c FROM Sales_Quota__c WHERE (User__C = :os.SplitOwnerId) AND (Month__c=:Month_Start) LIMIT 1];//(Quarter__c = THIS_YEAR) AND (User__C = :oppsplit.SplitOwner.id)
                  
                  if(sales.size()!=0) { //for users who do not have quotas
                      Sales_Quota__c s = sales.get(0);
                      os.Sales_Quota__c=s.ID;//Sales_Quota__c = s.ID;
                      update oppsplit;
                  }
              }
          }
      }
      }
}
But when I do an update on an Opportunity it does exactly what I want it to do, and I immidiatly get an email with governor limit warning. So I decided to run a debug log to see what is going on, and this is the confusing part. In the log I see that this trigger is being called 6 different time. Each time it is called 3 Select statements inside it are run, and it add up to a lot (18 out 100 possible). My question is WHY DOES IT GET CALLED 6 DIFFERENT TIMES if I only update a single Opportunity (I update an existing Opp, not creating a new one. I simply switch the stage to "Closed Won").

Attached is a small snapshot of the Debug log file showing how my trigger is called and the number of time it is being called

Debug log snapshot
 
Hi All,

Is there is any standard method to convert the following string value to salesforce date format

december 14, 2014 To salesforce date format
  • December 30, 2015
  • Like
  • 0
Hello, I am not a developer. I just manage our website's content. Our developer cannot be reached at the moment, but I hope some of you can assist me with our Live Agent issue. If you see the image below you can see that it's out of my screen. When I press CTRL + -, the chat box moves closer to the center and it blocks an element on our webpage.

I am using Mozilla's 33.1.1 and a Vista OS, 64bit (not sure if this info helps). Same error shows on my Chrome browser (latest version).

User-added image

Is there a way for me to tweak this code? This is the code:

<script type='text/javascript' language='javascript'>llactid=24911</script>
    <script type='text/javascript' language='javascript' src='http://t2.trackalyzer.com/trackalyze.js'></script>
<script type='text/javascript' src='https://c.la1w1.salesforceliveagent.com/content/g/js/32.0/deployment.js'></script>
<script type='text/javascript'>
liveagent.init('https://d.la1w1.salesforceliveagent.com/chat', '572d0000000PEos', '00Dd0000000di5A');
</script>
<img id="liveagent_button_online_573d0000000PEon" style="display: none; border: 0px none; cursor: pointer;margin-top: -1225px;position:absolute;z-index:1000;margin-left:1210px;" onclick="liveagent.startChat('573d0000000PEon')" src="http://www.emlogis.net/wp-content/uploads/2014/10/EmLogis_Live_Chat_Button-271x300.png" /><div id="liveagent_button_offline_573d0000000PEon" style="display: none;"><a href="#" onclick="window.open('http://emlogis.force.com/livechat/apex/PreChat?endpoint=https%3A%2F%2F8vf.la6cs.salesforceliveagent.com%2Fcontent%2Fs%2Fchat%3Flanguage%3Den_US%23deployment_id%3D572J00000008OK1%26org_id%3D00DJ0000002g5fF%26button_id%3D573J00000008OMl%26session_id%3D1cee6f7d-b8a4-4302-9e02-e6dcbcfd658f','cusname','fullscreen=no,resizable=no,height=400,width=600,scrollbars=no');" id="gform_submit_button_1" tabindex="10"><img style="border: 0px none; cursor: pointer;margin-top: -1225px;position:absolute;z-index:1000;margin-left:1210px;" src="http://www.emlogis.net/wp-content/uploads/2014/10/EmLogis_Leave_Message_Button-275x300.png"/></a></div><script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('573d0000000PEon', document.getElementById('liveagent_button_online_573d0000000PEon'));
liveagent.showWhenOffline('573d0000000PEon', document.getElementById('liveagent_button_offline_573d0000000PEon'));
});</script>
Hi

I have used the following code to update the field jobTime field, When i save the code i got "Error: Compile Error: Illegal assignment from String to Decimal at line". The Reason  Field type is "Number". I can not change the field type because "JobTime" field refered in somany place.
Can i Modify the following code? Is this possible? Kindly give any idea 
=================================
Code
=================================
public void JobTimeUpdate(List<Engineer_Checklist__c> newSSJList){
        List<ID> SSJIds= New List<ID>();
        List<Engineer_Checklist__c> SSJList= New List<Engineer_Checklist__c>();
        Integer Days;
        Integer Hours;
        Integer Minutes ;
        
        for(Engineer_Checklist__c SSJ:newSSJList){
            SSJIds.add(SSJ.id);
        }
        SSJList= [Select id,Start_Date_and_Time__c, End_Date_and_Time__c, FA_Job_Time__c from Engineer_Checklist__c where Id=:SSJIds ];
        
        for(Engineer_Checklist__c SSJ:newSSJList){
            Days=Hours=Minutes=0;
           
             if(SSJ.Start_Date_and_Time__c!=NULL && SSJ.End_Date_and_Time__c!=NULL ){
                Days=Date.ValueOf(SSJ.Start_Date_and_Time__c).daysBetween(date.valueOf(SSJ.End_Date_and_Time__c));    
                Hours = math.mod(integer.valueOf(((SSJ.End_Date_and_Time__c).getTime() - (SSJ.Start_Date_and_Time__c).getTime())/(1000*60*60)),24);                          
                Minutes = math.mod(Integer.valueOf(((SSJ.End_Date_and_Time__c).getTime() - (SSJ.Start_Date_and_Time__c).getTime())/(1000*60)),60);
                system.debug(Days +'***Days*** ' + '***Hours*** ' + Hours + '***Minutes*** ' + Minutes);
                SSJ.FA_Job_Time__c=Days + ' Days  ' + Hours + ' Hours  ' + Minutes + ' Minutes';  /*Error: Compile Error: Illegal assignment from String to Decimal at line" */
            }
            System.debug('SSJ.FA_Job_Time__c'+SSJ.FA_Job_Time__c);
        }
    }
HI please can anyone  resolve below code. Why i am getting System.Limit Exception. I am unable to find out the reason.

LA Detail ,LA Summery 2 objects...while i am inserting/Updating Bulk records getting this error. Its working while manually inserting 1 record.

trigger LAdetail on L_A_Detail__c (before insert,before update) {

set<string> Tset = new set<string>();
set<string> Cset = new set<string>();

set<string> Lset = new set<string>();

List<L_A_Detail__c> Dlist = new List<L_A_Detail__c>();

Map<string,string> LDetailMap1 = new Map<string,string>();
Map<string,string> LSumeryMap2 = new Map<string,string>();

for(L_A_Detail__c La : Trigger.new){
Tset.add(La.SE2_ID__c);
Cset.add(La.Appointment_State__c);
Lset.add(La.License_Number__c);
LDetailMap1.put(La.SE2_ID__c+La.Appointment_State__c,La.SE2_ID__c+La.Appointment_State__c);
}

List<L_A_Summary__c> LAlist = [select id,License_Number__c,SE2_ID__c,Appointment_State__c from L_A_Summary__c  where SE2_ID__c in:Tset And Appointment_State__c in:Cset And License_Number__c in:Lset];

for(L_A_Summary__c Al : LAlist){
LSumeryMap2.put(Al.SE2_ID__c+Al.Appointment_State__c,Al.SE2_ID__c+Al.Appointment_State__c);
}

for(L_A_Detail__c D : Trigger.new){
for(L_A_Summary__c S : LAlist){
string s1 = LDetailMap1.get(D.SE2_ID__c+D.Appointment_State__c);
string s2 = LSumeryMap2.get(S.SE2_ID__c+S.Appointment_State__c);

if(s1==s2){
if(D.Line_of_Business__c == 'Health'){
S.Health__c = True;
}

if(D.Line_of_Business__c == 'Life'){
S.Life__c = True;
}

if(D.Line_of_Business__c == 'Variable'){
S.Variable__c = True;
}

if(D.Line_of_Business__c == 'Annuity'){
S.Annuity__c = True;
}

if(D.Line_of_Business__c == 'Casualty'){
S.Casualty__c = True;
}

if(D.Line_of_Business__c == 'DI'){
S.DI__c = True;
}

if(D.Line_of_Business__c == 'Fixed'){
S.Fixed__c = True;
}

if(D.Line_of_Business__c == 'Long Term Care'){
S.Long_Term_Care__c = True;
}

if(D.Line_of_Business__c == 'Property'){
S.Property__c = True;
}

if(D.Line_of_Business__c == 'Variable Life'){
S.Variable_Life__c = True;
}

}
try{
update LAlist;
}
catch(DMlException e){
System.debug(e);
}
}


}
}
Error: Compile Error: Didn't understand relationship 'eMessage__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 230 column 25

my code:

Public static void mostRecentRead (List<eMessage__c> emsgList){
    List<Case> caslst = [Select CaseNumber,Most_Recent_Read__c,(select Name,Is_Read__c from eMessage__r) FROM Case  where Most_Recent_Read__c = false];
     if(caslst != null){
          for(eMessage__c m : emsgList){ 
                cas = [select id,casenumber,Most_Recent_Read__c from case where id =: m.Case_Number__c limit 1];
                if(cas != null)                  
                cas.Most_Recent_Read__c = true;                    
          }        
      update(cas);
    }
  }  

}

Actually this code is written for to update most recent read check box in case whenever Read field in eMessage(custom Object) is checked manually . If the eMessage object has the attachment and that attachment is read and manually checked Read checkbox in eMeassage object then the most recent read check box in case should update(as checked) automatically.

Please anyone help me out its urgent!!!!!