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

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 19
    Replies
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