• Art Smorodin
  • NEWBIE
  • 219 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,

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
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!!!!!