• Sagar Nagvekar 14
  • NEWBIE
  • 35 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 14
    Replies
Hi,

Is there a way to make the columns in this visualforce page sortable?  It's simply a page that displays the open tasks owned by the current user.

controller:
 
public class tasksController{
    
    List<Task> tk; 
      // toggles the sorting of query from asc<-->desc


    public tasksController(ApexPages.StandardController Controller){
     }  
     
    public List<Task> getResults(){     
        return tk;
    }         
    public PageReference gettk(){
        String userId=UserInfo.getUserId();
        UserId=userId.Substring(0,15);
        tk=[Select Status, Subject, Priority, OwnerId, Owner.Name, WhatId, Response_Needed__c,What.Name, WhoId, Who.Name, ActivityDate from Task WHERE 
             Status != 'Completed' AND (ActivityDate = THIS_WEEK ) AND OwnerId =: UserId ORDER BY ActivityDate DESC LIMIT 25  ];
        return Null; 
    }
}



visualforce page:
 
<apex:page standardController="Task" extensions="tasksController" action="{!gettk}">
<apex:form >
    <html>
    &nbsp;&nbsp;<img src="/img/icon/home32.png"/>
    <font size="5">&nbsp;&nbsp;My Open Tasks Due This Week</font><br></br>

<apex:pageblock >


                    <apex:pageBlockTable value="{!results}" var="tsk">
                                <apex:column >
                                    <apex:outputlink value="/{!tsk.Id}">{!tsk.Subject}</apex:outputLink>
                                    <apex:facet name="header"> Subject </apex:facet>                                                                                                       
                                </apex:column>
                                <apex:column > 
                                    <apex:outputField value="{!tsk.Response_Needed__c}" />
                                    <apex:facet name="header"> Urgency                                      
                                    <span class="helpButton" id="example-title-_help">
                                    <img src="/s.gif" class="helpOrb"/>
                                      <script type="text/javascript">
                                        sfdcPage.setHelp('example-title', 'RED: Task is overdue by 1 day or more or has no due date.  YELLOW: Task is due today.  GREEN: Task is due on some day in the future. ');
                                      </script>
                                    </span>                                                                                                       
                                    </apex:facet>                                                                      
                                </apex:column>                                
                                <apex:column >
                                    <apex:outputLink value="/{!tsk.WhoId}">{!tsk.Who.Name}</apex:outputLink>
                                    <apex:facet name="header"> Name</apex:facet>
                                </apex:column> 
                                <apex:column >
                                    <apex:outputLink value="/{!tsk.OwnerId}">{!tsk.Owner.Name}</apex:outputLink>
                                    <apex:facet name="header"> Assigned To </apex:facet> 
                                </apex:column>
                                <apex:column value="{!tsk.ActivityDate}"/>                                                                                                                                                                                                   
                                <apex:column value="{!tsk.Status}"/>  
                    </apex:pageBlockTable> 
                    
                    
                    <br></br>                 
                    <apex:outputLink target="_blank" value="https://cs15.salesforce.com/00Oe0000000Ta99" id="theLink">View All My Open Tasks</apex:outputLink>

 </apex:pageblock>
                   


    </html>
    </apex:form>
</apex:page>

 
  • December 16, 2014
  • Like
  • 0

Hi -

I'm cleaning up some data and I need to delete a Picklist value.  But I get the message:

The picklist value you attempted to delete is the last value for the following record types. This picklist must contain at least one value. Either add another value to the picklist or to the following record type.

 

How do I fix this?


thank you -

Sara

  • September 25, 2013
  • Like
  • 0

I am new to salesforce, I want to Know

 

what is the use of  standardsetcontroller??????

 

can you give me manual explanation, I am not able to understanding salesforce documents....

 

please help me....

 

 

Thanks In Advance.

 

 

  • September 17, 2013
  • Like
  • 0

I want to use record Type to limit trigger action. 

 

Now I use querey to get it my code liks below

string Id = [SELECT id from RecordType where Name ='Someone'].Id;

 

I also found this page, we could use method to get the Record Type Id to avoid the query.

I still can't understand it.

 

Is there some simple and easy wayt to get the ID only by Record Type's Name?

Hello,

 

I want to access controller getter-setter variable inside javascript. How could I do this.

 

Thanks in advance.

 

 

 

Regards,

 

Pratty

  • April 24, 2012
  • Like
  • 1

Could I get simple example of how to loop through a multi-select picklist field?

 

Thanks!

 

hi all,

 

i have a pageBlockTable in my VF page. 1st Column is a checkbox column and 2nd column is a column which changes dynamically based on the user's selection, let's say for example, 2nd Column is a "Name" retrieved from the account object. Now if the user checks the checkbox, i have to read the value of the checkbox and if it is checked, then i have to retrieve the value associated with the checked checkbox.

 

what i should do to relate the Name column with the check box column?? please help me to achieve this functionality..

 

 

Thanks,

abivenkat,
SFDC Learner 

Hi,

 I am new in Salesforce...I want to design a pop up window. The window will appear after save button is hit which will show the values those an user has entered as input. After the pop up comes out then the user will click the ok in pop up and the page will be redirected to the object view page.

 

Now how can I implement it throgh java script or any other possible way.

Can u pls provide some sample coding for it.

 

Thanks in advance,

  • September 28, 2011
  • Like
  • 0

HI Every one,

 

    I have a visualforce page and corresponding apex class like this

<apex:page standardController="Event__c" extensions="CreateAnEvent">
...code.........
...code.........
</apex:page>

 Now I want to call a method in apex class, from JavaScript function.Can any one have any idea. Can you please help me in this requirement.

 

Thanks,

Naresh 

Hi All,
Can anybody tell, how to call, the javascript onload() function in the <body> in a javascript. I wanted to call an alert statement, through a javascript on the onload function. Please help. Below is the code for reference:
 
<apex:page>
  
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/11.1/connection.js"></script>
    
<apex:pageBlock>
<apex:form>
  
<body onload="init();">       
<table width="100%">
<tr>
<td>
  <input type="text" id="txtName" />
  <input type="button" value="Save"  />
 
</td>
</tr>
</table>
</body>
 <script language="javascript">
sforce.connection.sessionId = '{!$Api.Session_ID}';
function init()
{
  alert('hi');
}
 </script>

  </apex:form>
</apex:pageBlock>
</apex:page>
  • December 26, 2008
  • Like
  • 0
In list view we can multiple select the checkbox and click button to do some operation.
Can I add this checkbox in related list? and do same operation like list view?
I'm starting to do some research into what it would take to create a Visualforce popup window similar to the standard salesforce lookup windows.  For now, my intention is to try to come up with a stronger lookup window for one of our custom objects, and at the moment I plant to create a link on a visualforce page to bring the popup up.  (This link will be right next to the existing standard salesforce lookup icon.)
 
I figured I'd start by seeing if anyone else has had any success doing something like this.  The items I am going to tackle first are:
 
1.  Create the popup window.  -  Don't expect this to be a problem.
2.  Pass parameters to the popup through the URL - Don't expect this to be a problem.
3.  Emulate the existing functionality of an existing Salesforce lookup, so that the lookup window will disappear automatically if the parent window is reselected - Not sure how to implement this one yet
4.  Pass a value, in this case, an Id back to the parent window - Not sure how I'm going to do this, but I'm going to attempt to pass some sort of callback function into the popup so it can return a value
 
Being able to do something like this leads to the need to be able to override standard Salesforce lookup functionality.  That way this could be easily implemented on standard pages, in addition to VisualForce pages.
 
If anyone has attempted something like this with Visualforce yet, any learnings would be great!
 
Thanks!
 
Jon Keener