• M.sf
  • NEWBIE
  • 84 Points
  • Member since 2013
  • Developer

  • Chatter
    Feed
  • 2
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 21
    Replies
Hi All,

I am new to salesforce and just want to learn the order of exection in salesforce.

I have created custom validaton rule, lead assignemnt rule, before trigger and After trigger on lead object. I just want to check the order of execution using  Debug log. How can i do this? 
Hi Guys,

I coverd 27% code coverage .

Can you please guide me ? How to cover list<Loyalty__c> ListRecods Soql Qureis? 


public class SearchAndEditLoyaltyRecord {
   public String Email{get;set;}
    public String Email1{get;set;}
    public String HomePhone{get;set;}
    public String HomePhone1{get;set;}
    public String mobilePhone{get;set;}
    public String mobilePhone1{get;set;}
    public String name{get;set;}
     public String name1{get;set;}
    public String BusinessPhone{get;set;}
     public String BusinessPhone1{get;set;}
    public String ContactName{get;set;}
    public String ContactName1{get;set;}
    public List<Loyalty__c> Loyalty_records{get;set;}
     public List<Loyalty__c> Loyalty_records1 {get;set;}
    public List<loyaltyWrapper> loyaltywrapperlist{get; set;}
    public List<loyaltyWrapper1> loyaltywrapperlist1{get; set;}
    Public list<Loyalty__c> SelectedLoyalty{get; set;}
    public Boolean Searched{get;set;}
    public Boolean searched2 {get;set;}
     
    
    public SearchAndEditLoyaltyRecord(){
        searched = false;
        searched2 = false;
       
        //SelectedLoyalty=new list<Loyalty__c>();
        String EmailtoSearch = ApexPages.currentPage().getParameters().get('Email');
        String HomePhonetoSearch = ApexPages.currentPage().getParameters().get('HomePhone');
        String mobilePhonetoSearch = ApexPages.currentPage().getParameters().get('mobilePhone');
        String NametoSearch = ApexPages.currentPage().getParameters().get('name');
        String BusinessPhonetoSearch = ApexPages.currentPage().getParameters().get('BusinessPhone');
         String contactNametoSearch = ApexPages.currentPage().getParameters().get('ContactName');
         
          String EmailtoSearch1 = ApexPages.currentPage().getParameters().get('Email1');
        String HomePhonetoSearch1 = ApexPages.currentPage().getParameters().get('HomePhone1');
        String mobilePhonetoSearch1 = ApexPages.currentPage().getParameters().get('mobilePhone1');
        String NametoSearch1 = ApexPages.currentPage().getParameters().get('name1');
        String BusinessPhonetoSearch1 = ApexPages.currentPage().getParameters().get('BusinessPhone1');
         String contactNametoSearch1 = ApexPages.currentPage().getParameters().get('ContactName1');
         
        if(null!=EmailtoSearch||null!=HomePhonetoSearch||
        null!=mobilePhonetoSearch ||null!=NametoSearch||null!=BusinessPhonetoSearch||null!=contactNametoSearch ){
            Email=EmailtoSearch;
            HomePhone=HomePhonetoSearch ;
            mobilePhone=mobilePhonetoSearch ;
            Name=NametoSearch;
            BusinessPhone=BusinessPhonetoSearch;
            ContactName=contactNametoSearch;
            system.debug('BusinessPhone>>>>>>>'+BusinessPhone);
            executeSearch();
           // newLoyalty();
        }
        
        if(null!=EmailtoSearch1||null!=HomePhonetoSearch1||
        null!=mobilePhonetoSearch1 ||null!=NametoSearch1||null!=BusinessPhonetoSearch1||null!=contactNametoSearch1 ){
            Email1=EmailtoSearch1;
            HomePhone1=HomePhonetoSearch1 ;
            mobilePhone1=mobilePhonetoSearch1 ;
            Name1=NametoSearch1;
            BusinessPhone1=BusinessPhonetoSearch1;
            ContactName1=contactNametoSearch1;
            system.debug('BusinessPhone>>>>>>>'+BusinessPhone1);
            //executeSearch();
         newLoyalty();
        }
    }
    
   
    public PageReference executeSearch(){
    
        if(Loyalty_records==null){
            SelectedLoyalty=new list<Loyalty__c>();
           Loyalty_records=new list<Loyalty__c>();
       }else{
           Loyalty_records.clear();
           SelectedLoyalty.clear();
       }
        String SearchMail = email;
        String SearchmobilePhone=mobilePhone;
        String SearchHomephone =HomePhone;
        String SearchLoyaltyId = Name;
        String SearchBusinessPhone =BusinessPhone;
        String SearchContactName = contactName;
        system.debug('SearchBusinessPhone >>>>>>>>'+SearchBusinessPhone );
        searched = true;
        system.debug('SearchMail >>>>>>>>'+SearchMail);
        system.debug('SearchMail >>>>>>>>'+SearchMail.length() );
        if(SearchMail!=''&&SearchMail.length()!=0||SearchmobilePhone!=''&&SearchmobilePhone.length()!=0 ||
        SearchHomephone !=''&&SearchHomephone .length()!=0 ||
        SearchLoyaltyId !=''&&SearchLoyaltyId .length()!=0 || SearchBusinessPhone !=''&&SearchBusinessPhone .length()!=0
        || SearchContactName !=''&&SearchContactName.length()!=0){
          
           if(SearchMail!=''&&SearchMail.length()!=0)
        Loyalty_records =[SELECT Id,Name,Type__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Email  =:SearchMail  order by Loyalty_Program_Expiry_Date__c desc ];
                    
                         }
                            if(SearchmobilePhone!=''&&SearchmobilePhone.length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.mobilePhone=:SearchmobilePhone order by Loyalty_Program_Expiry_Date__c desc ];
                    
                         }
                                        if(SearchHomephone !=''&&SearchHomephone .length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,Contact_Name__r.Homephone,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Homephone=:SearchHomephone  order by Loyalty_Program_Expiry_Date__c desc ];
                    
                         }
                          if(SearchLoyaltyId !=''&&SearchLoyaltyId .length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  name=:SearchLoyaltyId  order by Loyalty_Program_Expiry_Date__c desc nulls last ];
                    
                         }
          if(SearchBusinessPhone.length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__r.Business_Phone__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Business_Phone__c =:SearchBusinessPhone  order by Loyalty_Program_Expiry_Date__c desc Nulls Last];
                    
                         }
                          if(SearchContactName.length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__r.Business_Phone__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.name=:SearchContactName order by Loyalty_Program_Expiry_Date__c desc Nulls Last];
                    
                         }
                         
                        /* else {
                          if(SearchMail  == '' || SearchMail == null||SearchmobilePhone== '' || SearchmobilePhone== null||SearchHomephone == '' || SearchHomephone == null){
                system.debug('yes it is entering into this');
       ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter Valid Input'));         
                  } 
                        
                  }*/
                        system.debug('Loyalty_records>>>>'+Loyalty_records); 
         
                
                   /*if(SearchMail != ''&& Loyalty_records.size()==0 )  {
                     ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'No Loyalty Records With this contact Mail'));     
                  }
                  else {*/
                  if(SearchMail != ''&& Loyalty_records.size()>0  )
                  {
                    Loyalty_records =[SELECT Id,Name,Type__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where Contact_Name__r.Email  LIKE :SearchMail  order by Loyalty_Program_Expiry_Date__c desc];
                  }
                    if(SearchmobilePhone!= ''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.mobilePhone =:SearchmobilePhone order by Loyalty_Program_Expiry_Date__c desc];
                  }
                   if(SearchHomephone != ''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Homephone=:SearchHomephone order by Loyalty_Program_Expiry_Date__c desc];
                  }
                 if(SearchLoyaltyId != ''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Name=:SearchLoyaltyId order by Loyalty_Program_Expiry_Date__c desc];
                  }
         if(SearchBusinessPhone!=''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Contact_Name__r.Business_Phone__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Business_Phone__c=:SearchBusinessPhone order by Loyalty_Program_Expiry_Date__c desc];
                  }
                    if(SearchContactName!=''&& Loyalty_records.size()>0  )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Contact_Name__r.Business_Phone__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Name=:SearchContactName order by Loyalty_Program_Expiry_Date__c desc];
                  }
                   system.debug('Loyalty_records >>>>>>'+Loyalty_records );
            
        
        return null;
    }
}
We have a lightning tree structure instead of a lookup field. And when the user selects the any values. And again click on the dropdown list.
The selected item should be highligted. The same thing even in edit page. Unable to add class to teh selected.
Below is the code for the same.
Component code
 <lightning:tree aura:id="MyCustomId" class="MyCustomClass" items="{!v.items}" onselect="{!c.handleSelect}" />
JS code
handleSelect : function (cmp, event, helper) {
       $A.util.addClass(event.getParam('name'), "slds-is-selected");
/*        
var childCmp = cmp.find("MyCustomId");
        alert('childCmp->'+childCmp);
        var btnClicked = event.getSource();
        alert('btnClicked->'+btnClicked);
        $A.util.toggleClass(childCmp,'MyCustom-selected');
      */
}
                            


User-added image
  • February 27, 2018
  • Like
  • 0
Jquery is not working when we activate the Locker Service in the org. If I try to deactivate my code works fine.
Is there any workaround to include jquery when locker service is enabled.
Requirement: I have a custom lightning component and we are displaying list of records based on custom query.
Now need to download the same records in csv. 
Solution Approach: Trying to provide a button and include jquery.js in component and use jquery functions to read html from component and then download from controller.
Any help will be appreciated.
Below is my code.

Component

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" >
    <ltng:require scripts='/resource/jqueryltng' afterScriptsLoaded="{!c.afterScriptsLoaded}"/>
    <br/>
    <label class="slds-form-element__label" for="org">Click on Download Button to Download CSV</label>
    <ui:button aura:id="button" class="slds-button slds-button--brand" press="{!c.getCsv1}">Download CSV</ui:button>
    <br/>
    <div class="slds-grid" aura:id="displayData" id="dataTable">
        <table class="slds-table slds-table--bordered slds-table--cell-buffer">
            <thead>
                <tr class="slds-text-title--caps">
                    <th class="slds-truncate">First Name</th>
                    <th class="slds-truncate">Last Name</th>
                    <th class="slds-truncate">Company</th>
                </tr>
            </thead>
            <tbody>
                <tr class="slds-truncate">
                    <td class="slds-truncate">AAAAA</td>
                    <td class="slds-truncate">YYYYY</td>
                    <td class="slds-truncate">CCCCC</td>
                </tr>
            </tbody>
        </table>
    </div>
</aura:component>

Controller

({
    getCsv : function(component, event, helper) {
            var $rows = $('#dataTable>table').find('tr:has(td)'),
            // Temporary delimiter characters unlikely to be typed by keyboard
            // This is to avoid accidentally splitting the actual contents
            tmpColDelim = String.fromCharCode(11), // vertical tab character
            tmpRowDelim = String.fromCharCode(0), // null character

            // actual delimiter characters for CSV format
            colDelim = '","',
            rowDelim = '"\r\n"',
            //alert(colDelim);
            //alert(rowDelim);
            // Grab text from table into CSV formatted string
            csv = '"' + $rows.map(function (i, row) {
                var $row = $(row),
                    $cols = $row.find('td');

                return $cols.map(function (j, col) {
                    var $col = $(col),
                        text = $col.text();
                    return text;
                    //return text.replace(/"/g, '""'); // escape double quotes
                }).get().join(tmpColDelim);

            }).get().join(tmpRowDelim)
                .split(tmpRowDelim).join(rowDelim)
                .split(tmpColDelim).join(colDelim) + '"',

        // Data URI
        csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv);
        window.location.href = 'data:text/csv;charset=UTF-8,'+ encodeURIComponent(csv);
        $(this)
            .attr({
            'download': 'filename.csv',
                'href': csv,
                'target': '_blank'
        });;
    },
    afterScriptsLoaded : function(component, event, helper) {
    }
})
  • December 30, 2016
  • Like
  • 0
I have a ligtning component and have given filter options to select the objects and the filter query.
I am display based on the selection in ligtning component.
Now I want to have a download as csv button which will contain the same records in csv.

I have created a vf page with contentType="text/csv#filename.csv"  and have the same controller which i am using in the lightning component.
But since the methods are static and when I am getting the variables as null.
 
  • December 29, 2016
  • Like
  • 0
If the return type in aura enabled method is returning and error and not able to solve. Is there any options apart from adding new class to enable aura to select option class?
@AuraEnabled
    public List<SelectOption> getObjDetails() {
    //do something
}
  • December 05, 2016
  • Like
  • 0
We have created a Data set and lens in wave analytics
The requirement is to view all records in lens in wave. When we click on "View Data Table".
There is limit for 100 records. Is there any way to increase the Record count or its an platform limitation?
  • June 30, 2015
  • Like
  • 1
I have created a dataset in wave which joins 3 of my custom object. I have uploaded the json file. It runs with no errors in data moniter. But when i am trying to open that data set. i am getting below error.

java.lang.RuntimeException: Error in Job ID query.cs9-app2-3-was.3y7qcU9Z6gj9oQVeRhr3ik: {"messageType":"Error","results":"edge-query replied with HTTP 401 (Unauthorized)"} 185962198-27785 (-1633278881)
  • May 27, 2015
  • Like
  • 1
We have created a Data set and lens in wave analytics
The requirement is to view all records in lens in wave. When we click on "View Data Table".
There is limit for 100 records. Is there any way to increase the Record count or its an platform limitation?
  • June 30, 2015
  • Like
  • 1
I have created a dataset in wave which joins 3 of my custom object. I have uploaded the json file. It runs with no errors in data moniter. But when i am trying to open that data set. i am getting below error.

java.lang.RuntimeException: Error in Job ID query.cs9-app2-3-was.3y7qcU9Z6gj9oQVeRhr3ik: {"messageType":"Error","results":"edge-query replied with HTTP 401 (Unauthorized)"} 185962198-27785 (-1633278881)
  • May 27, 2015
  • Like
  • 1
We have a lightning tree structure instead of a lookup field. And when the user selects the any values. And again click on the dropdown list.
The selected item should be highligted. The same thing even in edit page. Unable to add class to teh selected.
Below is the code for the same.
Component code
 <lightning:tree aura:id="MyCustomId" class="MyCustomClass" items="{!v.items}" onselect="{!c.handleSelect}" />
JS code
handleSelect : function (cmp, event, helper) {
       $A.util.addClass(event.getParam('name'), "slds-is-selected");
/*        
var childCmp = cmp.find("MyCustomId");
        alert('childCmp->'+childCmp);
        var btnClicked = event.getSource();
        alert('btnClicked->'+btnClicked);
        $A.util.toggleClass(childCmp,'MyCustom-selected');
      */
}
                            


User-added image
  • February 27, 2018
  • Like
  • 0

Hi everyone,
First of all i have a Lightning Component with associated an Application Light:Out. The App is inside a Visual Force page.

After click the quick action, a modal dialog shows my VisualForce.

In the controller of my Lightning Component at some point I fire this:
 

$A.get("e.force:closeQuickAction").fire();
But in the Visual force page, instead closing it, it shows this error:
This page has an error. You might just need to refresh it.
Error in $A.getCallback() [Cannot read property 'fire' of undefined]
Callback failed: apex://NextStepControllerLightning/ACTION$nextStepConfigurarion
Failing descriptor: {c:NextStepLightning}

This error doesn't show when i click on a quick action linked directly to the Lightning Component.
My goal is to close this modal dialog or instead manage the variables inside the controller of the component using function javascript inside my visual force. 

Thank you for help.
 
If the return type in aura enabled method is returning and error and not able to solve. Is there any options apart from adding new class to enable aura to select option class?
@AuraEnabled
    public List<SelectOption> getObjDetails() {
    //do something
}
  • December 05, 2016
  • Like
  • 0
Hi all ,
i am creating visualforce in that i am using picklist  in that picklist containing 10 object if select the one object in back end i want to delete all the duplicate records and display the remaining records 
i am using SOQL to fetch the records but it will lead to problem suppose in account object there are l lakh records
plz help  me to  reslove this  ,thanks in advance

Thanks & Regards
Ravindra
Hi All,

I am new to salesforce and just want to learn the order of exection in salesforce.

I have created custom validaton rule, lead assignemnt rule, before trigger and After trigger on lead object. I just want to check the order of execution using  Debug log. How can i do this? 
Hi All,

I have a requirement to upload multiple attachments to multiple records in visual force table, i am displaying the list of records from different tables in visualforce page, i want to upload the multiple attachments to every record in that table.Please any suggestions.Please find the below image for reference.

User-added image

Thanks,
Surya
Hi Guys,

I coverd 27% code coverage .

Can you please guide me ? How to cover list<Loyalty__c> ListRecods Soql Qureis? 


public class SearchAndEditLoyaltyRecord {
   public String Email{get;set;}
    public String Email1{get;set;}
    public String HomePhone{get;set;}
    public String HomePhone1{get;set;}
    public String mobilePhone{get;set;}
    public String mobilePhone1{get;set;}
    public String name{get;set;}
     public String name1{get;set;}
    public String BusinessPhone{get;set;}
     public String BusinessPhone1{get;set;}
    public String ContactName{get;set;}
    public String ContactName1{get;set;}
    public List<Loyalty__c> Loyalty_records{get;set;}
     public List<Loyalty__c> Loyalty_records1 {get;set;}
    public List<loyaltyWrapper> loyaltywrapperlist{get; set;}
    public List<loyaltyWrapper1> loyaltywrapperlist1{get; set;}
    Public list<Loyalty__c> SelectedLoyalty{get; set;}
    public Boolean Searched{get;set;}
    public Boolean searched2 {get;set;}
     
    
    public SearchAndEditLoyaltyRecord(){
        searched = false;
        searched2 = false;
       
        //SelectedLoyalty=new list<Loyalty__c>();
        String EmailtoSearch = ApexPages.currentPage().getParameters().get('Email');
        String HomePhonetoSearch = ApexPages.currentPage().getParameters().get('HomePhone');
        String mobilePhonetoSearch = ApexPages.currentPage().getParameters().get('mobilePhone');
        String NametoSearch = ApexPages.currentPage().getParameters().get('name');
        String BusinessPhonetoSearch = ApexPages.currentPage().getParameters().get('BusinessPhone');
         String contactNametoSearch = ApexPages.currentPage().getParameters().get('ContactName');
         
          String EmailtoSearch1 = ApexPages.currentPage().getParameters().get('Email1');
        String HomePhonetoSearch1 = ApexPages.currentPage().getParameters().get('HomePhone1');
        String mobilePhonetoSearch1 = ApexPages.currentPage().getParameters().get('mobilePhone1');
        String NametoSearch1 = ApexPages.currentPage().getParameters().get('name1');
        String BusinessPhonetoSearch1 = ApexPages.currentPage().getParameters().get('BusinessPhone1');
         String contactNametoSearch1 = ApexPages.currentPage().getParameters().get('ContactName1');
         
        if(null!=EmailtoSearch||null!=HomePhonetoSearch||
        null!=mobilePhonetoSearch ||null!=NametoSearch||null!=BusinessPhonetoSearch||null!=contactNametoSearch ){
            Email=EmailtoSearch;
            HomePhone=HomePhonetoSearch ;
            mobilePhone=mobilePhonetoSearch ;
            Name=NametoSearch;
            BusinessPhone=BusinessPhonetoSearch;
            ContactName=contactNametoSearch;
            system.debug('BusinessPhone>>>>>>>'+BusinessPhone);
            executeSearch();
           // newLoyalty();
        }
        
        if(null!=EmailtoSearch1||null!=HomePhonetoSearch1||
        null!=mobilePhonetoSearch1 ||null!=NametoSearch1||null!=BusinessPhonetoSearch1||null!=contactNametoSearch1 ){
            Email1=EmailtoSearch1;
            HomePhone1=HomePhonetoSearch1 ;
            mobilePhone1=mobilePhonetoSearch1 ;
            Name1=NametoSearch1;
            BusinessPhone1=BusinessPhonetoSearch1;
            ContactName1=contactNametoSearch1;
            system.debug('BusinessPhone>>>>>>>'+BusinessPhone1);
            //executeSearch();
         newLoyalty();
        }
    }
    
   
    public PageReference executeSearch(){
    
        if(Loyalty_records==null){
            SelectedLoyalty=new list<Loyalty__c>();
           Loyalty_records=new list<Loyalty__c>();
       }else{
           Loyalty_records.clear();
           SelectedLoyalty.clear();
       }
        String SearchMail = email;
        String SearchmobilePhone=mobilePhone;
        String SearchHomephone =HomePhone;
        String SearchLoyaltyId = Name;
        String SearchBusinessPhone =BusinessPhone;
        String SearchContactName = contactName;
        system.debug('SearchBusinessPhone >>>>>>>>'+SearchBusinessPhone );
        searched = true;
        system.debug('SearchMail >>>>>>>>'+SearchMail);
        system.debug('SearchMail >>>>>>>>'+SearchMail.length() );
        if(SearchMail!=''&&SearchMail.length()!=0||SearchmobilePhone!=''&&SearchmobilePhone.length()!=0 ||
        SearchHomephone !=''&&SearchHomephone .length()!=0 ||
        SearchLoyaltyId !=''&&SearchLoyaltyId .length()!=0 || SearchBusinessPhone !=''&&SearchBusinessPhone .length()!=0
        || SearchContactName !=''&&SearchContactName.length()!=0){
          
           if(SearchMail!=''&&SearchMail.length()!=0)
        Loyalty_records =[SELECT Id,Name,Type__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Email  =:SearchMail  order by Loyalty_Program_Expiry_Date__c desc ];
                    
                         }
                            if(SearchmobilePhone!=''&&SearchmobilePhone.length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.mobilePhone=:SearchmobilePhone order by Loyalty_Program_Expiry_Date__c desc ];
                    
                         }
                                        if(SearchHomephone !=''&&SearchHomephone .length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,Contact_Name__r.Homephone,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Homephone=:SearchHomephone  order by Loyalty_Program_Expiry_Date__c desc ];
                    
                         }
                          if(SearchLoyaltyId !=''&&SearchLoyaltyId .length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  name=:SearchLoyaltyId  order by Loyalty_Program_Expiry_Date__c desc nulls last ];
                    
                         }
          if(SearchBusinessPhone.length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__r.Business_Phone__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Business_Phone__c =:SearchBusinessPhone  order by Loyalty_Program_Expiry_Date__c desc Nulls Last];
                    
                         }
                          if(SearchContactName.length()!=0){
        Loyalty_records =[SELECT Id,Name,Contact_Name__r.Business_Phone__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.mobilePhone,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.name=:SearchContactName order by Loyalty_Program_Expiry_Date__c desc Nulls Last];
                    
                         }
                         
                        /* else {
                          if(SearchMail  == '' || SearchMail == null||SearchmobilePhone== '' || SearchmobilePhone== null||SearchHomephone == '' || SearchHomephone == null){
                system.debug('yes it is entering into this');
       ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter Valid Input'));         
                  } 
                        
                  }*/
                        system.debug('Loyalty_records>>>>'+Loyalty_records); 
         
                
                   /*if(SearchMail != ''&& Loyalty_records.size()==0 )  {
                     ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'No Loyalty Records With this contact Mail'));     
                  }
                  else {*/
                  if(SearchMail != ''&& Loyalty_records.size()>0  )
                  {
                    Loyalty_records =[SELECT Id,Name,Type__c,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where Contact_Name__r.Email  LIKE :SearchMail  order by Loyalty_Program_Expiry_Date__c desc];
                  }
                    if(SearchmobilePhone!= ''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.mobilePhone =:SearchmobilePhone order by Loyalty_Program_Expiry_Date__c desc];
                  }
                   if(SearchHomephone != ''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Homephone=:SearchHomephone order by Loyalty_Program_Expiry_Date__c desc];
                  }
                 if(SearchLoyaltyId != ''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Name=:SearchLoyaltyId order by Loyalty_Program_Expiry_Date__c desc];
                  }
         if(SearchBusinessPhone!=''&& Loyalty_records.size()>0 )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Contact_Name__r.Business_Phone__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Business_Phone__c=:SearchBusinessPhone order by Loyalty_Program_Expiry_Date__c desc];
                  }
                    if(SearchContactName!=''&& Loyalty_records.size()>0  )
                  {
                    Loyalty_records =[SELECT Id,Name,Contact_Name__c,Contact_Name__r.Business_Phone__c,Loyalty_Eligibility__c,Loyalty_Inclusion__c,Contact_Name__r.HomePhone,Contact_Name__r.MobilePhone,Contact_Name__r.Email,Contact_Name__r.Name,Contact_Name__r.Sales_Lifetime_Value__c,
                         Loyalty_Program_Exclusion__c,Loyalty_Lifetime_Value__c,Loyalty_Program_Expiry_Date__c,
                         Loyalty_Sales_Inclusion_Value__c FROM Loyalty__c where  Contact_Name__r.Name=:SearchContactName order by Loyalty_Program_Expiry_Date__c desc];
                  }
                   system.debug('Loyalty_records >>>>>>'+Loyalty_records );
            
        
        return null;
    }
}
Hello,

I'm trying to use the third party javascript library jqgrid (http://www.trirand.com/blog/) for show and filter records with lightning. I have installed the required resources (css/js) and have initialized it in this way:
// component side
<ltng:require styles="/resource/jqui/jquery-ui.min.css"/>
<ltng:require styles="/resource/jqgrid/css/ui.jqgrid.css"/> 
    <ltng:require scripts="/resource/jqgrid/js/jquery-2.2.4.js,/resource/jqgrid/js/i18n/grid.locale-es.js,/resource/jqgrid/src/jquery.jqGrid.js" afterScriptsLoaded="{!c.afterScriptsLoaded}"/>

// Controller side:
({afterScriptsLoaded : function(cmp, evt, helper) {
        $("#jqGrid").jqGrid({                
                viewrecords: true,
                width: 780,
                height: 250,
                rowNum: 20
            });
            // activate the toolbar searching
            
    },

but an exception halts the application when entering the constructor of the jqgrid (afterScriptsLoaded);

The error said: TypeError: this.rows is undefined

"this.rows" its found in the jquery.jqgrid.js and it works fine outside lightning. Any idea of what could be wrong?

Regards
We have created a Data set and lens in wave analytics
The requirement is to view all records in lens in wave. When we click on "View Data Table".
There is limit for 100 records. Is there any way to increase the Record count or its an platform limitation?
  • June 30, 2015
  • Like
  • 1
I have created a dataset in wave which joins 3 of my custom object. I have uploaded the json file. It runs with no errors in data moniter. But when i am trying to open that data set. i am getting below error.

java.lang.RuntimeException: Error in Job ID query.cs9-app2-3-was.3y7qcU9Z6gj9oQVeRhr3ik: {"messageType":"Error","results":"edge-query replied with HTTP 401 (Unauthorized)"} 185962198-27785 (-1633278881)
  • May 27, 2015
  • Like
  • 1
Hi,

I am trying to use SAQL for my dashboar. But when I specify filter or group in SAQL, the dataset fails to load the bar charts.
Below is my step I am using

        "steps": {
            "device_type_time_Day_event_1": {
                "isFacet": true,
                "start": null,
                "query": {"pigql":"q = load \"sample_data_5_26\"; q = group q by 'device_type'; q = foreach q generate 'device_type' as 'device_type', 'event' as 'event', count() as 'count'",
                    "measures": [
                        [
                            "count",
                            "*"
                        ]
                    ],
                    "groups": ["device_type"
                    ]
                },
                "extra": {
                    "chartType": "vbar"
                },
                "selectMode": "single",
                "useGlobal": true,
                "em": "ad_data_5_26",
                "type": "aggregate",
                "isGlobal": false
            }

I am finding it hard to figure whats wrong with the SAQL.

1. Where can I find the salesforce wave dashboard logs?
2. In the SAQL dev document dashborad JSON reference document, it seems an 'airline' dataset being used. Can I get the sample and the corresponding dashboard for my reference?
 
hi friends,
What is database.queryLocator(). ?
When we will use it ?
What is the difference between Database.QueryLocator() and Database.GetQueryLocator()..

Please help me..
Thanks in Advance..
Hi,
Can any one help me in converting String to DateTime in apex.
Im able convert below format.

DateTime dt = DateTime.parse('11/6/2014 12:00 AM');

If I use below format Im getting error.

Datetime dt = DateTime.formatGmt('09-Dec-2014 10:43 AM');

System.TypeException: Invalid date/time: 09-Dec-2014 10:43 AM.

Thanks in advacne.

Regards,
naveen.


 

Hello,

 

Reset Security token option is not availble under My Personal Information setup.Please help me out from this problem....

Hi Friends,

 

Hope this scenario will be very interesting for everyone!! I have a scenario where the user needs to download the word document by clicking a link on page.

This word document is dynamically generated from visualforce by fetching values from the record.

Everything works fine. But the problem is when I try to open the downloaded document in MsWord (2007 or 2010), It opens in web layout by default. But I need to open the document in print layout / print view.

I searched and found that the below code snippet works well for all kinds of technology like php, python, etc..

// Code snippet

<!--[if gte mso 9]>
<xml>
<w:WordDocument>
  <w:view w:val="print" />
  <w:zoom w:percent="100" />
  <w:DoNotOptimizeForBrowser/>
  <w:DoNotHyphenateCaps/>
  <w:PunctuationKerning/>
</w:WordDocument>
</xml>
  <![endif]-->

 

But it didnt work with visualforce.  I placed this code snippet inside the <head> tag and right below the <title> tag as per Office XML reference. But I didnt get a positive result.

Is there anyway to achieve this in visualforce??

 

Thanks & Regards,

Logesh

  • November 27, 2012
  • Like
  • 0

Hi,

 

I have generated a word document in visualforce. The generated document get displayed in "Web Layout". Is it possible to display that in "Print Layout".

 

Suggestions please.

 

Regards,

Manikandan

Hi.,

 

Have created MS word doc using Visual force (similar to standard Mail merge functionality).

 

Main Key is here,


<apex:page standardController="Order__c" recordSetVar="Order" showHeader="false" contentType="application/msword" extensions="Date_Update_ACL" action="{!update_date}">

 

The reason to move to custom functionality instead of using mail merge in Activity History, we need to generate mail merge doc for more than one record, upon generating the doc we need to update some fields in that record.

 

Here the problem is, our visual force page generate the MS Word doc in Fire Fox browser but not working in internet explorer.

 

I dont understand the reason, have you faced this kind of issue, any workaround for this? 

Any help appreciated.

 

Note: PDF can be generated easily but we need to generate in MS word