• Shruti Vish
  • NEWBIE
  • 50 Points
  • Member since 2016
  • Salesforce Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 21
    Replies
I want to delete the records which one year older 
    @AuraEnabled
    public static String getSearchResult(String patientId , String searchTerm , String listName){
        Map<Integer , String> mapIndexOfDynamicList = new Map<Integer , String>();
        Map<String , List<Object>> mapSearchResult = new Map<String , List<Object>>();
        Map<String , Map<String , String>> mapFieldApi = new Map<String , Map<String , String>>();
        Map<String , Map<String , String>> mapLinkRef = new Map<String , Map<String , String>>();
        List<String> lstFieldApi = new List<String>();
        List<String> lstDataDomainQuery = new List<String>();
        List<String> lstArg = new List<String>();
        List<Dynamic_List__c> lstDynamicList = new List<Dynamic_List__c>();
        Integer index = 0;
       
        lstArg.add(patientId);
        String baseString = 'FIND \'' + searchTerm  + '\' IN ALL FIELDS  RETURNING ';
 
        if(String.isNotBlank(listName))
            lstDynamicList = [SELECT Id, Name, objectAPIName__c, WhereClause__c, SOSL_whereClause__c, Order_By__c, searchIndex__c,
                            (SELECT Id, Name, fieldAPIName__c, isLink__c, Link_Reference__c, Detail_Page__c FROM Dynamic_List_Fields__r ORDER BY index__c)
                        FROM Dynamic_List__c WHERE searchIndex__c != null AND Name =: listName ORDER BY searchIndex__c asc];
        else
            lstDynamicList = [SELECT Id, Name, objectAPIName__c, WhereClause__c, SOSL_whereClause__c, Order_By__c, searchIndex__c,
                            (SELECT Id, Name, fieldAPIName__c, isLink__c, Link_Reference__c, Detail_Page__c FROM Dynamic_List_Fields__r ORDER BY index__c)
                        FROM Dynamic_List__c WHERE searchIndex__c != null ORDER BY searchIndex__c asc];
                       
        for (Dynamic_List__c dl : lstDynamicList)
        {
            if(!mapIndexOfDynamicList.containsKey((Integer)dl.searchIndex__c)){
                if(String.isNotBlank(listName))
                    mapIndexOfDynamicList.put(1 , dl.Name);
                else
                    mapIndexOfDynamicList.put((Integer)dl.searchIndex__c , dl.Name);
            }
               
            lstFieldApi         = new List<String>();
            String detailPage   = '';
            String whereClause  = '';
            for (Dynamic_List_Field__c dlf : dl.Dynamic_List_Fields__r){
                lstFieldApi.add(dlf.fieldAPIName__c);
                if(dlf.isLink__c)
                {
                    lstFieldApi.add(dlf.Link_Reference__c);
                    //detailPage : Used to maintain value of the navigation , when clicked on hyperlink
                    detailPage = dlf.Detail_Page__c == null ? '' : dlf.Detail_Page__c;
                   
                    if(!mapLinkRef.containsKey(dl.Name))
                        mapLinkRef.put(dl.Name , new Map<String , String>());
                    mapLinkRef.get(dl.Name).put(dlf.fieldAPIName__c , dlf.Link_Reference__c+'#'+detailPage);
                }
               
                if(!mapFieldApi.containsKey(dl.Name))
                    mapFieldApi.put(dl.Name , new Map<String , String>());
                mapFieldApi.get(dl.Name).put(dlf.fieldAPIName__c , dlf.Name);
            }
            whereClause = String.isNotBlank(dl.SOSL_whereClause__c) == true ? string.format(dl.SOSL_whereClause__c, lstArg) : string.format(dl.WhereClause__c, lstArg);
            whereClause = whereClause.replace('\"','\'');
           
            if(String.isNotBlank(listName))
                lstDataDomainQuery.add(dl.objectAPIName__c + '(' + string.join (lstFieldApi, ',') + ' WHERE ' + whereClause + ' )');
            else
                lstDataDomainQuery.add(dl.objectAPIName__c + '(' + string.join (lstFieldApi, ',') + ' WHERE ' + whereClause + ' LIMIT 10 )');
        }
       
        //Looping across list of subQuery to process SOSL one by one, as we have same objects with different where clauses for multiple Data Domains
        for(String subQuery : lstDataDomainQuery){
            String searchString = '';
            searchString = baseString + subQuery;
            List<List<sObject>> searchList = search.query(searchString);
            index++;
            //Loop through records fetched by SOSL Query
            mapSearchResult = getDataDomainResult(index, searchList , mapIndexOfDynamicList, mapFieldApi, mapLinkRef, mapSearchResult);
        }
        System.debug('mapSearchResult :: ' + mapSearchResult);
        return Json.serialize(mapSearchResult);
    }
   
    public static Map<String , List<Object>> getDataDomainResult(Integer index , List<List<sObject>> searchList , Map<Integer , String> mapIndexOfDynamicList ,
                                                            Map<String , Map<String , String>> mapFieldApi, Map<String , Map<String , String>> mapLinkRef,
                                                            Map<String , List<Object>> mapSearchResult){
        for(List<sObject> lstSObj : searchList){
            String dlName = mapIndexOfDynamicList.get(index);
            List<Map<String , String>> lstResultRecord = new List<Map<String , String>>();
           
            //Loop through each record
            for(sObject SObj : lstSObj){
                Map<String , String> mapFieldToValue = new Map<String , String>();
               
                //Loop through each value to map the field api name with its display name maintained in Dynamic list Field and value fetched
                for(String api : mapFieldApi.get(dlName).keyset()){
                    String displayVal = '';
                    String linkrefApi = '';
                    String linkrefRedirectPage = '';
                    //Check if the value should be an hyperlink or just a value
                    if(mapLinkRef.containsKey(dlName) && mapLinkRef.get(dlName).containsKey(api)){
                        linkrefApi  = mapLinkRef.get(dlName).get(api).split('#')[0];
                        //If it is a hyperlink, get the redirect page for the hyperlink
                        if(mapLinkRef.get(dlName).get(api).split('#').size() > 1)
                            linkrefRedirectPage = mapLinkRef.get(dlName).get(api).split('#')[1];
                        else
                            linkrefRedirectPage = dlName;
                    }
                    //Get the fetched values against the api
                    if(SObj.getPopulatedFieldsAsMap().containsKey(api)){
                        if(linkrefApi != '')
                            displayVal = '<button name= "' + linkrefRedirectPage + '" value = "' + dlName + '" id="'+ String.valueOf(SObj.getPopulatedFieldsAsMap().get(linkrefApi)) + '" title= "'+ String.valueOf(SObj.getPopulatedFieldsAsMap().get(api)) + '" class=\'linkbutton\'>' + String.valueOf(SObj.getPopulatedFieldsAsMap().get(api)) + '</button>';
                        else
                            displayVal = String.valueOf(SObj.getPopulatedFieldsAsMap().get(api));
                    }
                    //Populate the map with field display name and value
                    mapFieldToValue.put(mapFieldApi.get(dlName).get(api) , displayVal);
                }
                //Add all records to the list
                lstResultRecord.add(mapFieldToValue);
            }
            if(!lstResultRecord.isEmpty())
                mapSearchResult.put(dlName , lstResultRecord);
        }
        return mapSearchResult;
    }
     @AuraEnabled
    public static void updateUserSession(String currentPage, String fname, String lname, String cin, String dob, String gender){
        UtilityGeneral.updateUserSession(currentPage, fname, lname, cin, dob, gender);
    }
    @AuraEnabled
    public static void logHIPAAAudit(String acctId ,String hc_DataComponent){
        HIPAAAuditLogin__c hipaaauidLogObj=HIPAAAuditLogin__c.getInstance(hc_DataComponent);
        if(hipaaauidLogObj!=null && acctId != null )
        {
            HIPAAAuditLogController.logAccess(acctId, hc_DataComponent);
        }
    }
}
 
public static userSessionWrapper getLandingPage(){
        userSessionWrapper userSessionWrapperData;
        String Landingpage= '';
        String pageName= '';
        String urlParam= '';
        String profileName = getLoggedInUserProfile();
        system.debug('profileName :: ' + profileName);
        if(profileName == 'System Administrator')
            profileName = 'Idea Chatter';
        List<User_Session__c> lstUserSession = [SELECT Current_Page__c,First_Name__c,Last_Name__c,CIN__c,DOB__c,Gender__c FROM User_Session__c WHERE user__c = :UserInfo.getUserId() LIMIT 1];
        if(lstUserSession.size() > 0){
            List<BackNavigation__c> lstBackNav = BackNavigation__c.getall().values();
           
            system.debug('Current_Page__c :: ' + lstUserSession[0].Current_Page__c);
            for(BackNavigation__c backNav : lstBackNav ){
                 if(profileName == backNav.Profile__c  && backNav.Current_Page__c == lstUserSession[0].Current_Page__c){
                    Landingpage = backNav.Landing_page__c;
                    pageName = backNav.pageName__c;
                     if(backNav.hasURLParam__c){
                         system.debug('fname: : ' + lstUserSession[0].First_Name__c);
                         if(lstUserSession[0].First_Name__c != '' && lstUserSession[0].First_Name__c != null)
                            urlParam = 'fn='+lstUserSession[0].First_Name__c;
                         if(lstUserSession[0].Last_Name__c != '' && lstUserSession[0].Last_Name__c != null){
                            if(urlParam !='') urlParam += '&ln='+lstUserSession[0].Last_Name__c;
                            else urlParam = 'ln='+lstUserSession[0].Last_Name__c;
                         }
                         if(lstUserSession[0].CIN__c != '' && lstUserSession[0].CIN__c != null){
                            if(urlParam !='') urlParam += '&cin='+lstUserSession[0].CIN__c;
                            else urlParam = 'cin='+lstUserSession[0].CIN__c;
                         }  
                         if(lstUserSession[0].Gender__c != '' && lstUserSession[0].Gender__c != null){
                            if(urlParam !='') urlParam += '&gn='+lstUserSession[0].Gender__c;
                            else urlParam = 'gn='+lstUserSession[0].Gender__c;
                         }
                         if(lstUserSession[0].DOB__c != '' && lstUserSession[0].DOB__c != null){
                            if(urlParam !='') urlParam += '&dob='+lstUserSession[0].DOB__c;
                            else urlParam = 'dob='+lstUserSession[0].DOB__c;
                         }
                     }
                 }
            }
            system.debug('Landingpage :: ' + Landingpage);
            userSessionWrapperData = new userSessionWrapper(Landingpage , pageName , urlParam);
        }
        system.debug('userSessionWrapperData >>>' + userSessionWrapperData);
        return userSessionWrapperData;
    }
    
I am unable to write test class for above method please help me out
This is my class please help me out to write test class
public class AccountTriggerHandler implements ITriggerHandler
{
    public static Boolean TriggerDisabled = false;

    /*
        Checks to see if the trigger has been disabled. For example, you could check a custom setting here.
        In this example, a static property is used to disable the trigger.
        In a unit test, you could use AccountTriggerHandler.TriggerDisabled = true to completely disable the trigger.
    */
    public Boolean IsDisabled()
    {
        return TriggerDisabled;
    }

    public void BeforeInsert(List<SObject> newItems) 
    {
        // Cast the List<Sobject> to List<Account>
        AccountNameCheck((List<Account>)newitems);
    }

    public void BeforeUpdate(Map<Id, SObject> newItems, Map<Id, SObject> oldItems) 
    {
        // Cast the Map<Id, Sobject> to List<Account>
        AccountNameCheck((List<Account>)newitems.values());
    }

    public void BeforeDelete(Map<Id, SObject> oldItems) {}

    public void AfterInsert(Map<Id, SObject> newItems) {}

    public void AfterUpdate(Map<Id, SObject> newItems, Map<Id, SObject> oldItems) {}

    public void AfterDelete(Map<Id, SObject> oldItems) {}

    public void AfterUndelete(Map<Id, SObject> oldItems) {}

    /*
        Check the accounts to make sure their name does not contain the text "test".
        If any do, reject them.
    */
    private void AccountNameCheck(List<Account> accountList)
    {
        // Reject any Accounts which have the word "Test" in the name
        for (Account acc : accountList)
        {
            //if (acc.Name.contains('test'))
                //acc.Name.addError('You may not use the word "test" in the account name');
        }
    }
}
placing image/svg icon in rich area text field in Salesforce
public without sharing class ReleaseNotesController {
    
    @AuraEnabled public static String getReleaseNoteUrl ()
    {
        String label = System.Label.P360CommunityReleaseNoteDocumentName; 
        String docId=null,url=null,DocumentId=null,urlId=null;
        System.debug('Custom Label'+label);
        List <Document> doc=[SELECT Id, Name, NamespacePrefix FROM Document where Name=:label limit 1];
        if (doc != null && doc.size()>0)
        {
            docId = doc[0].Id;
            url = System.Label.P360CommunityDocURL; 
            DocumentId=docId.substring(0, 15);
            System.debug('Document Id '+ DocumentId);     
        }
        urlId=url + DocumentId;
        System.debug('URL' +urlId);
        return urlId;
    }
}
I want to open the pdf in lightning component how it can be done please help me out for this 
When I am using html data in lightning component it is not supported in all the browser s. What is solution for it
I want to use place holder for date picker me using ui:inputdate
<button class="slds-button slds-button--icon-border slds-float--left"  aria-live="assertive"  type="button" onclick="{!c.test}" value="{!ideas.Id}">
                                    <c:svgIcon svgPath="/resource/slds221/assets/icons/utility-sprite/svg/symbols.svg#like" category="utility" size="small" name="down" class="slds-button__icon slds-button__icon--large" />
                                    <span class="slds-assistive-text" id="like"  title="like">Like</span>
                                </button>

javascript code

  test:function(cmp,event){ 
      var ideaID = event.currentTarget.dataset.ideasID;
      alert(ideaID);
        
    }
I have one senario where i have on account i want to display related contacts and have one custom field email on account the same email should be reflected to related contacts.for this i need to write pseudo code or apex class
I am working on see more link in lightning its not working for please any one help me out for this as me wasted 1 full day for this .

I want hide some characters and on click of seemore link i want to show the hidden characters
I want the like and dislike button when presses the count should be update to object field Any idea for this?
I want to get difference of num of days between createddate and current date weather i should use now or today function
 <aura:attribute name="ideas" type="Idea[]" />
<ui:inputSelect class=" slds-float--left" label="Sort : " aura:id="selection" change="{!c.onChangeFunction}">
                <ui:inputSelectOption text="Trending" label="Trending" value="true" />
                <ui:inputSelectOption text="Popular" label="Popular"/>
                <ui:inputSelectOption text="Recent" label="Recent"/>
            </ui:inputSelect>

 onChangeFunction : function(cmp,event){
      var selected = cmp.find("selection").get("v.value");
   //onsole.log(selected);    
        if(selected=='Recent')
        {
             console.log('hi');
           var action = cmp.get("c.getIdea1");
            action.setCallback(this,function(response){
                if (response.getState() === "SUCCESS"){
                    alert('sqsq');
                    cmp.set("{!v.ideas}",response.getReturnValue());
                }
            }
        ); 
        }
    }

  @AuraEnabled
    public static List<Idea> getIdea1(){
        List<Idea> i=[SELECT Id, Title, Body, CreatedDate FROM Idea order by CreatedDate desc];
        System.debug('hi'+i);
        return [SELECT Id, Title, Body, CreatedDate FROM Idea order by CreatedDate desc];
    }

This is my above code but sort is not happening?
Hi all,

I want to retrive comment value from ideacomment object
Hi all,

I want short had the text if large text is there how can i achieve this?Please help me out
Here is my code Any help is appreciated
trigger Testopp on Opportunity (after insert, after update) {
    for(Opportunity opp:Trigger.new){
        if(opp.StageName=='Closed Won'){
            OpportunityLineItem op=new OpportunityLineItem();
            op.Demo5__Ready_to_close__c = true;
        }
    }
        


}

How can I add the small User Profile Picture when I referrence the OwnerID via 

<lightning:outputField fieldName="OwnerId" />

Currently, I only get the Name. I want it to be like on any other page: the photo + name. 

OwnerID without profile pic
I want it like this:
owner name with picture

My current code is:
 

<aura:component implements="force:hasRecordId,forceCommunity:availableForAllPageTypes">
  <aura:attribute name="recordId" type="Id"/>

<lightning:layout>
<lightning:layoutItem size="6" padding="around-small">
 <lightning:recordViewForm recordId="{!v.recordId}" objectApiName="cxsrec___cxsPosition__c">
 
<lightning:outputField fieldName="OwnerId" />
 
</lightning:recordViewForm>            
</lightning:layoutItem>
</lightning:layout>
</aura:component>
This component is used inside an accordeon Section:
<lightning:accordion>
            <lightning:accordionSection label="Label1">
                <aura:set attribute="body">
                    <my component>
                </aura:set>
            </lightning:accordionSection>                    
</lightning:accordion>

 

    @AuraEnabled
    public static String getSearchResult(String patientId , String searchTerm , String listName){
        Map<Integer , String> mapIndexOfDynamicList = new Map<Integer , String>();
        Map<String , List<Object>> mapSearchResult = new Map<String , List<Object>>();
        Map<String , Map<String , String>> mapFieldApi = new Map<String , Map<String , String>>();
        Map<String , Map<String , String>> mapLinkRef = new Map<String , Map<String , String>>();
        List<String> lstFieldApi = new List<String>();
        List<String> lstDataDomainQuery = new List<String>();
        List<String> lstArg = new List<String>();
        List<Dynamic_List__c> lstDynamicList = new List<Dynamic_List__c>();
        Integer index = 0;
       
        lstArg.add(patientId);
        String baseString = 'FIND \'' + searchTerm  + '\' IN ALL FIELDS  RETURNING ';
 
        if(String.isNotBlank(listName))
            lstDynamicList = [SELECT Id, Name, objectAPIName__c, WhereClause__c, SOSL_whereClause__c, Order_By__c, searchIndex__c,
                            (SELECT Id, Name, fieldAPIName__c, isLink__c, Link_Reference__c, Detail_Page__c FROM Dynamic_List_Fields__r ORDER BY index__c)
                        FROM Dynamic_List__c WHERE searchIndex__c != null AND Name =: listName ORDER BY searchIndex__c asc];
        else
            lstDynamicList = [SELECT Id, Name, objectAPIName__c, WhereClause__c, SOSL_whereClause__c, Order_By__c, searchIndex__c,
                            (SELECT Id, Name, fieldAPIName__c, isLink__c, Link_Reference__c, Detail_Page__c FROM Dynamic_List_Fields__r ORDER BY index__c)
                        FROM Dynamic_List__c WHERE searchIndex__c != null ORDER BY searchIndex__c asc];
                       
        for (Dynamic_List__c dl : lstDynamicList)
        {
            if(!mapIndexOfDynamicList.containsKey((Integer)dl.searchIndex__c)){
                if(String.isNotBlank(listName))
                    mapIndexOfDynamicList.put(1 , dl.Name);
                else
                    mapIndexOfDynamicList.put((Integer)dl.searchIndex__c , dl.Name);
            }
               
            lstFieldApi         = new List<String>();
            String detailPage   = '';
            String whereClause  = '';
            for (Dynamic_List_Field__c dlf : dl.Dynamic_List_Fields__r){
                lstFieldApi.add(dlf.fieldAPIName__c);
                if(dlf.isLink__c)
                {
                    lstFieldApi.add(dlf.Link_Reference__c);
                    //detailPage : Used to maintain value of the navigation , when clicked on hyperlink
                    detailPage = dlf.Detail_Page__c == null ? '' : dlf.Detail_Page__c;
                   
                    if(!mapLinkRef.containsKey(dl.Name))
                        mapLinkRef.put(dl.Name , new Map<String , String>());
                    mapLinkRef.get(dl.Name).put(dlf.fieldAPIName__c , dlf.Link_Reference__c+'#'+detailPage);
                }
               
                if(!mapFieldApi.containsKey(dl.Name))
                    mapFieldApi.put(dl.Name , new Map<String , String>());
                mapFieldApi.get(dl.Name).put(dlf.fieldAPIName__c , dlf.Name);
            }
            whereClause = String.isNotBlank(dl.SOSL_whereClause__c) == true ? string.format(dl.SOSL_whereClause__c, lstArg) : string.format(dl.WhereClause__c, lstArg);
            whereClause = whereClause.replace('\"','\'');
           
            if(String.isNotBlank(listName))
                lstDataDomainQuery.add(dl.objectAPIName__c + '(' + string.join (lstFieldApi, ',') + ' WHERE ' + whereClause + ' )');
            else
                lstDataDomainQuery.add(dl.objectAPIName__c + '(' + string.join (lstFieldApi, ',') + ' WHERE ' + whereClause + ' LIMIT 10 )');
        }
       
        //Looping across list of subQuery to process SOSL one by one, as we have same objects with different where clauses for multiple Data Domains
        for(String subQuery : lstDataDomainQuery){
            String searchString = '';
            searchString = baseString + subQuery;
            List<List<sObject>> searchList = search.query(searchString);
            index++;
            //Loop through records fetched by SOSL Query
            mapSearchResult = getDataDomainResult(index, searchList , mapIndexOfDynamicList, mapFieldApi, mapLinkRef, mapSearchResult);
        }
        System.debug('mapSearchResult :: ' + mapSearchResult);
        return Json.serialize(mapSearchResult);
    }
   
    public static Map<String , List<Object>> getDataDomainResult(Integer index , List<List<sObject>> searchList , Map<Integer , String> mapIndexOfDynamicList ,
                                                            Map<String , Map<String , String>> mapFieldApi, Map<String , Map<String , String>> mapLinkRef,
                                                            Map<String , List<Object>> mapSearchResult){
        for(List<sObject> lstSObj : searchList){
            String dlName = mapIndexOfDynamicList.get(index);
            List<Map<String , String>> lstResultRecord = new List<Map<String , String>>();
           
            //Loop through each record
            for(sObject SObj : lstSObj){
                Map<String , String> mapFieldToValue = new Map<String , String>();
               
                //Loop through each value to map the field api name with its display name maintained in Dynamic list Field and value fetched
                for(String api : mapFieldApi.get(dlName).keyset()){
                    String displayVal = '';
                    String linkrefApi = '';
                    String linkrefRedirectPage = '';
                    //Check if the value should be an hyperlink or just a value
                    if(mapLinkRef.containsKey(dlName) && mapLinkRef.get(dlName).containsKey(api)){
                        linkrefApi  = mapLinkRef.get(dlName).get(api).split('#')[0];
                        //If it is a hyperlink, get the redirect page for the hyperlink
                        if(mapLinkRef.get(dlName).get(api).split('#').size() > 1)
                            linkrefRedirectPage = mapLinkRef.get(dlName).get(api).split('#')[1];
                        else
                            linkrefRedirectPage = dlName;
                    }
                    //Get the fetched values against the api
                    if(SObj.getPopulatedFieldsAsMap().containsKey(api)){
                        if(linkrefApi != '')
                            displayVal = '<button name= "' + linkrefRedirectPage + '" value = "' + dlName + '" id="'+ String.valueOf(SObj.getPopulatedFieldsAsMap().get(linkrefApi)) + '" title= "'+ String.valueOf(SObj.getPopulatedFieldsAsMap().get(api)) + '" class=\'linkbutton\'>' + String.valueOf(SObj.getPopulatedFieldsAsMap().get(api)) + '</button>';
                        else
                            displayVal = String.valueOf(SObj.getPopulatedFieldsAsMap().get(api));
                    }
                    //Populate the map with field display name and value
                    mapFieldToValue.put(mapFieldApi.get(dlName).get(api) , displayVal);
                }
                //Add all records to the list
                lstResultRecord.add(mapFieldToValue);
            }
            if(!lstResultRecord.isEmpty())
                mapSearchResult.put(dlName , lstResultRecord);
        }
        return mapSearchResult;
    }
     @AuraEnabled
    public static void updateUserSession(String currentPage, String fname, String lname, String cin, String dob, String gender){
        UtilityGeneral.updateUserSession(currentPage, fname, lname, cin, dob, gender);
    }
    @AuraEnabled
    public static void logHIPAAAudit(String acctId ,String hc_DataComponent){
        HIPAAAuditLogin__c hipaaauidLogObj=HIPAAAuditLogin__c.getInstance(hc_DataComponent);
        if(hipaaauidLogObj!=null && acctId != null )
        {
            HIPAAAuditLogController.logAccess(acctId, hc_DataComponent);
        }
    }
}
 
placing image/svg icon in rich area text field in Salesforce
I want to open the pdf in lightning component how it can be done please help me out for this 
When I am using html data in lightning component it is not supported in all the browser s. What is solution for it
I want to use place holder for date picker me using ui:inputdate
 <aura:attribute name="ideas" type="Idea[]" />
<ui:inputSelect class=" slds-float--left" label="Sort : " aura:id="selection" change="{!c.onChangeFunction}">
                <ui:inputSelectOption text="Trending" label="Trending" value="true" />
                <ui:inputSelectOption text="Popular" label="Popular"/>
                <ui:inputSelectOption text="Recent" label="Recent"/>
            </ui:inputSelect>

 onChangeFunction : function(cmp,event){
      var selected = cmp.find("selection").get("v.value");
   //onsole.log(selected);    
        if(selected=='Recent')
        {
             console.log('hi');
           var action = cmp.get("c.getIdea1");
            action.setCallback(this,function(response){
                if (response.getState() === "SUCCESS"){
                    alert('sqsq');
                    cmp.set("{!v.ideas}",response.getReturnValue());
                }
            }
        ); 
        }
    }

  @AuraEnabled
    public static List<Idea> getIdea1(){
        List<Idea> i=[SELECT Id, Title, Body, CreatedDate FROM Idea order by CreatedDate desc];
        System.debug('hi'+i);
        return [SELECT Id, Title, Body, CreatedDate FROM Idea order by CreatedDate desc];
    }

This is my above code but sort is not happening?
Hi all,

I want short had the text if large text is there how can i achieve this?Please help me out
Here is my code Any help is appreciated
trigger Testopp on Opportunity (after insert, after update) {
    for(Opportunity opp:Trigger.new){
        if(opp.StageName=='Closed Won'){
            OpportunityLineItem op=new OpportunityLineItem();
            op.Demo5__Ready_to_close__c = true;
        }
    }
        


}
I am unable to use

<svg>
                   <c:svgIcon svgPath="/resource/slds221/assets/icons/utility-sprite/svg/symbols.svg#chart" category="utility" size="small" name="user" />
                          </svg>
public with sharing class RequestEditController {
private final Request_Cab__c request;
    public RequestEditController() {
       
    }
     public RequestEditController(ApexPages.StandardController standardPageController) {
        request = (Request_Cab__c)standardPageController.getRecord(); 
    }

    public Pagereference pageredir()
      {
           
         Request_Cab__c recordDetails = [SELECT Id FROM Request_Cab__c WHERE Id = :request.Id];
         PageReference returnPage = Page.RequestEditPage;
         returnPage.setRedirect(true); 
        return returnPage; 
}
     
    
    
}

I've written a custom controller that exploits the StandardSetController class to return a page of records and allow pagination.

 

VF controller has three (relevant) methods:

 

getPage()  - returns List of records in current pageset (pagesize = 10)

previousPage() - executes the previous() method on the standard set controlller object

nextPage() - executes the next() method on the standard set controller object

 

The StandardSetController is constructed using a Database.getQueryLocator per the doc

 

setCtlr = new ApexPages.StandardSetController(

Database.getQueryLocator(

[Select id, name, Account__r.name from Foo__c where id in :fooIdSet]));

When I set up my APEX test method:

 

1.  Insert 11 rows into database  //works ok

2.  Assert that getPage() returns 10 rows  // assertion passes

3.  Execute nextPage() on the controller

4.  Assert that getPage() returns 1 row (the 11th)

 

Here's the problem: step #3 fails because VF comes back with:

 

System.VisualforceException: Modified rows exist in the records collection!

 

I checked the creation datetime and lastmodify datetime just prior to executing Step3 and all is OK, the records haven't mysteriously been changed underneath.

 

I get the same error (in a non-Sites test whilst logged in as admin and simply executing the VF page in the browser.

 

What would cause this error?

Message Edited by crop1645 on 04-08-2009 05:12 PM
Message Edited by crop1645 on 04-08-2009 05:14 PM