• Kannan N 10
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 16
    Replies
I am currently working on a requirement where I need to notify account owner if some other person (Non Account Owner) Logs a Call against their account . Notification could be in form of a chatter message or email should be sent out to the account owner.

Kindly help to acheive above mentioned requirements.

Many thanks in advance

Thanks & Regards,
Harjeet
Hi All,
I would like to write, instead of N, the current year in this table in a vf page:
 
<th style="width:15%" data-field="name">Yr N</th>            
<th data-field="price" colspan="5">N</th>                 
<th data-field="price" >N+1</th>
<th data-field="price">N+2</th>
<th data-field="price">Beyond N</th>
            
Any idea?

Thankyou!
I liked to create a HELP page using Visualforce.
I searched "Visualforce" in force.com but not finding.
Any pointer, how can I find this?
Thanks
Priya
Hello Every one,

I need to compare the old and new values in apex class.It works fine if i write the code in trigger.But i need this validation to be incroporated in handler class
Below is my trigger and Apex class 

if(Trigger.Isupdate && Trigger.Isbefore)
       {
            for(Contact Contacts : trigger.new)
       {
             if((Contacts.Secure_Start_Owner__c != Trigger.oldMap.get(Contacts.Id).Secure_Start_Owner__c) || (Trigger.oldMap.get(Contacts.Id).Secure_Start_Owner__c==null))
                { 
                   AssignSecureStartOwnerHandler.assignSecureStartOwneronUpdate(Trigger.newMap,trigger.new);
                 }
        }
       }

Method Name

   public void assignSecureStartOwneronUpdate(Map<Id, contact> leadMap, List<contact> Listlead){
                 List<Contact> updateLeads = new List<Contact>();
                 List<Contact> updateContacts = new List<Contact>(); 
                 List<Account> updateAccounts = new List<Account>();
                 List<User> updateUsers = new List<User>();
                    List<Id> LeadIds = new List<Id>();
                 Boolean cc = false;
                 List<Id> userIds = new List<Id>();
                 Id AccountId;
                 integer last; 
                 List<Account> accountIds;
        Set<Id> Nurse_Clinician = new set<id>();
        for(Contact lead:Listlead) 
        {
          Nurse_Clinician.add(lead.Nurse_Clinician__c);
        }
         List<Contact> thisClinician = [select AccountId, Account1__c, Id from Contact where Id IN:Nurse_Clinician];  
            System.debug('thisClinician@@@'+thisClinician);
         for(Contact leads:Listlead) 
        {  
           if(leads.Secure_Start_Owner__c==null)
          { 
                system.debug('SecureStartOwner' +lead.Secure_Start_Owner__c);
                final String conrecname = '(US) Patient/Consumer';
                RecordType conr = [Select Id,Name From RecordType where Name = :(conrecname)];
                System.debug('conr Id = '+conr.Id);
         if(thisClinician!=null && thisClinician.size()>0)
         {  
             System.debug('acc on nurse = '+thisClinician[0].Account1__c);
             AccountId = thisClinician[0].Account1__c;
         }
        if(leads.Place_of_Surgery_Hospital__c==null)
        {
            leads.Place_of_Surgery_Hospital__c = AccountId;
            updateLeads.add(leads);
        }
      
    }        
        if(AccountId !=null){
            
         System.debug('accountid on contact = '+AccountId);
         accountIds = [select Id, Last_Round_Robin_ID__c from Account where Id=:AccountId limit 1];
          system.debug('accountIds@@@@'+accountIds);
        if(accountIds!=null){
          if(accountIds[0].Last_Round_Robin_ID__c==null)
          {
             last = 0;
          }
          else{
              last = Integer.valueOf(accountIds[0].Last_Round_Robin_ID__c);
               }
        List<AccountTeamMember> atm = [Select UserId, TeamMemberRole, Id, AccountId From AccountTeamMember where AccountID=:accountIds[0].Id AND (TeamMemberRole = 'US Secure Start Patient Coord - US OST 1'OR TeamMemberRole = 'US Secure Start Patient Coord - US OST 2'
                                                          OR TeamMemberRole = 'US Secure Start Patient Coord - US OST 3'
                                                          OR TeamMemberRole = 'US Secure Start Patient Coord - US OST 4'
                                                          OR TeamMemberRole = 'US Secure Start Patient Coord - US OST 5')
                                      ];
           
            System.debug('atm = '+atm);
     if(atm!=null && atm.size()>0){
       for(AccountTeamMember a:atm){
                     
                    System.debug('atm.UserId = '+a.UserId);
                    userIds.add(a.UserId);  //all these users can be the secure start owner for this Lead  

     
                        }
                    }
            
            else{
                        //AccountTeam is not set then assign Secure Start ownership to the logged In user
                        Id loggedInUserId = UserInfo.getUserId();
                        userIds.add(loggedInUserId);
                    }
                if(userIds!=null && userIds.size()>0){
            //get the Round Robin ID from the user records
            List<User> users = [select Name, Round_Robin_ID__c, Last_Round_Robin_Assigned_At__c,Not_Assigned_SS_Owner_Recently__c, Id from User 
                                where Id IN:userIds ORDER BY Last_Round_Robin_Assigned_At__c ASC,Round_Robin_ID__c ASC];
            System.debug('users = '+users);
                    for(contact lead:Listlead){
                    if(last==0){
                /* never started assignment on this team - pick the first user from users and update the Last_Round_Robin_ID__c on contact */
                integer assigned;
                        //
                for(integer i=0;i<users.size();i++){
                    if(users[i].Not_Assigned_SS_Owner_Recently__c==true){
                        lead.Secure_Start_Owner__c = users[i].Id;
                        if(cc==false){
                            accountIds[0].Last_Round_Robin_ID__c = Integer.valueOf(users[i].Round_Robin_ID__c);
                            updateAccounts.add(accountIds[0]);
                        }
                        users[i].Not_Assigned_SS_Owner_Recently__c = false;
                        users[i].Last_Round_Robin_Assigned_At__c = System.now();
                        assigned = i;
                        updateLeads.add(lead);
                        updateUsers.add(users[i]);
                        system.debug('assigned ! :'+assigned);
                        break;
                    }
                    if(assigned==null ||assigned==0){
                        
                        System.debug('no user had flag checked');
                        //reset and pick first user // sort Users on the Last_Round_Robin_Assigned_At__c and pick first user
                     
                        lead.Secure_Start_Owner__c = users[0].Id;
                        if(cc==false){
                            accountIds[0].Last_Round_Robin_ID__c = Integer.valueOf(users[0].Round_Robin_ID__c);
                            updateAccounts.add(accountIds[0]);
                        }
                        users[0].Not_Assigned_SS_Owner_Recently__c = false;
                        users[0].Last_Round_Robin_Assigned_At__c = System.now();
                        assigned = 0;
                        updateLeads.add(lead);                        
                        updateUsers.add(users[0]); 
                    }
                }
                
                integer counter = -1;
                for(User u:users){
                    counter++;
                    if(counter!=assigned){
                        u.Not_Assigned_SS_Owner_Recently__c = true;
                        updateUsers.add(u);
                    }
                }
            }
            else{ 
                lead.Secure_Start_Owner__c = users[0].Id;
                if(cc==false){
                    accountIds[0].Last_Round_Robin_ID__c = Integer.valueOf(users[0].Round_Robin_ID__c);
                    updateAccounts.add(accountIds[0]);
                }
                users[0].Not_Assigned_SS_Owner_Recently__c = false;
                users[0].Last_Round_Robin_Assigned_At__c = System.now();
                System.debug('adding = '+users[0].Name);
                updateUsers.add(users[0]);
                updateLeads.add(lead);
                
                integer index = 0;
                integer endIndex = users.size()-1;
                System.debug('index = '+index+' till endIndex = '+endIndex);
                    while(endIndex>index){
                        users[endIndex].Not_Assigned_SS_Owner_Recently__c = true;
                        System.debug('adding = '+users[endIndex].Name);
                        updateUsers.add(users[endIndex]);
                        endIndex--;
                    
                    
           }
            }
                }
            }
                    
     }
                    
        }
    if(updateAccounts!=null && updateAccounts.size()>0){
            System.debug('updateAccounts = '+updateAccounts[0]);
            update updateAccounts;
        }
        if(updateUsers!=null &&  updateUsers.size()>0){
            update updateUsers;
        }
        
   }     
    
  // return null;
   
        
   
}

Thanks for help.

Regards,
jyo
   
   
Getting the following error:

Line: 64, Column: 1
System.UnexpectedException: common.exception.SfdcSqlException: ORA-01424: missing or illegal character following the escape character select /*Apex.Class.SetAccountRepRegion.execute: line 44*/ * from (select "Id", "Name", "State__c", "Country__c", "ZIP_prefix__c", "Type__c", "Rep_Region__c" from (select /*+ no_expand */ t.deleted "IsDeleted_gen_1", t.val4 "Country__c", t.val5 "Type__c", t.val6 "State__c", t.val3 "ZIP_prefix__c", t.custom_entity_data_id "Id", t.name "Name", t.val7 "Rep_Region__c" from core.custom_entity_data t where (t.organization_id = '[orgid]') and (t.custom_entity_data_id != '000000000000000') and (t.key_prefix = ?)) where (("IsDeleted_gen_1" = '0') AND ("Country__c" is null or upper("Country__c") is not null and upper("Country__c") in (select /*+ hash_sj swap_join_inputs(inlist) */ column_value from table(cast(? AS STRING_ARRAY)) inlist where column_value is not null)) AND (("Type__c" = ?) OR (("State__c" is null or upper("State__c") is not null and upper("State__c") in (select /*+ hash_sj swap_join_inputs(inlist) */ column_value from table(cast(? AS STRING_ARRAY)) inlist where column_value is not null)) AND ("Type__c" = ?)) OR (("ZIP_prefix__c" is not null and exists (select /*+ no_unnest */ * from table(cast(? AS STRING_ARRAY)) tc where upper("ZIP_prefix__c") like tc.column_value ESCAPE '\')) AND ("Type__c" = ?))))) where rownum <= ?

when running the soql query:
SELECT id, name, state__c, country__c, zip_prefix__c, type__c, rep_region__c
                  FROM sales_region_state__c
                  WHERE (State__c IN :states AND Country__c IN :countries AND Type__c='State') OR
                  (Zip_prefix__c LIKE :zmatchexprs AND Country__c IN :countries AND Type__c='Zip prefix') OR
                  (Country__c IN :countries AND Type__c='Country')];
  • September 08, 2015
  • Like
  • 0
Ho to use Sytem.debug in this code..


global with sharing class sendsms {
  @future(callout=true)
    webservice static void sendsms1(String strPhone,String strName){
    AppRemind__c c =[Select Name,Email_Address__c,Phone_Mobile_Number__c, Alert__c from AppRemind__c];
    if(c.Name != null){
       
    if(c.Phone_Mobile_Number__c != null){
        //String txt='Your Appointment No. '+c.Name+'';
        String email=''+c.Email_Address__c+'';
        String phn=''+c.Phone_Mobile_Number__c+'';
            HttpRequest req = new HttpRequest();
            //Setting Endpoint URL to HTTP request
           req.setEndpoint('http://104.236.190.198/API/api.php?request=test_alert&api_key=827ccb0eea8a706c4c34a16891f84e7b&agent_id=11&temp_id=10&type=2&language=en&email_id='+email+'&phone='+phn);
            //set the request type
            req.setMethod('GET');
            //HTTP object creation
            Http http = new Http();
            //Sending the Req throgh HTTPResponse object.
            HTTPResponse res = http.send(req);
            System.debug('---------->'+res);
        }
   
  }
    
    }
    }
Hi

I am getting this error when i am run my script on CMD
C:\Program Files (x86)\salesforce.com\Data Loader\bin>process.bat "D:\test" Invo
iceUpsert
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: C:\Users\jeffrey.lai\AppData\Local\Temp\sdl.log (
The system cannot find the path specified)
        at java.io.FileOutputStream.openAppend(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
        at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java
:207)
        at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
        at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:3
07)
        at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.ja
va:295)
        at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurat
or.java:176)
        at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfi
gurator.java:191)
        at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOM
Configurator.java:523)
        at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.ja
va:436)
        at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:999)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:867)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:773)
        at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionCon
verter.java:483)
        at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
        at org.apache.log4j.Logger.getLogger(Logger.java:117)
        at com.salesforce.dataloader.process.ProcessRunner.<clinit>(ProcessRunne
r.java:82)
2015-09-02 12:17:14,347 INFO  [main] process.ProcessConfig getBeanFactory (Proce
ssConfig.java:103) - Loading process configuration from config file: D:\test\pro
cess-conf.xml
0 [main] INFO com.salesforce.dataloader.process.ProcessConfig  - Loading process
 configuration from config file: D:\test\process-conf.xml
2015-09-02 12:17:14,482 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinit
ions (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from file
 [D:\test\process-conf.xml]
135 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader  -
 Loading XML bean definitions from file [D:\test\process-conf.xml]
2015-09-02 12:17:14,642 INFO  [InvoiceUpsert] controller.Controller initConfig (
Controller.java:365) - The controller config has been initialized
295 [InvoiceUpsert] INFO com.salesforce.dataloader.controller.Controller  - The
controller config has been initialized
2015-09-02 12:17:14,645 INFO  [InvoiceUpsert] process.ProcessRunner run (Process
Runner.java:116) - Initializing process engine
298 [InvoiceUpsert] INFO com.salesforce.dataloader.process.ProcessRunner  - Init
ializing process engine
2015-09-02 12:17:14,647 INFO  [InvoiceUpsert] process.ProcessRunner run (Process
Runner.java:119) - Loading parameters
300 [InvoiceUpsert] INFO com.salesforce.dataloader.process.ProcessRunner  - Load
ing parameters
2015-09-02 12:17:16,961 INFO  [InvoiceUpsert] config.LastRun load (LastRun.java:
96) - Last run info will be saved in file: D:\test\InvoiceUpsert_lastRun.propert
ies
2614 [InvoiceUpsert] INFO com.salesforce.dataloader.config.LastRun  - Last run i
nfo will be saved in file: D:\test\InvoiceUpsert_lastRun.properties
2015-09-02 12:17:16,984 FATAL [main] process.ProcessRunner topLevelError (Proces
sRunner.java:238) - Unable to run process InvoiceUpsert
java.lang.RuntimeException: com.salesforce.dataloader.exception.ProcessInitializ
ationException: Error creating file: D:\InvoiceUpsertSucess.csv
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:162)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:100)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:253)
Caused by: com.salesforce.dataloader.exception.ProcessInitializationException: E
rror creating file: D:\InvoiceUpsertSucess.csv
        at com.salesforce.dataloader.controller.Controller.setStatusFiles(Contro
ller.java:507)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:124)
        ... 2 more
Caused by: java.io.IOException: Error creating file: D:\InvoiceUpsertSucess.csv
        at com.salesforce.dataloader.controller.Controller.validateFile(Controll
er.java:527)
        at com.salesforce.dataloader.controller.Controller.setStatusFiles(Contro
ller.java:504)
        ... 3 more
2637 [main] FATAL com.salesforce.dataloader.process.ProcessRunner  - Unable to r
un process InvoiceUpsert
java.lang.RuntimeException: com.salesforce.dataloader.exception.ProcessInitializ
ationException: Error creating file: D:\InvoiceUpsertSucess.csv
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:162)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:100)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:253)
Caused by: com.salesforce.dataloader.exception.ProcessInitializationException: E
rror creating file: D:\InvoiceUpsertSucess.csv
        at com.salesforce.dataloader.controller.Controller.setStatusFiles(Contro
ller.java:507)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:124)
        ... 2 more
Caused by: java.io.IOException: Error creating file: D:\InvoiceUpsertSucess.csv
        at com.salesforce.dataloader.controller.Controller.validateFile(Controll
er.java:527)
        at com.salesforce.dataloader.controller.Controller.setStatusFiles(Contro
ller.java:504)
        ... 3 more
C:\Program Files (x86)\salesforce.com\Data Loader\bin>
 
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    
<bean id="InvoiceUpsert" class="com.salesforce.dataloader.process.ProcessRunner" singleton="false" >
  <description>Invoice records gets upserted from csv files into Salesforce.</description> 
  <property name="name" value="InvoiceUpsert" /> 
 <property name="configOverrideMap">
<map>
  <entry key="sfdc.debugMessages" value="false" /> 
  <entry key="sfdc.debugMessagesFile" value="D:\test\invoiceandpaymentSoapTrace.log" /> 
  <entry key="sfdc.endpoint" value="https://login.salesforce.com" /> 
  <entry key="sfdc.username" value="admin@holoflex.com" /> 
  <entry key="sfdc.password" value="a77d74ccc121773bd157905ec94a67f317d7f762942ab5ba1a0a7da15664fd4334ef5e6672df3f37" /> 

  <entry key="process.encryptionKeyFile" value="D:\test\key.txt" /> 
  <entry key="sfdc.timeoutSecs" value="600" /> 
  <entry key="sfdc.loadBatchSize" value="200" /> 
  <entry key="sfdc.entity" value="Invoice_Dispatch_details__c" /> 
  <entry key="sfdc.externalIdField" value="Invoice_Number__c" /> 
  <entry key="process.operation" value="upsert" /> 
  <entry key="sfdc.timeZone" value="GMT+8" /> 
  <entry key="process.mappingFile" value="D:\map\Invoice.sdl" /> 
  <entry key="process.outputError" value="D:\InvoiceUpsertError.csv" /> 
  <entry key="process.outputSuccess" value="D:\InvoiceUpsertSucess.csv" /> 
  <entry key="dataAccess.type" value="csvRead" /> 
  <entry key="dataaccess.writeUTF8" value="true" /> 
  <entry key="dataAccess.name" value="D:\source\TALLY1 Invoice.csv" /> 
  <entry key="process.initialLastRunDate" value="2014-10-06T00:00:00.000-0800" /> 
  </map>
  </property>
  </bean>
<bean id="PaymentUpsert" class="com.salesforce.dataloader.process.ProcessRunner" singleton="false" >
  <description>Payment Records gets upserted from csv files into Salesforce.</description> 
  <property name="name" value="PaymentUpsert" /> 
 <property name="configOverrideMap">
<map>
  <entry key="sfdc.debugMessages" value="false" /> 
  <entry key="sfdc.debugMessagesFile" value="D:\test\PaymentSoapTrace.log" /> 
  <entry key="sfdc.endpoint" value="https://login.salesforce.com" /> 
  <entry key="sfdc.username" value="admin@holoflex.com" /> 
  <entry key="sfdc.password" value="a77d74ccc121773bd157905ec94a67f317d7f762942ab5ba1a0a7da15664fd4334ef5e6672df3f37" /> 
  <entry key="process.encryptionKeyFile" value="D:\test\key.txt" /> 
  <entry key="sfdc.timeoutSecs" value="600" /> 
  <entry key="sfdc.loadBatchSize" value="200" /> 
  <entry key="sfdc.entity" value="Payment_Detail__c" /> 
  <entry key="sfdc.externalIdField" value="Payment_Serial_Number__c" /> 
  <entry key="process.operation" value="upsert" /> 
  <entry key="process.mappingFile" value="D:\map\payment.sdl" /> 
  <entry key="process.outputError" value="D:\PaymentUpsertError.csv" /> 
  <entry key="process.outputSuccess" value="D:\PaymentUpsertSuccess.csv" /> 
  <entry key="dataAccess.type" value="csvRead" /> 
  <entry key="dataaccess.writeUTF8" value="true" /> 
  <entry key="dataAccess.name" value="D:\source\TALLY1 payment details.csv" /> 
  <entry key="process.initialLastRunDate" value="2014-10-06T00:00:00.000-0800" /> 
  </map>
  </property>
  </bean>
  </beans>



 
Hi,

I have a requirement like.. Client have around 400 - 500 departments ("Dept" picklist) and each departmant is having Some Members ("Canditates" multipicklist).

I used Dept as controlloing field and Canditates as Dependent. After adding 300 values it showed limitation issue :( I have googled for this but cant overcome. Is there any solution for this or alternative way of achiebing this?

One said we can raise a case to SF then they will increase a limit to 1000. is that true?

Thanks.
Hello everybody,

does anyone have the code of the "SpeakerControllerExtension"-tab?
I think the order of my code is just wrong...

Thanks a lot
Michaela
Hi, I am new to triggers and would love some help. I have 2 fields which are:
  • End Date (date field)
  • Active (checkbox)
What we are trying to do it is to create a trigger that would update the Active checkbox based on the End Date the user has provided.
E.g. when End Date = 15 September 2015, on that day itself, update the Active flag to FALSE.

Is this possible?
  • September 02, 2015
  • Like
  • 0
Hello,

I have a object in which a lookup field connected to Contact standard object .

for e.x.
field name is emp__c i.e.. lookup datatype

when i write emp__r.Phone in sql query i got phone number from contact object of a particular employee
similary when i write emp__r.Site__c i got all site's value from contact object of a particular employee

but 


when i try to fecth account from contact object i got null value like:-
emp__r.Account

to check my query i also created a custom lookup field in contact  which is connected to account
when i write  
emp__r.Acc__c...
Still i get null values..

why??

Its very urgent pls reply ASAP.

I can fecth any other value from contact using relation field other than account only ...
but i want account from contact object 
 

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.