• Sunil Madana
  • NEWBIE
  • 370 Points
  • Member since 2014
  • Senior Salesforce Developer
  • http://sfdcdreamer.wordpress.com

  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 12
    Likes Given
  • 0
    Questions
  • 101
    Replies

Created a junction Object CaseContact between (Case and Contact).

Related list of CaseContacts are configured on the Case Page Layout as shown in following screen shot:

User-added image
I would like to add a link to a Contact related list which will be navigated to Contact details page.
But I do not see a field to be added in a related list configs. Is this possible using standard configuration without custom development ?
User-added image

 

 

Hello Helper

I am building a Ligthning component  where I  have a grid  witrh col  items and inside each  column cell  i am inserting  other component(Ligthning:datatable)

When the component is  displayed its  heigth  is  adjusted  to match the height  of the datatable like  below:

User-added image
I DO NOT  want this

I  would  like  to  define the height of the column box  and if  datatable  has many  rows  i  would  like to add scrollign to  the grid col

I  guess  i  have to use  class="slds-scrollable"
BUt I  am not able  to do it properly

See below  a piece of  my  code  where I define 1  column

        <div class="slds-grid">
          <div class="slds-col slds-box  slds-size_3-of-12  ">
            <span >
                                <lightning:datatable data="{!obj.innerdata}" 
                                    columns="{!v.InnerOppTHeader}" 
                                    keyField="id"  
                                    hideCheckboxColumn="true"
                                    >    
                                </lightning:datatable> 
            </span>
          </div>
   ...
  </div>


any  sugestions?

Thanks in advance
Csbaa
Just looking to have a status change from "Awaiting Customer Feedback" to "Working" when a Feed Comment post is made: A picture of the example is below. Any help would be appreciated!!!
!User-added imageThe top I did in process builder. The highlighted I'm having trouble with. 
I am New to salesforce , I have alway try to find a solution for When we go for the triggers apart from Workflow and Batch apex? plese give me atleast  2 Real time Scenarios 
I am trying to create an apex:selectList but I am getting stumped. I think the issue resides in my controller extension. I am not a developer by any means so I am not sure what I am doing wrong.  The apex list is intended to be a multi select.
 
<apex:page standardController="Task" extensions="LogACallControllerExtension,NextStep" docType="html-5.0" showHeader="false" standardStylesheets="false">

<apex:form >     
<div class="app-content"> 
<header>
<h1>Log A Call</h1><br /><br />
</header>

<section class="border-bottom">
<div class="content">   
 <label>Next Steps</label><br />
 <apex:selectList id="NextStep" styleclass="sf1input" multiselect="true" value="{!Task.Next_Steps__c}" size="1" />
<apex:selectOptions value="{!NextStepOptions}"/>
  </div>
 </section

<section class="data-capture-buttons one-buttons">
<div class="content"><apex:commandButton value="Save" action="{!save}" /><br />
</div>
</section>
</div>
</apex:form>
</apex:page>

**---ControllerExt--** 

public with sharing class NextStep {

    public NextStep() {

    }


    public NextStep(ApexPages.StandardController controller) {

    }

        String[] NextSteps = new String[]{};
         public PageReference test() {
            return null;
        }
            
        public Task task {get; set;}
            
        public List<SelectOption> getNextStepOptions() {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('Op1','Op1'));
            options.add(new SelectOption('Op2','Op2'));
            options.add(new SelectOption('Op3',Op3));
             options.add(new SelectOption('Op4','Op4'));
             
            return options;
        }
            
        public String[] getNextSteps() {
            return NextSteps;
        }
            
        public void setNextSteps(String[] NextSteps) {
            this.NextSteps = NextSteps;
        }
    }

 
  • March 01, 2016
  • Like
  • 0
Looking to get an email notification when a customer in our community comments on a "TEXT POST" feed comment. I'm not sure how to accomplish this or where to start. 
 
hi,

i need to order Tasks with a High priority  display first in red font than sort by Due Date with the oldest due date first.

any help will be much appreciated. thank you
Hi All,
Hope you all are doing good.

Dear all i stuck at a point and need help from all experts here.
Actually according to my requirement I have designed a page which will opens up when an user clicks a button on opportunity and this page consists 2 sections as "Account Commercial Address" and "Account Installation Address" section holding the coomercial address of the account and installation address of the account respectively.
I have also include a button "Add" button at the bottom of the page.Whenever an user is selecting the addresses on page and clicks on Add button the selected addresses the pop up window should close and page will get refreshed and selected address should come as a line item on opportunity.Till here I have developed and everything is working fine.
My issue is suppose an user is not selected any addresses and clicks on Add button then the user should get an error message on page itself something like" Please select atleast an address" but I am not able to achieve this particular thing after so much work. Right now even if an user clicks on Add button without selecting any address then also pop up is getting close and page is getting referesh.Ideally what i want to achieve is if nothing is selected then an error should be displayed and pop up should not be closed.
I am attaching my codes also.

Please help me out here.
Many thanks in advance.
<apex:page standardController="Opportunity" sidebar="false" showHeader="false"  extensions="TfB_SA_OpportunityCanvas_Controller">
<head>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
</head>
 <apex:form >

    <script type="text/javascript" src="/soap/ajax/31.0/connection.js"></script>
    <script type="text/javascript" src="/canvas/sdk/js/31.0/controller.js"></script>
<apex:pageBlock >
    <!-- Invoking the Canvas app, No parameters are passed from Opportunity -->
  <!--  <div align="center" id='spanDisplayLabel' style='border:px'>
    <apex:pageBlockSection title="New Installation Address" collapsible="false" columns="1" ></apex:pageBlockSection></div>-->
    <div align='Center' style='font-size:16px;'><br/><b><b>New Installation Address</b></b></div>
    <apex:canvasApp developerName="Tfb_SA_Canvas" width="100%" height="500px" />
    
    <script>
    
        Sfdc.canvas(function() { 
        
            /*
             * Description : This function subscribes to the Canvas application publish event
             *               'updateAddressEvent' and update Tina Address and Opportunity object              
             * Returns     : void
            */  
                  
            Sfdc.canvas.controller.subscribe({name : 'updateAddressEvent',
                onData : function (e) {
                    
                    try{
                    
                        /* Upsertion of Tina Address record starts */
                        sforce.connection.sessionId = '{!$Api.Session_ID}';
                        var ta= new sforce.SObject("TFB_SA_Tina_Address__c");
                        ta.Name = e.TinaLocationId;
                        if (e.Apartment && e.Apartment != 'null'){
                            ta.Tfb_SA_Apartment__c = e.Apartment;
                        }
                        if (e.Box && e.Box != 'null') {
                            ta.Tfb_SA_Box__c= e.Box;
                        }
                        if (e.Country && e.Country != 'null') {
                            ta.TfB_SA_Country__c = e.Country;
                        }
                        if (e.FloorNumber && e.FloorNumber != 'null') {
                            ta.Tfb_SA_Floor_Number__c = e.FloorNumber;
                        }
                        if (e.HouseNumber && e.HouseNumber != 'null') {
                            ta.Tfb_SA_House_Number__c = e.HouseNumber;
                        }
                        if (e.Municipality && e.Municipality != 'null') {
                            ta.Tfb_SA_Municipality__c = e.Municipality;
                        }
                        if (e.PostalCode && e.PostalCode != 'null') {
                            ta.Tfb_SA_Postal_Code__c = e.PostalCode;
                        }
                        if (e.Street && e.Street != 'null') {
                            ta.Tfb_SA_Street__c = e.Street;
                        }                       
                        if (e.SubHouseNumber && e.SubHouseNumber != 'null') {
                            ta.Tfb_SA_Sub_House_Number__c = e.SubHouseNumber;
                        }                        
                        if (e.SubLocation && e.SubLocation != 'null') {
                            ta.Tfb_SA_SubLocation__c = e.SubLocation;
                        }                        
                        if (e.TinaLocationId && e.TinaLocationId != 'null') {
                            ta.Tfb_SA_Tina_Location_Id__c = e.TinaLocationId;
                        }                        
                               
                        var result = sforce.connection.upsert("Tfb_SA_Tina_Location_Id__c", [ta]);
                        
                        /* Upsertion of Tina Address record ends */
                    
                        /* Insertion of Opportunity Installation Address starts */
                        
                        if (result[0].getBoolean("success")) {
                            var oppInstAdd = new sforce.SObject("Tfb_SA_Opportunity_Installation_Address__c");
                            oppInstAdd.TfB_SA_TinaOpportunity_Location_Id__c = e.TinaLocationId + '{!$CurrentPage.parameters.optyId}'; // Added for Upsert opertaion
                            oppInstAdd.Tfb_SA_Opportunity__c = '{!$CurrentPage.parameters.optyid}';
                            oppInstAdd.Tfb_SA_Tina_Address__c = result[0].id;
                            var oppresult = sforce.connection.upsert("TfB_SA_TinaOpportunity_Location_Id__c",[oppInstAdd]); // Modified from Insert to Upsert  
                            
                            
                            var accInstAdd = new sforce.SObject("TfB_SA_Account_Installation_Address__c");
                            accInstAdd.Tina_Account_LocationId__c= e.TinaLocationId + '{!$CurrentPage.parameters.accId}'; // Added for Upsert opertaion
                            accInstAdd.TfB_SA_Account__c= '{!$CurrentPage.parameters.accid}';
                            accInstAdd.TfB_SA_Tina_Address__c= result[0].id;
                            var accresult = sforce.connection.upsert("Tina_Account_LocationId__c",[accInstAdd]); // Modified from Insert to Upsert                               
                            
                            if (oppresult[0].getBoolean("success")) {
                                // closing the popup page
                                window.close()
                                } else {
                                alert("Error : Could not update this Opportunity" + oppresult[0].errors.message);
                            }
                        } else {
                            alert("Error : Could not Insert/Update the Tina Address" + result[0].errors.message);
                        }
                        
                        /* Insertion of Opportunity Installation Address record ends */
                    
                    } catch (ex){
                        alert ("Exception :" + ex);
                    }
                }
           });
        });     
        
     </script>
     
     <!--Below sections added as part of Rel16.1-->
     <!--Below script implements the checkbox selection for account-->
<script>
function doCheckboxChange(cb,itemId){ 
  
    if(cb.selected){
        
        SelectItem(itemId);        
    }
    else{
        
        aDeselectItem(itemId);
    }
}
</script>     
  <!--   <div align="center" id='spanDisplayLabel' style='border:px'>
    <apex:pageBlockSection title="Existing Account Address" collapsible="false" columns="1"></apex:pageBlockSection></div>-->
    <div align='Center' style='font-size:16px;'><br/><b><b>Existing Account Address</b></b></div>
    <p><b>Select and add one or more Existing address(es) of Account shown below as Installation address(es) on this Opportunity</b></p><br/>
   
   <apex:pageBlock >  
     <!------------------Existing Installation Address------------------->
      <!--Commercial address section start--->
              <div align="left">
           <apex:pageBlockSection title="Account Commercial Address" collapsible="false" columns="1" >
        
            <apex:pageBlockTable value="{!commAddress}" align="left" var="c" id="table" rendered="{!comChkFlag}">                            
                 <apex:column style="Width:10px"> 
                           <apex:inputCheckbox value="{!commFlag}" id="inputId">
                        </apex:inputCheckbox>                                                            
                 </apex:column>  
                 <apex:column style="Width:800px">
                     <apex:outputText value="{!c.TfB_SA_Commercial_Address__c}"></apex:outputText>
                 </apex:column>  
            </apex:pageBlockTable>
          </apex:pageBlockSection></div> <apex:outputText style="color:red" value="{!messageCmm}" rendered="{!comaddFlag}"></apex:outputText>
                         <!--Commercial address section Ends--->     
                      
                     
                     
                                  <!--Account installation address start--->
                                  
             <div align="left">
             <apex:pageBlockSection title="Account Installation Address(es)" collapsible="false" columns="1">           
               <apex:pageBlockTable value="{!CurrentList}"  align="left" var="c" id="table1" rendered="{!acChkFlag}">
                 <apex:column style="Width:10px"> 
                    <apex:inputCheckbox value="{!c.selected}" id="inputId" onchange="doCheckboxChange(this,'{!c.vSub.Id}')">
                         </apex:inputCheckbox>                                                                     
                 </apex:column>                 
                 <apex:column style="Width:800px">
                     <apex:outputText value="{!c.vSub.TfB_SA_Concatenated_Tina_Address__c}"></apex:outputText>
                 </apex:column>                 
               </apex:pageBlockTable>
             </apex:pageBlockSection>   </div><apex:outputText style="color:red" value="{!messageAcc}" rendered="{!msgFlag}"></apex:outputText>  
                               <!--Account installation address End--->  
                                         <!----------------------Account Ends------------------>
            </apex:pageBlock>                             
      <div align="center"><apex:commandButton action="{!Add}" value="Add"  id="button" oncomplete="javascript:CloseAndRefresh()"/></div> 
      
      <script language="JavaScript" type="text/javascript">
            function CloseAndRefresh(){
        <!--window.opener.location.href="/{!$CurrentPage.parameters.id}";-->
          window.top.close();    
      }
        </script>
         
     </apex:pageBlock>
   </apex:form>
  </apex:page>
 
Public Class TfB_SA_OpportunityCanvas_Controller{
    
    public string accId;
    public string oppId;
    public string tinaLocId;      
    public List<wrapSubscription> SubscriptionSetList{get;set;}  
    public TfB_SA_Account_Installation_Address__c vSub{get;set;}  
    public set<TfB_SA_Account_Installation_Address__c> selectedSubscription{get;set;}
    public list<TfB_SA_Opportunity_Installation_Address__c> opplist{get;set;}
    public list<Account> commAddlist {get;set;}
    public boolean commFlag{get;set;} 
    public boolean comChkFlag{get;set;}
    public boolean acChkFlag{get;set;}
    public boolean msgFlag{get;set;}
    public Boolean comaddFlag{get;set;}
    public String messageAcc{get;set;}
    public String messageCmm{get;set;} 
    


    //constructor
    public TfB_SA_OpportunityCanvas_Controller(ApexPages.StandardController controller) {    
    oppId=ApexPages.currentPage().getParameters().get('optyId');
    //accId=ApexPages.currentPage().getParameters().get('accid');
    tinaLocId=ApexPages.currentPage().getParameters().get('tinaLocationId');
    system.debug('Account ID:'+accId);
   // accId=[SELECT AccountId From Opportunity Where ID =:oppId];
     vSub= new TfB_SA_Account_Installation_Address__c();  
     this.selectedSubscription = new set<TfB_SA_Account_Installation_Address__c>();      
     SubscriptionSetList = new List<wrapSubscription>();
     commAddlist= new list<Account>();
     messageCmm='No commercial addresses found on Account.';   
     commFlag=false;     
     comChkFlag=true;
     acChkFlag=true;
     msgFlag=false;
     comaddFlag=false;   
     List<Account> templist1=new List<Account>();
     tempList1=getcommAddress();
     List<wrapSubscription> templist=new list<wrapSubscription>();
     templist=getCurrentList();   
      
    
    } 
       
     //Below method is used to fetch Commercial Address from Account     
    public list<Account> getcommAddress(){
    commAddlist=[SELECT TfB_SA_Tina_Address__c,TfB_SA_Commercial_Address__c FROM Account Where id IN (SELECT Accountid From Opportunity Where ID=:oppId)];
    system.debug('enter2 com');    
    if(commAddlist.size()==0 || (commAddlist.size()==1 && commAddlist[0].TfB_SA_Commercial_Address__c == null)){    
    comaddFlag=true;
    comChkFlag=false;   
    }  
    
    return commAddlist;
    
    }
            
            
            
    //Following function implements wrapper logic 
    public List<wrapSubscription> getCurrentList( ){        
        updateSelectedSubscriptions();  
        SubscriptionSetList = new List<wrapSubscription>();
        for (TfB_SA_Account_Installation_Address__c vSubscription : (List<TfB_SA_Account_Installation_Address__c>)SubSetController.getRecords( )){
                SubscriptionSetList.add(new wrapSubscription(vSubscription));
                    
    }
     if(SubscriptionSetList.Size()>0){
        msgFlag=false;
        acChkFlag=true;         
        system.debug('acChkFlageee'+acChkFlag);
        return SubscriptionSetList;
        }
        else{
        acChkFlag=false;
        msgFlag=true;         
        messageAcc='No installation addresses found on Account.';        
        ///ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'No installation addresses found on account. You can add an installation address by clicking on the Add Installation Address button on the account'));
        system.debug('enter1'+SubscriptionSetList.Size());
        system.debug('acChkFlag'+acChkFlag);
        return null;
        }
        
   }
      public ApexPages.StandardSetController SubSetController{ 
        
        get{            
            if(SubSetController == null){                                
                SubSetController = new ApexPages.StandardSetController([SELECT Id,TfB_SA_Tina_Address__c,Location_ID__c,Tina_Account_LocationId__c,TfB_SA_Concatenated_Tina_Address__c,TfB_SA_Account__c FROM TfB_SA_Account_Installation_Address__c WHERE TfB_SA_Account__c IN (SELECT Accountid From Opportunity Where ID=:oppId)]);
                }
            return SubSetController;
          }set;
     }
    
   //This method update the selected Subscriptions List in the wrapper Class
    public void updateSelectedSubscriptions(){
        for(wrapSubscription cs: SubscriptionSetList){
            if(cs.selected){              
                selectedSubscription.add(cs.vSub);               
              }
            else{            
                if(selectedSubscription.contains(cs.vSub))
                selectedSubscription.remove(cs.vSub);                              
            }
           // wrapObj.put(cs,cs.vSub);
        }
        system.debug('selectedSubscription'+selectedSubscription);
    }
       
    //Wrapper class logic      
    public class wrapSubscription{
        public TfB_SA_Account_Installation_Address__c vSub {get; set;}        
        public Boolean selected {get; set;}       
        public wrapSubscription(TfB_SA_Account_Installation_Address__c a){
            vSub = a;
            selected = false;
        }
        public wrapSubscription(TfB_SA_Account_Installation_Address__c c,string s){
            vSub=c;
            selected=true;
        }       
        
    }
    
    //Below Method is used to Upsert Commercial Address from  Account to Opportunity Installation Address
    public PageReference AddComm() {
    List<TfB_SA_Opportunity_Installation_Address__c> templist = new List<TfB_SA_Opportunity_Installation_Address__c>();    
    templist=[Select Location_ID__c,TfB_SA_Tina_Address__c,TfB_SA_TinaOpportunity_Location_Id__c FROM TfB_SA_Opportunity_Installation_Address__c Where TfB_SA_Opportunity__c=:oppId AND Location_ID__c=:tinaLocId];
     system.debug('templist::'+templist);
   //  system.debug('templist'+templist);
     
     if(templist.size()==0){
         TfB_SA_Opportunity_Installation_Address__c objtemp1 = new TfB_SA_Opportunity_Installation_Address__c();         
        // objtemp1.Location_ID__c=tinaLocId;
     objtemp1.TfB_SA_TinaOpportunity_Location_Id__c=tinaLocId+oppId;     
     objtemp1.TfB_SA_Tina_Address__c=commAddlist[0].TfB_SA_Tina_Address__c;
     objtemp1.TfB_SA_Opportunity__c=oppId;
     insert(objtemp1);
         }
         
      else{
         TfB_SA_Opportunity_Installation_Address__c objtemp =[Select Location_ID__c,TfB_SA_Tina_Address__c,TfB_SA_TinaOpportunity_Location_Id__c FROM TfB_SA_Opportunity_Installation_Address__c Where TfB_SA_Opportunity__c=:oppId AND Location_ID__c=:tinaLocId]; 
        // objtemp.Location_ID__c=tinaLocId;
     objtemp.TfB_SA_TinaOpportunity_Location_Id__c=tinaLocId+oppId;     
     objtemp.TfB_SA_Tina_Address__c=commAddlist[0].TfB_SA_Tina_Address__c;
     //objtemp.TfB_SA_Opportunity__c=oppId;
     update(objtemp);
     }
     return null;  
     }    
    
    
    //Below Method is used to Upsert Commercial Address from  Account Installation Address to Opportunity Installation Address
     public PageReference Add() {
     
     updateSelectedSubscriptions();
     if(commFlag){
            AddComm();
            commFlag=false;
            }
               
     system.debug('selectedSubscription'+selectedSubscription);
     
   
     List<TfB_SA_Opportunity_Installation_Address__c> listele = new List <TfB_SA_Opportunity_Installation_Address__c>();       
     List<TfB_SA_Opportunity_Installation_Address__c> objlist = new List <TfB_SA_Opportunity_Installation_Address__c>();
     listele=[SELECT TfB_SA_Tina_Address__c,TfB_SA_TinaOpportunity_Location_Id__c From TfB_SA_Opportunity_Installation_Address__c];
     
     //TfB_SA_Opportunity_Installation_Address__c 
     
     for(TfB_SA_Account_Installation_Address__c list2 :selectedSubscription){

         listele=[SELECT Location_ID__c,TfB_SA_Tina_Address__c,TfB_SA_TinaOpportunity_Location_Id__c From TfB_SA_Opportunity_Installation_Address__c  WHERE TfB_SA_Opportunity__c=:oppId AND Location_ID__c=:list2.Location_ID__c];
         //if(listele.TfB_SA_TinaOpportunity_Location_Id__c!=list2.TfB_SA_Opportunity_Installation_Address__c){   
         system.debug('sizeeeee:'+listele);
         if(listele.size()==0){
             TfB_SA_Opportunity_Installation_Address__c obj = new TfB_SA_Opportunity_Installation_Address__c();
             obj.TfB_SA_TinaOpportunity_Location_Id__c=list2.Location_ID__c+oppId;
             obj.TfB_SA_Tina_Address__c=list2.TfB_SA_Tina_Address__c;
             obj.TfB_SA_Opportunity__c=oppId;
             insert(obj);
         }
         else{
         List<TfB_SA_Opportunity_Installation_Address__c> obj1 = new List<TfB_SA_Opportunity_Installation_Address__c>();
         obj1 =[SELECT Location_ID__c,TfB_SA_Opportunity__c,TfB_SA_Tina_Address__c,TfB_SA_TinaOpportunity_Location_Id__c From TfB_SA_Opportunity_Installation_Address__c WHERE TfB_SA_Opportunity__c=:oppId AND Location_ID__c=:list2.Location_ID__c];  
            for(TfB_SA_Opportunity_Installation_Address__c oplist : obj1 ){
             oplist.TfB_SA_TinaOpportunity_Location_Id__c=list2.Location_ID__c+oppId;
             oplist.TfB_SA_Tina_Address__c=list2.TfB_SA_Tina_Address__c;
             //obj1.TfB_SA_Opportunity__c=oppId;
             update(oplist);
             }
        } 
       
     
     
     }
     
     return null;  }    
                 
         
}

 
Hi,
I need to fetch and add some custom field values related to Event object in Event page layout. I have created a VF page and tried to use place holders for blurred text.
<apex:page standardController="Event" cache="true" docType="html-5.0">
<apex:form>
<apex:pageBlock>
<apex:inputTextArea value="{!Event.Minutes__c}" html-placeholder="Customername" style="width: 750px; height: 150px;">
</apex:inputTextArea>
</apex:pageBlock>
</apex:form>
</apex:page>
The problem is i cant add multiple placeholders inside a textbox. i need similar kind of UI to display in my Event Standard page layout.

User-added image

So when the user enter the event record these fields needs to be populated automatically from Event (Assigned to, StratDate, EndDate, etc) and the other custom fields needs to be entered manually within the textbox. All the values needs to be stored in that particular Textbox. Whether this is possible?

Thanks
Vivek
Hi,

I have a requirment where I want to print a every single record from a list using javascript.
Following is my conntroller and javaScript logic,

public class MyCompController
{
    public List<String> AccountIdList {get; set;}  
    public MyCompController()
    {
        List<Account> acc = [Select name, id from account];
        AccountIdList = new List<String>();
        for(Account a : acc)
        {
            AccountIdList.add(a.id);
        }   
    }
}

<script>
             var arr1 = new Array();      // OR var arr1 = [];       
             <apex:repeat value="{!AccountIdList}" var="accId">
                      arr1.push('{!accId}');
             </apex:repeat >                   
             alert('#### elements :' +arr1);       
</script>

Now I got list of accounts in arr1 array.
I want to print every single record of account , like (Name='abc', Id='a002800000NqbeB'), from this array in a table.

Please advice what needs to be done?
Thanks.
i downloaded a zip file from a blog which contains .cls and .page files . And i instal force.com ide eclipse tool . i don't know how to view those files in the eclipse and deploye to the organization. anybody have any idea help me
  • April 06, 2018
  • Like
  • 0
When someone COMMENTS on a POST in a CASE where do I find this Comment? I am trying to create some kind of workflow or process that updates another field when a post is made and that I have accomplished, but I need it to happen when these COMMENTS are left on posts as well but I cannot find where they are located and how to fire off of them. I have been looking for it via SOQL and cannot find the home of these things, I can find the post as FeedItem easily but I cannot find the Comments under it and how I relate them back to their Parent and the Case itself.

As the attached picture shows I have looked in the FeedItem,  UserFeed, CaseComment, Case objects and cannot find this item in any of them. 

User-added image
Hello Everyone, 
Please help me to resolve the below issue which is related to the formula field.
I need to add one more IF statement which says if  Custom FieldABC check box is unchecked then use the below formula.


CASE(IF(XYZ CUSTOM FIELD CHECKBOX ,1,2), 
IF(Price>=0 && Price<10, 1, 0), 1, 
IF(Price>=10 && Price<100, 1, 0), 2, 
IF(Price>=100 && Price<500, 1, 0), 3, 
IF(Price>=500 && Price<1000, 1, 0), 4, 
IF(Price>=1000 && Price<10000, 1, 0), 5, 
IF(Price>=100000, 1, 0), 6, 
0)
I'm using the new component lightning:treeGrid and need to set selected multiples rows when i create or initialize the component. ?

Thats posible ?

Thanks

Created a junction Object CaseContact between (Case and Contact).

Related list of CaseContacts are configured on the Case Page Layout as shown in following screen shot:

User-added image
I would like to add a link to a Contact related list which will be navigated to Contact details page.
But I do not see a field to be added in a related list configs. Is this possible using standard configuration without custom development ?
User-added image

 

 

Hi! I'm trying very hard to figure out how to make this Apex Action run directly from a Lightning Component. We used to run it from a VF page but it's ugly.

Does anyone know how to do this? I @AuraEnabled the method within the Apex class, and Identified the controller in the header. But it says there's an "Uncaught Unknown controller action 'getkickoffworkflow'"

 
Hi All,

Am very new to API.In my salesforce org, somebody implemented the API. I don't know whether its REST/SOAP.

Now I want to do some changes in that. Kindly let me know, where I to find the respective API details in my Org.

 
While I am trying to Save data in Server side below error is captured:
An internal server error has occurred
Error ID: 694637652-163917 (119852647)
On checking logs there is null pointer exception and I can see regForm instance is holding "NULL" value.Sever side controller null pointer exception
Below is the component and controller code:
Component Code

<aura:component controller="admtest__.SaveRegistrationFormDetails" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"
                access="global" >
    
    <aura:attribute name="abc" type="String"/>
    <aura:attribute name="Name" type="String" default="" />
    <aura:attribute name="ParentName" type="String" default="" />
    <aura:attribute name="StandardOrClass" type="String" default="" />
    <aura:attribute name="NumberOfStudyHours" type="String[]"
                    default=" , Less than an hour ,In between 1 to 4,
                             In between 4 to 8, More than 8  hours" />
    <aura:attribute name="UsersResponse1" type="String" default=""/>
    <aura:attribute name="MobileNumber" type="Integer" default="" />
    <aura:attribute name="RegisteredCourseBefore" type="Boolean" default="false" />
    <aura:attribute name="InterestedInOnlineCourse" type="Boolean" />
    <aura:attribute name="CheckBoxvalue" type="Boolean" default="false"/>
    <aura:attribute name="PageHeading" type="String" default="Registration form for Students"/>
    <aura:attribute name="EducationalDetailList" type="List" default="[]"/>
    <aura:attribute name="RegForm" type="admtest__Registration_Form__c" default="{'sobjectType' : 'admtest__Registration_Form__c'}" />
    <br/><br/>
    
    <div class="slds-page-header">
        <div class="slds-align_absolute-center" style="height: 5rem;">
            <div class="slds-text-heading--large">
                <div class="slds-m-*_large">
        {!v.PageHeading}
                </div>
           </div>
    </div>
    </div>
    
    <div class="slds-size--5-of-8">
    <lightning:input label="Enter your Name" name="StudentName" value="{!v.RegForm.Name}"/>
    <br/>
    <lightning:input label="Enter you Parents name" name="parent" value="{!v.RegForm.admtest__Parent_Name__c}"/>
    <br/>
        <lightning:input label="Enter your Class " name="StandardOrClass" value="{!v.RegForm.admtest__Which_Class__c}"/>
    <br/>
    
    <lightning:select name="numofStudyHrs" label="How many  hours do you Study"
                      value="{!v.RegForm.admtest__Study_Hours__c}">
            <aura:iteration items="{!v.NumberOfStudyHours}" var="hrs">
                <option value="{!hrs}" text="{!hrs}"/>
        </aura:iteration>
    </lightning:select>
    <br/>
    
    <lightning:input name="MobileNumber" label="Phone Number" type="telephone" value="{!v.RegForm.admtest__Mobile_Number__c}"/>
    <br/>
        
        <aura:iteration items="{!v.EducationalDetailList}" var="item" indexVar="index">
        <c:Add_Educational_Details EducationalDetailListInnerComponent="{!v.EducationalDetailList}" IndexNo="{!index}"/>
        </aura:iteration>
     
    <lightning:button iconName="utility:add" variant="border-filled" label="Add Educational Details" onclick="{!c.addDetails}"></lightning:button>
        <br/>        
        <lightning:input type="checkbox" label="Are you available on weekends for Class" name="coursecheckbox" />
 
    <br/>
    <lightning:input aura:id="checkBox" type="checkbox" onchange="{!c.onCheckChange}" label="Are you interested in online course?" name="onlinechk"/>
     <aura:if isTrue="{!v.CheckBoxvalue}">
         <i>Happy Learning!</i>
    </aura:if>   
        
        <br/>
        
    <lightning:button type="Submitt" onclick="{!c.doSubmit}">Submitt</lightning:button>
        </div>
</aura:component>

Controller Code:
({
    doSubmit : function(cmp, evt, hlpr) {
        //call an apex function to store data in reg form
        //pass regform as paramamer which  you  have mentioned in attribute
        var RegForm = cmp.get("v.RegForm");
        var action = cmp.get("c.SaveRegistrationDetail");
        //set the paramamter  value
        action.setParams({ regForm  : RegForm });
        
        //set the callback  function
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                alert("From Server: " + response.getReturnValue());
                console.log("From Server:" + response.getReturnValue());
                
            }
           else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " +
                                 errors[0].message);
                    }
                } else {
                    console.log("Unknown error");
                }
       
        // $A.enqueueAction adds the server-side action to the queue.
       
            }
        });
        $A.enqueueAction(action);  
        
    },
    
    onCheckChange: function(cmp,evt,hlpr) {
    console.log("this is  from controller Function");
        //function defined in helper section;
        
        hlpr.onClickCheckBoxHelper(cmp,event);
       },
    
    addDetails: function(cmp,evt,hlpr){
      console.log("Add educational Details");
      var currentEducationalDetailList = cmp.get("v.EducationalDetailList");
      var currentSize= parseInt((currentEducationalDetailList.length));
      var newSize= parseInt((currentSize.length)+1);
      currentEducationalDetailList.push(newSize);
      cmp.set("v.EducationalDetailList",currentEducationalDetailList);
    }
})
Apex Class:
public class SaveRegistrationFormDetails{
@AuraEnabled
public static id SaveRegistrationDetail(admtest__Registration_Form__c regForm ){
     // DML operation to save RegForm Details   
     insert regForm;
     return regForm.id; 
    
}
}

Are there ant issue with the namespace syntax  that  I  am using ?
It will be helpful if someone can guide me with this issue.
Thanks,
Ritu Ghosh
Hello everyone,
I'm working with lightning component.
I have button and I want to display list of records on click button.
When I click on the button, I get the name of the button and I make a select in a table according to the name of the button
  • March 30, 2018
  • Like
  • 0
I have a lightning component in which there is a button which loads some new divs on click of the same button. What I want to implement is that it should auto scroll-down to the bottom of the page and should show those new divs itself(without scrolling the page). So that I don't have to manually scroll down to the bottom of the page.

Any help would be greatly appreciated! Thanks!
Hello Helper

I am building a Ligthning component  where I  have a grid  witrh col  items and inside each  column cell  i am inserting  other component(Ligthning:datatable)

When the component is  displayed its  heigth  is  adjusted  to match the height  of the datatable like  below:

User-added image
I DO NOT  want this

I  would  like  to  define the height of the column box  and if  datatable  has many  rows  i  would  like to add scrollign to  the grid col

I  guess  i  have to use  class="slds-scrollable"
BUt I  am not able  to do it properly

See below  a piece of  my  code  where I define 1  column

        <div class="slds-grid">
          <div class="slds-col slds-box  slds-size_3-of-12  ">
            <span >
                                <lightning:datatable data="{!obj.innerdata}" 
                                    columns="{!v.InnerOppTHeader}" 
                                    keyField="id"  
                                    hideCheckboxColumn="true"
                                    >    
                                </lightning:datatable> 
            </span>
          </div>
   ...
  </div>


any  sugestions?

Thanks in advance
Csbaa
I'm struggling with having my component resize to 100% of the tab.

I tried using slds-grid--frame but this seems to create problems.
<div id="mainfrm" class="slds-grid slds-grid--frame slds-grid--vertical slds-scrollable_none" >

Any help or examples would be a great help.

User-added image
I have scenario like calling a lightning component from VF page. Once value updated in lightning component the value should be update in VF page.
I have used 'window.opener.location.href' in lightning client side controller to redirect to VF page from lightning component. But this event is blocked in lightning.
I have tried another approach in lightning component like:
<a href="!javascript:top.window.opener.closeCampaignLookup('{!a.id}','','','')">{!acc.Name}</a>
But could not save lightning component, since getting error like "Cannot mix expression and literal string in attribute value, try rewriting like {!'foo' + v.bar}: " Please help me on this.
Here is My code ::

Apex controller---

public class Numbers {

     @AuraEnabled
    public static void numbers (){
       List<Integer> intlist = new List<Integer>();
        for(Integer i=0; i<=100 ; i++){
            intlist.add(i);
         }
      }
}

================== 
component :

<aura:component controller="Numbers">
    <aura:attribute name="Number" type ="Integer"/>
    
    <aura:iteration items="{!Number}" var="x">
         {!x}
    </aura:iteration>
    
    <aura:handler name="init" value="{!this}" action ="{!c.doInIt}"/>
</aura:component>
================================
client-side controller:

({
    doInIt : function(component, event, helper) {
          
        var action = component.get("c.numbers");
        
        action.setCallback(this, function(response){
            component.set("v.Number", response.getReturnValue());
        });
        $A.enqueueAction(action);
    }
})
========
 
Hi,

Is there a way to enable row selection when a user clicks on the row of datatable, rather than just on the checkbox/radio button?

I'd imagine I could do this through a combonation of jquery and using the selectedRows object that is provided.

However I'd like to avoid that in favor of a method that would use just the default functionality of the datatable, I'm just not sure how to do that if its currently possible.

Thanks

I have a custom button/action of Action Type lightning component on a custom object that, when clicked, automatically creates a new case record of a certain Record Type, if it isn't linked to an existing case. The requirement is- to avoid automatically creating a case record, and instead give the user an option to manually choose the record type from a pop-up, similar to creating a new case from the Case object itself and then chossing a record type. I'm not too familiar with Lightning dev and would highly appreciate any assistance.

Below is the JS controller code:
({
      CreateCase : function(component, event, helper) {
      
        var caseNumberAdd3 = component.get("c.CasenumberShopp");
       var caseDetails=[];
          var caseid;
        caseNumberAdd3.setParams({
            "shoppingactivityID" :component.get("v.recordId")
        });
           caseNumberAdd3.setCallback(this, function(response){
              
              if(response.getState()==="SUCCESS")
                {
                caseDetails=response.getReturnValue();
                   document.getElementById('loader1').style.display = 'none';
                    if(caseDetails===null){
                        document.getElementById('mainDiv44').style.display = 'block';
                                  
                    }
                    else{
                           $.each(caseDetails, function(key, value){
                   
                    if(key==="Id")
                    {
                        caseid=value;
                        var urlEvent = $A.get("e.force:navigateToURL");
            urlEvent.setParams({
                "url": '/'+ value
                //component.get("v.caseid")
            });
            urlEvent.fire();
                        
                    }
                });
                        
                    }
                         
                }
               });
 $A.enqueueAction(caseNumberAdd3);
            
    },close:function(component, event, helper) {
        document.getElementById("successMsg").style.display = 'none';
    }   
})
Sharing this in case anyone else needs it.  Here is a formula field for clean company name. 
TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Company, 
",", " ") /*remove commas*/,
".", " ") /*remove periods*/,
" inc", "") /*remove inc*/,
" Inc", "") /*remove Inc*/,
" INC", "") /*remove INC*/,
" llc", "") /*remove llc*/,
" Llc", "") /*remove Llc*/,
" LLC", "") /*remove LLC*/,
" Ltd", "") /*remove Ltd*/,
" LTD", "") /*remove LTD*/,
"Corporation", "") /*remove Corporation*/
)

If you have an improved version please post :)
Hi. I found some articles how to generate header/footer in your pdf. However I cannot use renderas=pdf (as there are special characters in my language which are not generated properly, but it's just fine if I dont use renderas=pdf) and I would like to have footer and header generated on my pages to be printed later. It does work properly with the code below if I add renderas=pdf but like I said I cannot and when the page is generated without renderas=pdf, the footer text is placed right after the signature, not at the bottom of the page.
Can anyone tell me please where Im doing the mistake? Thank you very much
<apex:page standardController="Campaign" showHeader="false" applyBodyTag="false">

<head>
<style type="text/css" media="print">
@page {
@top-center {
content: element(header);
}
@bottom-left {
 content: element(footer);
}
}
 
div.header {
padding: 10px;
position: running(header);
}
div.footer {
display: block;
padding: 5px;
position: running(footer);
}
 
.pagenumber:before {
content: counter(page);
}
.pagecount:before {
content: counter(pages);
}
</style>
</head>


<apex:repeat value="{!Campaign.CampaignMembers}" var="line">
  
<div class="header"><div>My Header Text</div></div>

<div class="content">  
  
  <div style="page-break-after:always;">
  
  <apex:outputText value="{!line.Contact.Oslovujeme__c}," rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  <apex:outputText value="{!Campaign.Hard_copy_invitation__c}" rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  <apex:outputText value="Kind regards," rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  <apex:outputText value="A-Team" rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  
  <div class="footer"><div>My footer Text</div></div>
  
  </div>

 </div>  
          
  </apex:repeat>

</apex:page>
My class 
public class CrossSellRExtensionController {
     public Account ca {get; set;}
     public CrossSellRExtensionController(ApexPages.StandardController controller) {
           Cross_Sell_Opportunity__c csr = (Cross_Sell_Opportunity__c) controller.getRecord();
           csr = [Select Id, Name  from Cross_Sell_Opportunity__c where Id =: csr.Id];
           
           ca = new Account();
          
           ca.Cross_Sell_Referral__c = csr.Id;
           
          }
           
public PageReference save() {
       insert ca;
        PageReference pageRef = new PageReference('/' + ca.Cross_Sell_Referral__c);
        pageRef.setRedirect(true);
        ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'new *contact* created.'));
        return pageRef;
        
      
     }
public PageReference cancel() {
     return new PageReference('/'+ ca.Cross_Sell_Referral__c);
}
}



And my VF page :
<apex:page standardcontroller="Cross_Sell_Opportunity__c"  extensions="CrossSellRExtensionController">
 <apex:sectionHeader title="Title" subtitle="Person Accounts"/>
    <apex:form >
      <apex:outputPanel >
  
  </apex:outputPanel>
      
        <apex:pageMessages />
        <apex:pageBlock title="Please fill in the details for creating *Contacts*">
        
      <apex:pageBlockSection >
        <apex:inputField value="{!ca.RecordTypeId}" required="true"/><br/>
        <apex:inputField value="{!Cross_Sell_Opportunity__c.Name}" required="true"/><br/>
        <apex:inputField value="{!ca.Salutation}" /> &nbsp;
            <apex:inputField value="{!ca.FirstName}"  /><br/>
            <apex:inputField value="{!ca.LastName}"  required="true"/><br/>
             <apex:inputField value="{!ca.Name}" required="true"/><br/>
             <apex:inputField value="{!ca.PersonEmail}" required="true"/><br/>
              <apex:inputField value="{!ca.Status__c}" /><br/>
     
        </apex:pageBlockSection>
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save" /> 
         
            <apex:commandButton action="{!cancel}" value="Cancel"/>

         
</apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>

</apex:page>  

I am having trouble to create a person account and the VF page first name and last name are not editable they dont give a box to type in values , what can be done and also before I create a new Person Account , is there a way I coyld do a vlookup on the contact ( if firstname , lastName and email Id given thru VF page already exists ) and throw error saying contact already exists 
Hi
How to create a dependent picklist in visualforce using  cusom object....assist me I m new salesforce
 
I need help in getting values from VF component page, just for the sake of clarity I have added very few fields to make my point across.
How to access inputField values that are created inside an apex:repeat.
When I do system.debug('updateMe >>>' + detailList) I see there is old data but NOT the updated value.
Here is the code snippet
 
VF Component:

<apex:component>
  <apex:attribute name="record" description="my custom object" type="meter__c" required="true" />  

    <!-- more fields -->
         <apex:inputField value="{!record.meter_reading__c}"/>
         <apex:inputField value="{!record.desc__c}"/>
</apex:component>
 
VF Page:

<apex:page Controller="MeterReading" >
  <apex:form > 
   <apex:pageBlock>    
      <apex:pageBlockSection>
         <apex:repeat value="{!detailList}" var="detail"> 
            <c:meter_vf_comp record="{!detail}" />
         </apex:repeat>
      </apex:pageBlockSection>
  </apex:pageBlock>
   <apex:commandButton value="Save" action="{!updateMe}"/>
  </apex:form>
</apex:page>
 
Controller:

public with sharing class MeterReading 
{
  public List<meter__c> detailList { get; set; }

public MeterReading() 
{
   detailList = [/*SOQL*/];  //loading the data and display in repeat...
 }

public PageReference updateMe() {
    system.debug('updateMe >>>' + detailList);  
    return null;
}

}

 
Just looking to have a status change from "Awaiting Customer Feedback" to "Working" when a Feed Comment post is made: A picture of the example is below. Any help would be appreciated!!!
!User-added imageThe top I did in process builder. The highlighted I'm having trouble with. 
I am tring to fetch multiple record and update them, but when ever i try to fetch the second record automatically the page get reefreshed and goes to the first row.
The code is:
visualforce page:
<apex:page controller="binsert">
<apex:form >
<apex:pageBlock title="bulk insert">
<apex:pageBlockButtons >
<apex:commandButton value="add row" action="{!addr}"/>
<apex:commandButton value="save row" action="{!saver}"/>
<apex:commandButton value="fetch" action="{!fetch}"/>
<apex:commandButton value="update" action="{!updat}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable var="bu" value="{!buk}">
<apex:column headerValue="Book Name">
<apex:inputField value="{!bu.name}"/>
</apex:column>
<apex:column headerValue="Book Author">
<apex:inputField value="{!bu.book_author__c}"/>
</apex:column>
<apex:column headerValue="Book Cost">
<apex:inputField value="{!bu.book_cost__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Controller class:
public class binsert {

    public PageReference updat() {
    update buk;
        return null;
    }


    public pagereference fetch() {
    buk=[select id,name,book_author__c,book_cost__c from book__c where name=:bo.name];
      return null;
    }


    public PageReference saver() {
    insert buk;
        return page.bulkinsert;
    }


    public PageReference addr() {
    book__c buuk=new book__c();
    buk.add(buuk);
            return null;
          
    }

book__c bo=new book__c();
public list<book__c> buk{get; set;}
public binsert(){
buk=new list<book__c>();
buk.add(bo);
}
}

can you please help me out to fetch multiple record and update.
Your suggestion is well appreciated.
Thank you!!
 
I'm trying to create different charts based on user selection. I tried implementing it in visual force using javascript innerhtml. Below is my visualforce segment which holds the checkbox, which on selection displays the chart in "thepanel" outputPanel.
<apex:outputPanel layout="block">
        <label for="checkbox">line chart</label>
        <input id="checkbox" type="checkbox"
            onclick="load_home(this,'{!$Component.thePanel}');"/>
</apex:outputPanel>
<apex:outputPanel id="thePanel" layout="block">
</apex:outputPanel>
Javascript function:
function load_home(input, textid){
               if(input.checked) {                   
                   document.getElementById(textid).innerHTML='<apex:chart height="400" width="700" data="{!Data}"><apex:axis type="Numeric" position="left" fields="data1" title="Opportunities Closed" grid="true"/><apex:axis type="Category" position="bottom" fields="name" title="Month of the Year"></apex:axis><apex:lineSeries axis="left" fill="true" xField="name" yField="data1" markerType="cross" markerSize="4" markerFill="#FF0000"/></apex:chart>;
               
          }
}
Apex code:
public List<Data> getData() {
        return FileUploader.getChartData();
    }
public static List<Data> getChartData() {
        List<Data> data = new List<Data>();
        data.add(new Data('Jan', 30, 90, 55));
        data.add(new Data('Feb', 44, 15, 65));
        data.add(new Data('Mar', 25, 32, 75));
        data.add(new Data('Apr', 74, 28, 85));
        data.add(new Data('May', 65, 51, 95));
        data.add(new Data('Jun', 33, 45, 99));
        data.add(new Data('Jul', 92, 82, 30));
        data.add(new Data('Aug', 87, 73, 45));
        data.add(new Data('Sep', 34, 65, 55));
        data.add(new Data('Oct', 78, 66, 56));
        data.add(new Data('Nov', 80, 67, 53));
        data.add(new Data('Dec', 17, 70, 70));
       
        return data;
    }
Function in the controller is called and the data list is returned but its not displaying in visualforce page.
When i am working on Developer console there are showing an error always. Error title is FIELD_INTEFRITY_EXCEPTION.
Please provide help.
FIELD_INTEFRITY_EXCEPTION
Failed to create createContainerMember for containerId=1dc280000006iaBAAQ: This container member belongs to a container that currently has an unfinished save request with deploymentId=1dr28000002te6r. You may not modify any members in this container until it completes.: Metadata Container ID

Thanks
Nitin Sharma
Hi,

I want to print account and its contacts on dot matrix printer. Is it possible to do it using visualforce renderas PDF option.
Please find my VF code.
 
<apex:page standardController="Account" sidebar="false" id="pageid" renderAs="PDF">
    <apex:outputtext value="{!account.name}" style="font-family: 'Courier New'; margin: 100;"/>
    <apex:form id="formid" >
    <apex:dataTable value="{!account.contacts}" var="contact">
        <apex:column headerValue="Employee Name" value="{!contact.name}" style="font-family: 'Courier New'; margin: 0;"/>
    </apex:dataTable>
    </apex:form>
</apex:page>
Please help.

Thanks,

Rahul
 
Hi all,

I have a requirement where I need to develop a visualforce page in which I should display list of chatter Topics associated with a particular member's Group. I mean the group member is a User and that user's topics need to be displayed in the page when he is logged in as current user.

Below is my VF page and class:

VF page:
 
<apex:page controller="TopicController" sidebar="false">

<script> 
       (function(){try{var a=navigator.userAgent;if((a.indexOf('Salesforce')!=-1)&&(a.indexOf('iPhone')!=-1||a.indexOf('iPad')!=-1)&&(a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1||a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1)&&(a.indexOf('Safari')==-1)){ 
        var s=document.createElement('style'); 
        if(a.indexOf('OS/8')!=-1||a.indexOf('OS 8')!=-1) {
            s.innerHTML="html,html body{overflow: auto;-webkit-overflow-scrolling:touch;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
        }
        else if(a.indexOf('OS/9')!=-1||a.indexOf('OS 9')!=-1) {
            s.innerHTML="html,html body{overflow: auto;-webkit-overflow-scrolling:auto;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
        }
        document.getElementsByTagName('head')[0].appendChild(s);}}catch(e){}})(); 
    
    </script>

<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<apex:stylesheet value="{!URLFOR($Resource.OneStarter,'icons.css')}"/>
<!-- <apex:stylesheet value="{!URLFOR($Resource.OneStarter,'styles.css')}"/> -->
<apex:stylesheet value="{!URLFOR($Resource.OneStarter,'OneStarter.css')}"/>

<!-- JavaScript files -->
<apex:includeScript value="{!URLFOR($Resource.jquery)}"/>
<apex:includeScript value="{!URLFOR($Resource.TouchSwipe,'jquery.touchSwipe.min.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.OneStarter,'jquery.onestarter.js')}"/>
<apex:includeScript value="/canvas/sdk/js/publisher.js"/>

    <style>
        #row1data,.colHeadr
        {
            text-align:left;
            padding:5px;
            
        }
        #bullet{padding:5px;}
        #row2data{margin-left:5px;}
        #pageblock{width:100%;}   
    }
    
    @media screen and (min-width : 480px){
        .apexp{
            margin-left: -9%;
            margin-right: -7%;
        }
    }
        
    </style>
  
 <script>
 
 function redirect(id){ 
     var id=document.getElementById(id) ;
    if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {
                            sforce.one.navigateToSObject(id.value);
                        }
                    else {
                            
                            window.location.href = '/'+id.value;
                    }
            }
  
 </script>
 
 <apex:pageBlock id="pb1" mode="maindetail" title="Topics">
        
        <div id="div1" style="width=100; background-color:white; ">
            <apex:pageBlockTable value="{!Topics}" var="t" id="pbt1" align="top" style="border:none; border-style:none;">
            <apex:column style="vertical-align:top;width:0.5em;">
                    <div>
                       <apex:image value="{!$Resource.greydot}" height="1" width="1"/>
                    </div>
                    </apex:column>
                <apex:column headerValue="" style="vertical-align:top;" headerClass="colHeadr">
                <input type="hidden" id="{!t.Name}" value="{!t.Id}"></input>
                <div id="row1data" onclick="redirect('{!t.Name}');" style="color:#16325C;font-weight: bold;">{!t.Name}</div>
                <div id="row2data" style="color:#16325C;"></div>
                </apex:column>
            </apex:pageBlockTable>
            </div>
            
        </apex:pageBlock>
 
</apex:page>

Class Code:
 
public class TopicController{
    public List<Topic> getTopics() {
        return [SELECT Name, Id FROM Topic];
    }
}

It is displaying all the chatter topics. But I need to display current user's (Group member's) Topic in page.

Any help is appreciable. Thanks in advance