• Swetha A 5
  • NEWBIE
  • 45 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 19
    Replies
We have a functionality called "Ownership Mass transfer tool" which is used to transfer all the records of all the Standard and custom objects from one user to another user.
We are using Dynamic lightning data tables to fetch the records in real time based on the user input to show them on the page. But for some reason we are not able to get the data in the back end which is showing NULL. Here is the code snippet. We would like your advice in knowing the root cause of the issue:
({
    /*commenting as we are using custom messages handler as thei component will also be used in clasic. 
     * commeshowToast : function(component, event, helper,title,message) {
        var toastEvent = $A.get("e.force:showToast");
        var mode = "dismissible ";
        if(title == "error"){
            mode = "pester";
        }
        toastEvent.setParams({
            "title": title,
            "type":title,
            "message": message,
            "mode": mode
        });
        toastEvent.fire();
    },*/
    clearMessages : function(component, event, helper){
        var messageEvent = $A.get("e.c:CustomMessageEvent");
        messageEvent.setParams({"toClear" :true}); //to clear any error messsages
        messageEvent.fire();
    },
    //fires display message event 
    displayMessage : function(component, event, helper, message, type, mode, duration){
        var messageEvent = $A.get("e.c:CustomMessageEvent");
        console.log(message);
        messageEvent.setParams({
            "message" : message,
            "mode" : mode,
            "type" : type,
            "duration" : duration
        });
        messageEvent.fire();
    },
    // handle non success response
    handleNSR : function(component, event, helper, response){ 
        var state = response.getState();
        if (state === "INCOMPLETE") {
            helper.displayMessage(component, event, helper,"Incomplete updated."+response.getReturnValue(), "error", "", 5000);
            //helper.showToast(component, event, helper,"error","Action incomplete"); 
        }
        else if (state === "ERROR") {
            var errors = response.getError();
            if (errors) {
                var erMessage = '';
                for(var i = 0; i<errors.length; i++){
                    if (errors[0] && errors[0].message) {
                        erMessage = erMessage+ errors[i].message
                    }
                }
                helper.displayMessage(component, event, helper,"Error message: "+erMessage, "error", "", 5000);
                //helper.showToast(component, event, helper,"error","Error message: " +erMessage); 
            } else {
                console.log("Unknown error");
                //helper.showToast(component, event, helper,"error","Unknown error");
                helper.displayMessage(component, event, helper,"Unknown error ", "error", "", 5000);
            }
        }
    },
    // get the sobjects configured in Datatable settings of lightning component type OwnershipTransfer
    getSobjList : function(component, event, helper) {
        var action = component.get("c.getSobjOptions");
        action.setParams({});
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS" && response.getReturnValue()!= '') {
                var opts= JSON.parse(response.getReturnValue());
                component.set('v.sObjList',opts);
            }else{
                helper.handleNSR(component, event, helper, response);
            }
        })
        $A.enqueueAction(action);
    },
    // sets the coloumn attribute for select sobject, if more than 1 sobject is selected 
    // coloumns are generelised into 2 coloumns as name of selected object and number of records to transfer
    getColumns : function(component, event, helper){
        var selectedOBJ = component.get("v.sObjs");
        component.set("v.extendedColumns", []);
        /* if(selectedOBJ.length > 1){
            var col = [
                { label: 'Object Name', fieldName: 'objName', type: 'text'},
                { label: 'Number of Records', fieldName: 'recCount', type: 'number'}
            ];
            component.set("v.columns",col);*/
        var action = component.get("c.getColumns_Sobjs");
        action.setParams({'objs' : selectedOBJ});
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS" && response.getReturnValue()!= '') {
                var res = response.getReturnValue();
                component.set("v.extendedColumns",res);
                var curUser = component.get("v.currentOwner");
                if(!$A.util.isEmpty(curUser)){
                    helper.getRecords(component, event, helper);
                }
            }else{
                helper.handleNSR(component, event, helper, response);
            }
        })
        $A.enqueueAction(action);
        //helper.getRecords(component, event, helper);
        /*}else if(selectedOBJ.length == 1){
            var action = component.get("c.getColumns_Sobj");
            action.setParams({'obj' : selectedOBJ[0]});
            action.setCallback(this, function(response) {
                var state = response.getState();
                if (state === "SUCCESS" && response.getReturnValue()!= '') {
                    var res = [];
                    res = JSON.parse(response.getReturnValue());
                    component.set("v.columns",res);
                    var curUser = component.get("v.currentOwner");
                    if(!$A.util.isEmpty(curUser)){
                        helper.getRecords(component, event, helper);
                    }
                }else{
                    helper.handleNSR(component, event, helper, response);
                }
            })
            $A.enqueueAction(action);
        }else{
            component.set("v.columns",[]);
        }*/
    },
    //returns the records for selected objects.
    // if more than one object is elected, only the number of records will be returened
    getRecords : function(component, event, helper){
        //var error = false;
        var selectedOBJ = component.get("v.sObjs");
        var curUser = component.get("v.currentOwner");
        var accId = component.get("v.accId");
        var target = event.getSource();
        var fromButton = target.get("v.label");
        if(fromButton == "Get Records" ){
            var error = helper.validateInputs(component, event, helper, false);
        }
        if(error){
            return;
        }
        component.set("v.isWaiting",true);
        component.set("v.statusMessage","Please wait... While we load the data...");
        var action = component.get("c.getRecords_Sobj");
        action.setParams({'objs' : selectedOBJ,
                          'co' : curUser,
                          'accId' : accId
                         });
        action.setCallback(this, function(response) {
            var state = response.getState();
            var res = response.getReturnValue();
            component.set("v.source", res);
            if (state === "SUCCESS" && res != '') {
                /*if(len != 1){
                    for(x in res){
                        var tempObj = {};
                        tempObj.Id = x;
                        tempObj.objName = x;
                        tempObj.recCount = res[x].length;
                        data.push(tempObj);
                    }*/
                //Expanded Results extendedResultList
                var extendedData = {};
                
                for(var x in res){
                    extendedData[x] = [];
                    var tempData2 = [];
                    tempData2 = res[x];
                    for(var i=0;i<tempData2.length;i++){
                        tempData2[i]["obj"] = x;
                        tempData2[i] = helper.lenior(component, event, helper,tempData2[i],'',[]);
                        extendedData[x].push(tempData2[i]);
                    }
                }
                component.set("v.extendedResultList", extendedData);
                helper.createMultipleDatatables(component, event, helper);
                /*}else{
                    for(x in res){
                        var tempData2 = [];
                        tempData2 = res[x];
                        for(var i=0;i<tempData2.length;i++){
                            tempData2[i] = helper.lenior(component, event, helper,tempData2[i],'',[]);
                            data.push(tempData2[i]);
                        }
                    }
                }*/
                /*component.set("v.resultList", data);*/
            }else{
                helper.handleNSR(component, event, helper, response);
            }
        });
        $A.enqueueAction(action);
    },
    //As soql queries are allowed to get information from parent objects, 
    //We are leaniorising the data into a single layor objects.
    lenior : function(component, event, helper,tempData, oldKey, globalData){
        if(typeof(tempData) === 'object'){
            var key;
            for(key in tempData){
                var newKey = oldKey+key;
                var newVal = tempData[key];
                //console.log(newVal);
                if(typeof(newVal) === 'object'){
                    helper.lenior(component, event, helper, newVal, newKey, globalData);
                }else{
                    var idvar = newKey.endsWith('Id');
                    if(idvar === true){
                        newVal = "/"+newVal;
                    }
                    globalData[newKey] = newVal;
                }
            }            
            return globalData;
        }else{
            return ;
        }
    },
    //Validate the options selected by the user
    validateInputs : function(component, event, helper, tr){
        var error = false;
        var selectedOBJ = component.get("v.sObjs");
        var len = selectedOBJ.length;
        var curUser = component.get("v.currentOwner");
        if(len == 0){
            error = true;
            helper.displayMessage(component, event, helper,$A.get("$Label.c.object_required"), "error", "", 5000);
            //helper.showToast(component, event, helper,"error","Please select a value for object.");
        }
        
        if(!curUser){
            error = true;
            helper.displayMessage(component, event, helper,$A.get("$Label.c.currentUser_required"), "error", "", 5000);
            //helper.showToast(component, event, helper,"error","Please select a User"); 
        }
        if(tr){
            var newOwner = component.get("v.newOwner");
            if(!newOwner){
                error = true;
                helper.displayMessage(component, event, helper,$A.get("$Label.c.newOwner_Required"), "error", "", 5000);
            }
            var selectedRows = 0;
            var selectedOBJs = component.get("v.sObjs");
            for(var x =0; x<selectedOBJs.length;x++){
                var idValue = "dataTable"+selectedOBJs[x];
                console.log("**validation method: "+idValue);
                var table = component.find(idValue);
                var selectedRow = [];
                if(!$A.util.isEmpty(table[0]))
                    selectedRow = table[0].getSelectedRows();
                else
                    selectedRow = table.getSelectedRows();
                selectedRows = selectedRows+selectedRow.length;
            }
            if(selectedRows == 0){
                error = true;
                helper.displayMessage(component, event, helper,$A.get("$Label.c.Select_Rec"), "error", "", 5000);
            }
            
        }
        return error;
    },
    //perform the periodic updates (batches menction on the datatable settings) on the selected records.
    updateSelected : function(component, event, helper){
        var error = helper.validateInputs(component, event, helper, true);
        if(error){
            //component.set("c.statusMessage","Refreshing Records...");
            component.set("v.isWaiting",false);
            return;
        }
        //var selectedRow = component.find("dataTable").getSelectedRows();
        var selectedOBJs = component.get("v.sObjs");
        for(var x =0; x<selectedOBJs.length;x++){
            var idValue = "dataTable"+selectedOBJs[x];
            console.log("**validation method: "+idValue);
            var table = component.find(idValue);
            var selectedRow = [];
            if(!$A.util.isEmpty(table[0]))
                selectedRow = table[0].getSelectedRows();
            else
                selectedRow = table.getSelectedRows();
            var selIds = [];
            for(var i =0;i<selectedRow.length; i++){
                var idvar = selectedRow[i].Id.replace('/','');
                selIds.push(idvar);
            }
            if(selIds.length > 0)
            	helper.splitRec(component, event, helper, selIds, selectedOBJs[x]);
        }
    },
    splitRec : function(component, event, helper, totalIds, obj){
        var objList = component.get("v.trnfObjs");
        objList.push(obj);
        component.set("v.trnfObjs",objList);
        var splitIds = [];
        var split = 100;
        var sObjList = component.get("v.sObjList");
        for(var i =0; i<sObjList.length; i++){
            if(sObjList[i].value === obj){
                split = sObjList[i].splitVal;
                break;
            }
        }
        for(var i =0;i<totalIds.length;i++){
            if(i==split)
                break;
            splitIds.push(totalIds[i]);
        }
        helper.updateSplit(component, event, helper,splitIds, totalIds, obj);
    },
    updateSplit : function(component, event, helper,splitIds, totalIds, obj){
        var action = component.get("c.updateSObj_Selected");
        action.setParams({'sIDs' : splitIds,
                          'obj' : obj,
                          'newUser' : component.get("v.newOwner"),
                          'curUser' : component.get("v.currentOwner"),
                         });
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS" && response.getReturnValue()!= '') {
                //helper.displayMessage(component, event, helper,$A.get("$Label.c.Records_transfered_success"), "success", "dismissible", 300);
            }else{
                helper.handleNSR(component, event, helper, response);
                component.set("v.hasUpdateErrors", true);
            }
            //removing the first "x" ids from total ids as they have been processed.
            var newTIDS = totalIds.slice(splitIds.length);
            if(newTIDS.length > 0){
                //calling the split with new totak ids to get new "x ids"
                helper.splitRec(component, event, helper, newTIDS, obj);
            }else{
                if(component.get("v.hasUpdateErrors") == false){
                    var trnfObjs = component.get("v.trnfObjs");
                    var newtrnfObjs = [];
                    for(var to=0; to<=trnfObjs.length;to++){
                        if(obj != trnfObjs[to] && !$A.util.isEmpty(trnfObjs[to]))
                            newtrnfObjs.push(trnfObjs[to]);
                    }
                    component.set("v.trnfObjs",newtrnfObjs);
                    helper.displayMessage(component, event, helper,"All selected "+obj+$A.get("$Label.c.updated_successfully"),$A.get("$Label.c.Success"), $A.get("$Label.c.Dismissible"), 5000);
                    component.set("v.statusMessage","Refreshing Records...");
                    //helper.getRecords(component, event, helper);
                    component.set("v.isWaiting",false);
                }
            }
            var trnfObjs = component.get("v.trnfObjs");
            if($A.util.isEmpty(trnfObjs))
                helper.getRecords(component, event, helper);
        });
        $A.enqueueAction(action);
    },
    createMultipleDatatables: function(component, event, helper){
        var sObjList = component.get("v.sObjList");
        var sObjMap = {};
        for(var i =0; i<sObjList.length; i++){
            sObjMap[sObjList[i].value] = sObjList[i];
        }
        var extendedColumns = component.get("v.extendedColumns");
        var extendedResultList = component.get("v.extendedResultList");
        var selectedOBJ = component.get("v.sObjs");
        var temp = [];
        if(selectedOBJ.length>0){
            for(var x=0;x<selectedOBJ.length;x++){
                var table = [];
                table.push("lightning:datatable");
                var tableAtt = {};
                var sleRec = [];
                console.log("**Creation method: "+"dataTable"+selectedOBJ[x]);
                tableAtt["aura:id"]="dataTable"+selectedOBJ[x];
                tableAtt["keyField"]="Id";
                tableAtt["data"]=extendedResultList[0][selectedOBJ[x]];
                tableAtt["columns"]=JSON.parse(extendedColumns[0][selectedOBJ[x]]);
                tableAtt["resizeColumnDisabled"]="true";
                var auto = component.get("v.autoSelectRows");
                if(auto == true){
                    var data = extendedResultList[0][selectedOBJ[x]];
                    for(var y=0;y<data.length;y++){
                        sleRec.push(data[y].Id);
                    }
                    tableAtt["selectedRows"]=sleRec;
                }
                table.push(tableAtt);
                
                var card = [];
                card.push("lightning:card");
                var cardAtt = {};
                cardAtt["title"] = sObjMap[selectedOBJ[x]].label+" ("+tableAtt["data"].length+")";
                cardAtt["variant"] = "base";
                cardAtt["class"] = "cardborder";
                card.push(cardAtt);
                temp.push(card);
                temp.push(table);
            }
            $A.createComponents(temp, function(components, status, errorMessage){
                if (status === "SUCCESS") {
                    var body = [];
                    for(var i =0; i<components.length; i++){
                        if(i%2==0){
                            body.push(components[i]);
                        }else{
                            var cardBody = components[i-1].get("v.body");
                            cardBody.push(components[i]);
                            $A.util.addClass(cardBody, 'slds-card__body_inner');
                            components[i-1].set("v.body",cardBody);
                        }
                    }
                    /*components.forEach(function(item){
                        body.push(item);
                    });*/
                    component.set("v.extendedTables", body);
                }else if (status === "INCOMPLETE") {
                    console.log("No response from server or client is offline.")
                }else if (status === "ERROR") {
                    console.log("Error: " + errorMessage);
                }
            }
                               );
        }else{
            var body = [];
            component.set("v.extendedTables", body);
        }
        component.set("v.isWaiting",false);
    },
})

 
Hi All,

I want to display the unlisted group names when the vf page is previewed in desktop and listed and private group names when opened in mobile(salesforce1). How can be this possible?
Hi All,

I have a custom button on task related list of Account Object.
The button contains the URL as:/apex/GetDynamoDBTasks?id={!Account.Id} Where GetDynamoDBTasks is a Visualforce page.
I want to pass id dynamically in place of {!Account.Id}. I mean as it is on Account object so I used, Account.Id. If I use this button On opportunity's task related list, it should take opportunity.Id and If I use it for contact, then the Id value should be contact.Id. That means the same custom button for all objects. How can I achieve this? Any solution or idea on this.
Hi All,
I want to add JSENCODE to my visualforce page where I have a javascript function and it is used in one of my statements in the code. Below is my code:
<a style="padding-left:5px;color:black;" id="link" href="javascript:void(0);" onclick = "changeStage('{!Values.Stage_Value__c}');">{!Values.Stage_Value__c}</a>
And the javascript function is: 
function changeStage(changeStageName) {
        
        stagename(changeStageName);
     }
Can Somebody help me in solving this!! Any help or suggestion is appreciable.
Thanks in advnce

 
Hi All,,
I was trying to setup quotas in my developer instance. My user has "Allow forecast" permission and I enable the "Show quotas" checkbox in the forecast settings. When I enable the user in forecast hierarchy, it again comes as "enable user". I think the user is not enabled. Is there anything I missed. Even I am unable to find "Manage quotas" in profile permissions. Please help me how can this be resolved.

Thanks. Any answer is appreciable
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
Hi All,

I have a Vf page which is used in Salesforce1. But it is not displaying properly in salesforce1. I tried adding css media query, but still it is not coming. Please PRovide me a soluton. Below is my VF code:
<apex:page sidebar="false" controller="OrderApprovalVF" standardStylesheets="true">
     
     <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
     
     <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
        </script>
        
        <style>
        
        .SpendingStyle {border-right: 1px solid #F0C9A3 !important;
        
        border-left: 1px solid #F0C9A3 !important; }
         
        </style>
        
        <style>
        @media only screen and (min-width:480px) and (max-width: 640px)  
        {
            body{width:100%;}
        }
        
        </style>
        
        <style>
        @font-face{
            font-family: Proximo_Nova_Soft;
            src: url("{!URLFOR($Resource.PennaFont)}");
        }
 
        .regular{
            font-family: Proximo_Nova_Soft;
            font-size: 13px;
        }
        
        .Medium{
             font-family: Proximo_Nova_Soft;
             font-size: 12px;
        }
         .semibold{
             font-family: Proximo_Nova_Soft;
             font-size: 12px;
         }
         .bold{
             font-family: Proximo_Nova_Soft;
             font-size: 12px;
         }
         
         
    </style>
       
    
      
        
<!--98AFC7-->
<body>
     <apex:form >
         <apex:pageBlock id="pgblock" >
                    
            <apex:pageBlockButtons styleClass="medium">
                <apex:commandButton action="{!ApproveSelected}" value="Approve" reRender="block2" onComplete="window.location.reload();"/>
                <apex:commandButton action="{!RejectSelected}" value="Reject" reRender="block2" onComplete="window.location.reload();"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection columns="2" >
            
                <apex:pageBlockTable value="{!wraporderList}" var="Wcord" styleClass="regular">
            
          
            
            <apex:column style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color: #F4F4BF;")}" styleClass="regular SpendingStyle" >
                 <apex:facet name="header">
                       <apex:inputCheckbox onclick="selectAllCheckboxes(this,'InputId')"/>
                 </apex:facet>
                 <apex:inputCheckbox value="{!Wcord.isSelected}" id="InputId"/>
            </apex:column>
           
            <apex:column style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color: #F4F4BF;")}" styleClass="regular SpendingStyle">
                <apex:facet name="header">Order No.</apex:facet>
                <apex:outputLink value="/{!Wcord.ord.id}" id="orderLink">{!Wcord.ord.OrderNumber}</apex:outputLink>
   
            </apex:column>
            <apex:column value="{!Wcord.ord.EffectiveDate}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color: #F4F4BF;")}" styleClass="regular SpendingStyle">
                <apex:facet name="header">Order Date</apex:facet>
            </apex:column>
            
            <apex:column styleClass="regular SpendingStyle" value="{!Wcord.RtsC}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color: #F4F4BF;")}">
                <apex:facet name="header">T/NT</apex:facet>
            </apex:column>
            
            <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Account.Name}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color: #F4F4BF;")}">
                <apex:facet name="header">Customer Name – Code</apex:facet>
            </apex:column> 
             <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Soldto_Contact__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Contact No.</apex:facet>
           </apex:column> 
            <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Ship_To_Address__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color: #F4F4BF;")}">
                <apex:facet name="header">Ship To - Code</apex:facet>
            </apex:column>
            <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Destination_Text__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color: #F4F4BF;")}">
                <apex:facet name="header">Destination</apex:facet>
            </apex:column>
            
       
           
       <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Ship_To_City__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color: #F4F4BF;")}">
           <apex:facet name="header">District</apex:facet>
       </apex:column>
       <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.State__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color: #F4F4BF;")}">
           <apex:facet name="header">State</apex:facet>
       </apex:column>
       <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Grade__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
           <apex:facet name="header">Grade</apex:facet>
       </apex:column>
       <apex:column styleClass="font-face SpendingStyle" value="{!Wcord.ord.Price_Per_MT__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
           <apex:facet name="header">Price Per Ton(INR)</apex:facet>
       </apex:column> 
       <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Incoterms_Text__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
                <apex:facet name="header">Incoterm</apex:facet>
       </apex:column>

       <apex:column styleClass="regular SpendingStyle" value="{!Wcord.RlznC}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
           <apex:facet name="header">RLZTN</apex:facet>
       </apex:column> 
       <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.MMC_Text__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
           <apex:facet name="header">MMC Name</apex:facet>
       </apex:column>
       <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.MMC_Value_Text__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
           <apex:facet name="header">MMC(INR/MT)</apex:facet>
       </apex:column>  
       
    <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Payment_Term_Text__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Payment Terms</apex:facet>
           </apex:column>
          <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ODV}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">OD(>30/45)</apex:facet>
           </apex:column>
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.OosC}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Open OS(INR)</apex:facet>
           </apex:column>

           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.OAmtC}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Amount(INR)</apex:facet>
           </apex:column>
          
           
            <apex:column styleClass="regular SpendingStyle" value="{!Wcord.CosC }" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Closing OS(INR)</apex:facet>
           </apex:column>
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Total_Quantity__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Quantity(MT)</apex:facet>
           </apex:column> 
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.PkchrgC}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">PKG.CHRGS(INR)</apex:facet>
           </apex:column>
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.PFrgtC}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">PR.FRT(INR)</apex:facet>
           </apex:column> 
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.SFrgtC}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">SC.FRT(INR)</apex:facet>
           </apex:column>  
           
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Material_Source__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Source(P/D)</apex:facet>
           </apex:column>   
          
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.Submittedby}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Submitted By</apex:facet>
           </apex:column> 
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.Approvedby}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Approved By</apex:facet>
           </apex:column>    
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Status}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
               <apex:facet name="header">Status</apex:facet>
               
           </apex:column> 
           <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Discount_Yes_No__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
           <apex:facet name="header">Discount(Y/N)</apex:facet>
       </apex:column>  
            <apex:column styleClass="regular SpendingStyle" value="{!Wcord.ord.Discount_Yes_No__c}" style="{!IF(Wcord.ord.Status="Director of Marketing Review","background-color:#FFEAB7;","background-color:#F4F4BF;")}">
           <apex:facet name="header">Discount(INR/MT)</apex:facet>
       </apex:column> 
 
            </apex:pageBlockTable>
           
           </apex:pageBlockSection>
           
           <br/>
            
            <!-- next, previous and page info -->
            <apex:commandLink action="{!doPrevious}" rendered="{!hasPrevious}" value="Previous" />
            <apex:outputLabel rendered="{!NOT(hasPrevious)}" value="Previous" />
            
            <apex:outputLabel value=" (page {!page} of {!totalPages}) | showing {!startIdx} to {!endIdx} of {!totalRecords} " />
            
            <apex:commandLink action="{!doNext}" rendered="{!hasNext}" value="Next" />
            <apex:outputLabel rendered="{!NOT(hasNext)}" value="Next" />
            
         </apex:pageBlock>

       </apex:form>
       </body>

    </apex:page>

 
Hi all,

Below is my trigger code. But I am very poor in writing test class. So please kindly provide me the test class code for the trigger. It is urgent. Thank you in advance.
trigger UpdateActivityDetailsOnAccount on Event (after insert, after update, after delete) {

    Set <ID> acctIDs = new Set <ID> ();
    Set <ID> contactIDs = new Set <ID> ();
    Map <ID, DateTime> lastVisitDateMap = NEW Map <ID, DateTime> ();
    Map <ID, DateTime> scheduledMeetingMap = NEW Map <ID, DateTime> ();
    Map <ID, String> lastActivityTypeMap = NEW Map <ID, String> ();
    Map <ID, DateTime> lastActivityDateMap = NEW Map <ID, DateTime> ();
    
    if (!Trigger.isDelete) {
        for (Event e: Trigger.NEW) {
            if (e.WhatId != NULL) {
                if (String.valueOf(e.WhatId).startsWith('001')) {
                    acctIDs.add(e.WhatId);
                } 
            }
            if (e.WhoId != NULL) {
                if (String.valueOf(e.WhoId).startsWith('003')) {
                    contactIDs.add(e.WhoId);
                } 
            }
        }
    }
    if (Trigger.isDelete) {
        for (Event e: Trigger.OLD) {
            if (e.WhatId != NULL) {
                if (String.valueOf(e.WhatId).startsWith('001')) {
                    acctIDs.add(e.WhatId);
                } 
                if (e.WhoId != NULL) {
                    if (String.valueOf(e.WhoId).startsWith('003')) {
                        contactIDs.add(e.WhoId);
                    } 
                }
            }
        }
    }
    
    if (!contactIDs.isEmpty()) {
        List <Contact> allRelatedContacts = [ 
                                                SELECT AccountID FROM Contact 
                                                    WHERE ID IN: contactIDs
                                            ];
        for (Contact con: allRelatedContacts) {
            if (con.AccountID != NULL)
                acctIDs.add(con.AccountID);
            
        }
    }
    
    /**** To Capture Last Meeting Date ********/
    for(Account accHistory: [ SELECT 
                                (SELECT 
                                    o.What.Name , o.WhatId, o.IsTask, 
                                    o.StartDateTime, o.Subject, o.Account.Name 
                                FROM ActivityHistories o 
                                WHERE IsTask = FALSE
                                    AND Subject = 'Meeting'
                                Order By StartDateTime Desc 
                                LIMIT 1) 
                            FROM Account WHERE ID IN: acctIDs]) {
        
        if (!accHistory.ActivityHistories.isEmpty()) {
            for (ActivityHistory lastMeeting: accHistory.ActivityHistories) {
                lastVisitDateMap.put(accHistory.ID, lastMeeting.StartDateTime);
            }
        }                   
    }
    
    /**** To Capture Next Meeting Date ********/
    for(Account accHistory: [ SELECT 
                                (SELECT 
                                    o.What.Name , o.WhatId, o.IsTask, 
                                    o.StartDateTime, o.Subject, o.Account.Name 
                                FROM OpenActivities o 
                                WHERE IsTask = FALSE
                                    AND Subject = 'Meeting'
                                Order By StartDateTime ASC 
                                LIMIT 2) 
                            FROM Account WHERE ID IN: acctIDs]) {
        
        if (!accHistory.OpenActivities.isEmpty()) {
            for (OpenActivity nextMeeting: accHistory.OpenActivities) {
                scheduledMeetingMap.put(accHistory.ID, nextMeeting.StartDateTime);
            }
        }                   
    }
    
    /**** To Capture Last Activity Type & Date********/
    for(Account accHistory: [ SELECT 
                                (SELECT 
                                    o.What.Name , o.WhatId, o.IsTask, 
                                    o.StartDateTime, o.Subject, o.Account.Name 
                                FROM ActivityHistories o 
                                WHERE IsTask = FALSE
                                Order By StartDateTime Desc 
                                LIMIT 1) 
                            FROM Account WHERE ID IN: acctIDs]) {
        
        if (!accHistory.ActivityHistories.isEmpty()) {
            for (ActivityHistory lastTypeActivity: accHistory.ActivityHistories) {
                lastActivityTypeMap.put(accHistory.ID, lastTypeActivity.Subject);
                lastActivityDateMap.put(accHistory.ID, lastTypeActivity.StartDateTime);
            }
        }                   
    }
    
    List<Account> accList = NEW List<Account> ();
    for (ID accID: lastVisitDateMap.keySet()) {
        
        Account acc = NEW Account(ID = accID);
            acc.Last_Visit_Date__c = lastVisitDateMap.get(accID);
            acc.Scheduled_Visit_Date__c = scheduledMeetingMap.get(accID);
            acc.Last_Activity_Type__c = lastActivityTypeMap.get(accID);
            acc.Last_Activity_Date__c = lastActivityDateMap.get(accID);
        accList.add(acc);
        
    }
    Update accList;
    
}

 
Hi All,

I have a doubt regarding displaying merge fields on Email template. I want to display event activityDate and Event ActivityDateTime related to Lead object in an Email Template. I have written the merge fields like below:

Your appointment Date and Time is listed below: 
{!Event.ActivityDate} 
{!Event.ActivityDateTime}


But it is not working when sending a demo email. It is an urgent requirement. Please provide a solution for this. 

Thanks in advance.
Hi all,

Can we remove the sidebar and header from a standard salesforce page using a visualforce page?
I mean Can we add any css or javascript function to achieve this? If this is possible, please provide me a solution. It's urgent.
Thanks in advance.
I have two rich text fields in user object which holds two images in it. I want to build an email template(custom or VF template) to display those two rich text fields in it and when I send an email using that template, those two images need to be displayed. it is an urgent requirement. Please help. Thanks in advance.
Hi All,
I want to change the app icon by uploading a new image from a visualforce page. That means when a change the icon of an app  from a VF page, the app icon should be chnaged when we select an app.. Please help me in this if possible. Thanks in advance..
I have a requirement. I want to show list of apps in my salesforce instance on a visualforce page and an input text field as "Change App label". when I select an app from the list and give a name as input in the text field, the app name should  be changed. Is it possible? if so, please provide the code. It's urgent. Thanks in advance. 
I need to write a validation rule on opportunity. when a record type is "record type 1" and user has selected stage as "closed won", then he can't update the stage value to its previous value. Please kindly help me as it is an urgent requirement. Thanks in advance
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
Hi all

When I am execute this Trigger I am getting an error : Variable does not exist: l.id at line 38 column 43

Trigger updateleadstatus on Task(after insert,after update,after delete,after undelete)
{
    public set<id>setids=new Set<Id>();
    public List<Lead>LeadToBeChanged=new List<Lead>();
    
    
    If(Trigger.isinsert || Trigger.Isupdate  ||Trigger.Isundelete)
    {
    
       for(task t:trigger.new)
       {
       
          if(string.valueof(t.whoid).startswith('00Q'))
          
          setids.add('t.whoid');
    }
    }
    
    
       If( Trigger.Isdelete )
    {
    
       for(task t:trigger.old)
       {
       
          if(string.valueof(t.whoid).startswith('00Q'))
          
          setids.add('t.whoid');
       }
    }
    
    
    If(setids.size()>0)
       {
       
         for(Lead l :[select l.id, l.task_Count__c,(select id from tasks where isclosed=false) from Lead l where id in:setids]);
          {
          LeadToBeChanged.add(new Lead(id=l.id,task_Count__c = l.tasks.size()));
           
       
       update LeadToBeChanged; 
       }}
    
    
   }

 
Hi All,

I have a custom button on task related list of Account Object.
The button contains the URL as:/apex/GetDynamoDBTasks?id={!Account.Id} Where GetDynamoDBTasks is a Visualforce page.
I want to pass id dynamically in place of {!Account.Id}. I mean as it is on Account object so I used, Account.Id. If I use this button On opportunity's task related list, it should take opportunity.Id and If I use it for contact, then the Id value should be contact.Id. That means the same custom button for all objects. How can I achieve this? Any solution or idea on this.
Hi All,
I want to add JSENCODE to my visualforce page where I have a javascript function and it is used in one of my statements in the code. Below is my code:
<a style="padding-left:5px;color:black;" id="link" href="javascript:void(0);" onclick = "changeStage('{!Values.Stage_Value__c}');">{!Values.Stage_Value__c}</a>
And the javascript function is: 
function changeStage(changeStageName) {
        
        stagename(changeStageName);
     }
Can Somebody help me in solving this!! Any help or suggestion is appreciable.
Thanks in advnce

 
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
Hi All,

I have a doubt regarding displaying merge fields on Email template. I want to display event activityDate and Event ActivityDateTime related to Lead object in an Email Template. I have written the merge fields like below:

Your appointment Date and Time is listed below: 
{!Event.ActivityDate} 
{!Event.ActivityDateTime}


But it is not working when sending a demo email. It is an urgent requirement. Please provide a solution for this. 

Thanks in advance.
Hi all,

Can we remove the sidebar and header from a standard salesforce page using a visualforce page?
I mean Can we add any css or javascript function to achieve this? If this is possible, please provide me a solution. It's urgent.
Thanks in advance.
I have two rich text fields in user object which holds two images in it. I want to build an email template(custom or VF template) to display those two rich text fields in it and when I send an email using that template, those two images need to be displayed. it is an urgent requirement. Please help. Thanks in advance.
Hi All,
I want to change the app icon by uploading a new image from a visualforce page. That means when a change the icon of an app  from a VF page, the app icon should be chnaged when we select an app.. Please help me in this if possible. Thanks in advance..
I have a requirement. I want to show list of apps in my salesforce instance on a visualforce page and an input text field as "Change App label". when I select an app from the list and give a name as input in the text field, the app name should  be changed. Is it possible? if so, please provide the code. It's urgent. Thanks in advance. 
I need to write a validation rule on opportunity. when a record type is "record type 1" and user has selected stage as "closed won", then he can't update the stage value to its previous value. Please kindly help me as it is an urgent requirement. Thanks in advance