• narendhar
  • NEWBIE
  • 10 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 9
    Replies
SOSL Query is not returning the updated results immidiately.

I am trying to implement the dedupe rules against multiple objects in my org, I am using the SOSL queries to find the matching records.
If i create two records with the same phone number with in 10 seconds of time difference , system is allowing the duplicates.
I debugged and found  that it is an issue with SOSL query. SOSL query is taking approximately 30 seconds to return the updated results.
If i create two records with more than 30 seconds interval  query is returning the results as expected .
you can replicate the behaviour by using below sample SOSL query, Create a lead with some phone number, immidiately update the below query with the phone number and execute in workbench or dev console.
FIND {Enter PhoneNumber here} IN PHONE FIELDS RETURNING Lead
Query will take up to 30 seconds to return the updated results.
Anyone else experienced similar kind of issues? Any workaround for this?
When ever user is trying to create duplicate contact ,I would like to send an email to Admin , . I am able to prevent the duplicate contacts using trigger , but not able to send email to Admin.

I need below two operation together.
1)User should receive the duplicate contact error.
2)Admin should receive an notofication email.
I am able to perform only one action not both , Any one has any solution for this scenario?
 
I am trying to create an entry in to deletion_log__c object before the lead record gets deleted, I would like to capture all the lead field names along with values in deletion_log__c object with the respective field values in to single field deletion_log__c .data__c . I would like my code to be dynamic(i mean in future if i create any new fields , the same field values also should get captured with out modifying the existing code). 

I am using the below code for the same ,
trigger leadTrg on Lead (before delete) {

public Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();

 list<Deletion_Log__c> leadDeletionLogList = new list<Deletion_Log__c>();
 Schema.SObjectType leadSchema = schemaMap.get('Lead');
 Map<String, Schema.SObjectField> fieldMap = leadSchema.getDescribe().fields.getMap();
for (lead l: trigger.old){
   
    Deletion_Log__c leadDeletionLog = new Deletion_Log__c ();
    
    
    string logRecord ;
    
    for (String fieldName: fieldMap.keySet())
    { 
        system.debug('fieldName&&&'+fieldName);
        String fieldLabel = fieldMap.get(fieldName).getDescribe().getLabel();
 
       
        Schema.DisplayType fielddataType = fieldMap.get(fieldName).getDescribe().getType();
        
        s1 = s1+fieldName+'='+l.fieldName;
         
     }
     
     leadDeletionLog.data__c =  s1 ;
     leadDeletionLogList.add(leadDeletionLog);
     
  }
  insert leadDeletionLogList;
}



but i am not able to save the code , i am getting the error message "Invalid field fieldName for SObject Lead ". 

The statement " s1 = s1+fieldName+'='+l.fieldName;" is causing the error, i am clueless about the reason anyone has ever encountered this error?
Thanks
I would like to export the account data periodically using CLI data loader and generate the export file names dynamically with export time stamps.Eg:- If i am running the export @28-Mar-2016 , file should be "AccountExport28-Mar-2016" .

Hi

 

kindly let me know the procedure to integrate the one salesforce application with another salesforce application, we received a requirement to integrate the two salesforce applications, if we create an account record or custom object record same recode needs to be created in another salesforce app automatically.

please help me with procedure or documentation.

When ever user is trying to create duplicate contact ,I would like to send an email to Admin , . I am able to prevent the duplicate contacts using trigger , but not able to send email to Admin.

I need below two operation together.
1)User should receive the duplicate contact error.
2)Admin should receive an notofication email.
I am able to perform only one action not both , Any one has any solution for this scenario?
 
I am trying to create an entry in to deletion_log__c object before the lead record gets deleted, I would like to capture all the lead field names along with values in deletion_log__c object with the respective field values in to single field deletion_log__c .data__c . I would like my code to be dynamic(i mean in future if i create any new fields , the same field values also should get captured with out modifying the existing code). 

I am using the below code for the same ,
trigger leadTrg on Lead (before delete) {

public Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();

 list<Deletion_Log__c> leadDeletionLogList = new list<Deletion_Log__c>();
 Schema.SObjectType leadSchema = schemaMap.get('Lead');
 Map<String, Schema.SObjectField> fieldMap = leadSchema.getDescribe().fields.getMap();
for (lead l: trigger.old){
   
    Deletion_Log__c leadDeletionLog = new Deletion_Log__c ();
    
    
    string logRecord ;
    
    for (String fieldName: fieldMap.keySet())
    { 
        system.debug('fieldName&&&'+fieldName);
        String fieldLabel = fieldMap.get(fieldName).getDescribe().getLabel();
 
       
        Schema.DisplayType fielddataType = fieldMap.get(fieldName).getDescribe().getType();
        
        s1 = s1+fieldName+'='+l.fieldName;
         
     }
     
     leadDeletionLog.data__c =  s1 ;
     leadDeletionLogList.add(leadDeletionLog);
     
  }
  insert leadDeletionLogList;
}



but i am not able to save the code , i am getting the error message "Invalid field fieldName for SObject Lead ". 

The statement " s1 = s1+fieldName+'='+l.fieldName;" is causing the error, i am clueless about the reason anyone has ever encountered this error?
Thanks
I would like to export the account data periodically using CLI data loader and generate the export file names dynamically with export time stamps.Eg:- If i am running the export @28-Mar-2016 , file should be "AccountExport28-Mar-2016" .

Hi

 

kindly let me know the procedure to integrate the one salesforce application with another salesforce application, we received a requirement to integrate the two salesforce applications, if we create an account record or custom object record same recode needs to be created in another salesforce app automatically.

please help me with procedure or documentation.

Hello,

when im running the belo code as a system administrator its working fine. But while running the code as a standard platform user its giving me this error. "Id value is not valid for Topic__c standard controller”

Please help me solve this error.

 

my apex class is:

 

public class Topic {

 public Topic(ApexPages.StandardController ctrx)  
 
  { 
         c1=new Topic__c();
         m=new message__c();
        
  
   }
 

The page from which it was redirected:

 

<apex:page StandardController="Topic__c" extensions="Topic" >
<apex:form id="form"  >
<apex:pageBlock >
        <apex:pageBlockSection title="Topics First page"  >
        
             <apex:pageBlockTable value="{!emp}" var="item">

                    <apex:column value="{!item.name}"/>
                    <apex:column value="{!item.description__c}"/>
                    <apex:column headerValue="Action" style="white-space: nowrap">
                        <a href="/apex/post_page?id={!item.id}">Post Message</a>
                    </apex:column>

             </apex:pageBlockTable>
                  
        </apex:pageBlockSection>
    
</apex:pageBlock>
<apex:commandButton action="{!new1}" value="new" >
</apex:commandbutton>

</apex:form>
</apex:page>

 

The page to which it was redirected:-

 

<apex:page standardController="Topic__c" extensions="Topic" >
<apex:form >
   
    <apex:pageBlock >
     
        <apex:pageBlockSection title="New Post Page" columns="1" >
            <apex:outputField value="{!Topic__c.description__c}"/>

            <apex:pageBlockTable value="{!MessageList}" var="item">
                <apex:column value="{!item.text__c}"/>
            </apex:pageBlockTable>
           
            <apex:inputField value="{!m.text__c}"/>
           
            <apex:commandButton value="Save" action="{!save1}"/>
        
        </apex:pageBlockSection>
   
    </apex:pageBlock>


</apex:form>
 
</apex:page>

Hello everyone. I have to Visualforce pages. In certain scenario I want VFPage1 to auto-redirect to VFPage2. I have the logic working and the redirect does work, but only when set to true.

 

I don't want to flush the view state. Both pages are using the same controller, so I should be able to use redirect false.

 

Instead what happens is the page loads to VFPage1. however, if I change redirect to true, and open the exact same page-- the auto-redirect works and takes me to Step2.

 

Any ideas and what might be happening?

 

I actually had a different problem using the same code setup and you can find a snippet of that here: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=17960

 

Basically I have apex page call an Action that returns the Page Reference. I've confirmed that the page reference does return successfully in the debug regardless if the redirect is set to True or False. But the page only actually redirects when set to true.