• Dipa87
  • NEWBIE
  • 80 Points
  • Member since 2012

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 21
    Replies

For all users of a particular profile, when they login they should be taken to a visualforce page instead of the standard home page. I can differentiate the user based on profile in the controller if I'm able to redirect ALL users to the visualforce page.

 

Any ideas?

 

Thanks in advance.

 

~LVS

  • August 03, 2012
  • Like
  • 0

I have a string which contains object names enclosed in <>. Like this:

 

                                String str = 'I have <name> and <id>  and <phone>';  //The string may vary,so it needs to be dynamic

 

I need an output like this. So that i can use the field names to use it in my soql query.


                                String fields = 'name,id,phone';   

  • November 05, 2013
  • Like
  • 0

I need help to write a method which will do some kind of string formatting.

 

I have list of ids of an object. It may be any object.Like this:

List listContactIds = [select id from contact limit 5];

 

And I have a certain string format like this:

String format = ‘{name} belongs to {Account.Name}’;

 

I need to call a method. Suppose the method name is formatString.

formatString(listContacts, format);

 

The method should be able to return list of formatted strings.Like this Rahul belongs to Google

We can take the exact field names enclosed in {} from the 'format' string

How to acheive this?

  • October 31, 2013
  • Like
  • 0

I have a requirement where I need to override the Opportunity view and to redirect the user of a certain profile to a VF page instead of standard detail page.


I tried something like this:

Created a VF page. Added below script inside it.

<apex:page standardController="Opportunity">
<script>
    if('{!$Profile.Name}' == 'Manager Profile'){
        window.open("/apex/mypage?id={!Opportunity.Id},'_parent');
    }
    else{
        window.open("/{!Opportunity.Id}",'_parent');
    }
</script>
</apex:page>

and in Links , I override the view link of Opportunity with this VF page.

But it works for only manager profile but not for other profiles. The page keeps on loading and loading for other profiles except the manager Profile.

Any idea?
             

  • October 17, 2013
  • Like
  • 0

Hi All,

 

I need help in Importing large CSV files via Batch Apex. Tried this link --> http://developer.financialforce.com/customizations/importing-large-csv-files-via-batch-apex/ .But I am unable to implement it.

 

Kindly help.

Hi All,

Currently I am using Test.loadData to insert test data frm a csv into one object. Can I use the same static resource file for inserting test data into another object. Is it possible? Or is it like we need to create separate csv for each object?

 

 

I have another query . Is it possible add a dynamic value to any field in csv?

 

Thanks in advance.

Dipa

Hi ,

 

Can you please tell me-how to open a page in another tab using page reference?

 

Thanks in advance.

  • March 22, 2013
  • Like
  • 0

Hi All,

 

I have a list which will have values like dis:

 

(Account:{Open_LCS_Opportunities_rollup__c=1, Id=001J000000WmAWIIA3}, Account:{Id=001J000000WmAWIIA3, Start_Date__c=2013-03-14 00:00:00},Account:{Id=001J000000WmAYTU2, Start_Date__c=2013-03-14 00:00:00})

 

I want to perform an update operation on this list. But before that I want to merge the values of the same ids into one and then update so that I dont loose any data.

 

I tried using Map,but it overrides the values:(

 

Please help me.

  • March 15, 2013
  • Like
  • 0

Hi All,

 

I have the following trigger to get a sum of all the opportunity amount under an account(as we have advanced multi currency enabled so trying to create a custom roll up summary field).

 

How to bulkify this trigger?Plz help.

 

trigger tgr_change_in_amount on Opportunity (after insert,after update,before delete) {

 for (Opportunity opp: Trigger.new) {
                    if(opp.accountid != null){
                                                       
                            Integer amt;
                            AggregateResult[] groupedResults  = [SELECT SUM(Amount)aver FROM Opportunity where accountid =:opp.accountid];
                            for (AggregateResult ar : groupedResults) { 
                               amt =  Integer.valueOf(ar.get('aver'));
                            }
                           
                            List<Account>lstAccount = new List<Account>();
                            lstAccount = [select Total_Amt_of_Open_Opportunities__c from Account where id=:opp.accountid];
                            lstAccount[0].Total_Amt_of_Open_Opportunities__c = amt;
                           
                            update lstAccount;
                    }
            }

}

  • February 15, 2013
  • Like
  • 0

Is there a way to retrieve the login hours for a profile using apex?

 

I want start and end time for a particular user.

 

Thanks in advance!

I have a datetime field. I want to convert it to the following format --

 

'Wed Apr 18 2012 03:00:00 GMT+0530'

 

Thanks in advance.

  • April 18, 2012
  • Like
  • 0

Hi all,

I am building a custom vf page which has all the functinalities of a standard account list page.

Currently I am populating the account records in pageblock table based on the list view selected.

But I also want to filter the columns based on the list view. So that my table shows up dynamically.

How to get the selected fields for a particular list view. Is there any function or query?

 

 

Please help me out.Thanks in advance.

  • March 21, 2012
  • Like
  • 0

I am using apex:enhanced list to show list of accounts in a vf page. Each time on click of checkbox for a record I want to get the id of that particular record. i tried using jquery.But its not working. I tried some thing like this:

 

<apex:page >
<script type="text/javascript" src="{!URLFOR($Resource.jquery132js)}"/>
<script type="text/javascript" src="{!URLFOR($Resource.Jquery171)}"/>
<script type="text/javascript">
        
    var $j = jQuery.noConflict();
     $j(document).ready(function(){
     $j( ":checkbox" ).click(function( objEvent ){
            
               if(this.value!='')
               {
                   if(this.checked) {
                      
                       alert( this.value);
                          
                   }
                   else{alert('Unchecked----'+this.value);}
               }
                       
            });
             });
        
    </script>
 <apex:enhancedList type="account" height="400"/>
</apex:page>

If you have any other javascript or jquery code to capture the click event of checkbox which can solve this problem. please share .

Thanks in advance.

  • March 21, 2012
  • Like
  • 0

Can anybody help me. I want to add pagination in <apex: list view>  component  as we have in standard list view .We have only next previous in <apex: list view>  component.But how to get the page summary and all???please help

  • March 08, 2012
  • Like
  • 0

I need help to write a method which will do some kind of string formatting.

 

I have list of ids of an object. It may be any object.Like this:

List listContactIds = [select id from contact limit 5];

 

And I have a certain string format like this:

String format = ‘{name} belongs to {Account.Name}’;

 

I need to call a method. Suppose the method name is formatString.

formatString(listContacts, format);

 

The method should be able to return list of formatted strings.Like this Rahul belongs to Google

We can take the exact field names enclosed in {} from the 'format' string

How to acheive this?

  • October 31, 2013
  • Like
  • 0

I have a requirement where I need to override the Opportunity view and to redirect the user of a certain profile to a VF page instead of standard detail page.


I tried something like this:

Created a VF page. Added below script inside it.

<apex:page standardController="Opportunity">
<script>
    if('{!$Profile.Name}' == 'Manager Profile'){
        window.open("/apex/mypage?id={!Opportunity.Id},'_parent');
    }
    else{
        window.open("/{!Opportunity.Id}",'_parent');
    }
</script>
</apex:page>

and in Links , I override the view link of Opportunity with this VF page.

But it works for only manager profile but not for other profiles. The page keeps on loading and loading for other profiles except the manager Profile.

Any idea?
             

  • October 17, 2013
  • Like
  • 0

Hi All,

 

I have a list which will have values like dis:

 

(Account:{Open_LCS_Opportunities_rollup__c=1, Id=001J000000WmAWIIA3}, Account:{Id=001J000000WmAWIIA3, Start_Date__c=2013-03-14 00:00:00},Account:{Id=001J000000WmAYTU2, Start_Date__c=2013-03-14 00:00:00})

 

I want to perform an update operation on this list. But before that I want to merge the values of the same ids into one and then update so that I dont loose any data.

 

I tried using Map,but it overrides the values:(

 

Please help me.

  • March 15, 2013
  • Like
  • 0

I have two objects, Coat & Coat Line Item. These two objects having master-details relation ship

 

1) Coat is Master object

2) Coat Line Item is detail object.

 

Coat object is having one field "status". If status = "Approved" the records in the related list recors can not be deleted.

Let say "Sample" is record in "Coat object" and it is having 100 records in the "Coat Line Item" (Detail object) related list.

 

If the "Sample" record, Status="Approved". If any one deleting any record from the related list, does not allow to delete the record of the related list.

 

How to achieve this functionality? In how many ways we can achieve this functionality?

I hope by using triggers we can do. But am not sure.

Please give your ideas how to achieve this functionlity either by using coding & configuration (Both the ways)

 

 

  • February 27, 2013
  • Like
  • 0
Hi All, I have a requirement . How Can we use custom settings filed values in Apex Triggers. Any one please help me...

Wondering if anyone has attempted to import any of the DFP for Publishers (Doubleclick) WSDLs into Salesforce and had any success? I'm wondering if the generated Apex code is accurate. I've imported the OrderService wsdl and the resulting Apex code doesn't give me the ability to set the authentication token in it. When I build a soap header and call getOrder() I get:

 

Web service callout failed: WebService returned a SOAP Fault: Unmarshalling Error: null faultcode=soap:Server faultactor=

 

Thanks.

 

 

For all users of a particular profile, when they login they should be taken to a visualforce page instead of the standard home page. I can differentiate the user based on profile in the controller if I'm able to redirect ALL users to the visualforce page.

 

Any ideas?

 

Thanks in advance.

 

~LVS

  • August 03, 2012
  • Like
  • 0
 Which developer tool can be used to create a data model 
(2 answers)
  
A.Force.com IDE
B.Force.com Data Loader
C.Application Set -up Menu
D.API


Please answer anyone

Hi ,

I have one javascript button , Go with the any record and when we click on button one popup window came 

i.e VF page window.. 

Add one field and click on save button on that widow it should be save and close...

 

Javascript button code is this,

{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}

 

var url="/apex/commentspage?&id= {!Contact.Id}";

newWin=window.open(url, 'Popup','height=500,width=600,left=150,top=150,resizable=yes,scrollbars=no,toolbar=no,status=no');

if (newWin.focus())
{
newWin.focus();

}

 

 

After creation of button.

Go with contact record, there is one button available right,

Then click on that button one VF page popup window came.

The VF page is.. 

<apex:page controller="commentspage" showHeader="false" sidebar="false" showChat="false" standardStylesheets="false" >

<script type="text/javascript">
function closeWin(){
self.close();
}
</script>

<apex:form > <br/><br/>
<div align="center">
<apex:inputTextarea value="{!CommentText}"/><br/><br/>
<apex:commandButton oncomplete="closeWin" action="{!save}" value="Save" id="theButton"/>
</div>
</apex:form>
</apex:page>

 

 

The Action performed on controller...

Please solve my problm...

Hello,

 

I have tried everything I can think of and I cannot get a pageblocktable to modify the column width to custom sizes and this is having a negative impact on the usability of the page. I have tried adding the width tag to the columns, I also tried using a style tag with a width parameter. I also tried defining the columns width in the pageblocktable definition but NO LUCK.  I am not sure what is causing the columns not to change their sizes, although I have a feeling that some of the inner tags in the columns may have something to do with it. I say this because I also tried changing their width without any tag other than the label and the column tag and it works. Please see code below, the first is the working example i have tried where columns do expand/contract to the respective width. The second example is the one I need to use in my VF page and the one that does not want to cooperate and change column widths. Please assist!

 

the table in blue is the example table adn the red one is the one I need for it to expand contract, right now it is trying to set widths using a style tag, but as I mentioned already, other methods are not working either.

 

 

<apex:page controller="SalesDocumentManager_Controller" tabStyle="SCRB_SalesOrder__c" id="thePage" >
<apex:sectionHeader title="Create Sales Document" subtitle="{!mAccount.Name}"/>
<apex:form id="theForm">
<apex:outputPanel id="msgs" >
<apex:messages style="font-weight:bold; color:red; font-size:medium; text-align:center; " />
<apex:actionStatus startText="Saving changes......" id="saveStatus" startstyle="font-weight:bold; color:green; font-size:medium; text-align:center; " layout="block" />
</apex:outputPanel>

<apex:commandButton action="{!saveSO}" value="Save Changes" reRender="out,btnAddSOI,msgs, fOppId" status="saveStatus" >
</apex:commandButton>

<!----------------------------->
<!--SALES ORDER ITEMS SECTION-->
<!----------------------------->

<apex:pageblock title="TEST table">
<apex:pageBlockTable style="width:100%" value="{!SOItems}" var="SOI" >
<apex:column headerValue="Action" style="width:150px">
<apex:commandLink value="Del" action="{!del}" rerender="tablePnl,detailPanel" style="font-weight:bold" >
<apex:param name="delname" value="{!SOI.id}" assignTo="{!currSOIid}"/>
</apex:commandLink>
&nbsp;|&nbsp;
<apex:commandLink value="Save" action="{!saveSOI}" rerender="tablePnl,detailPanel" style="font-weight:bold" status="saveSOIstatus" >
<apex:param name="savename" value="{!SOI.id}" assignTo="{!currSOIid}"/>
</apex:commandLink>
</apex:column>
<apex:column style="width:250px" value="{!SOI.Product_Name_Custom__c}"/>
<apex:column style="width:250px" value="{!SOI.Line_Type__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>

<apex:pageblock title="Sales Order Items" tabStyle="SCRB_SalesOrder__c" id="SOIpgblk" >

<apex:messages style="font-weight:bold; color:red; font-size:medium; text-align:center; " />
<apex:pageBlockButtons location="top" >
<apex:commandButton action="{!AddSOI}" value="Add New Item" rerender="tablePnl" disabled="{!NOT(SOsaved)}" id="btnAddSOI" />

</apex:pageBlockButtons>
<apex:actionStatus startText="Saving record......" id="saveSOIstatus" startstyle="font-weight:bold; color:green; font-size:small; text-align:center; " layout="block" />
<apex:actionFunction name="doUpdateProdData" action="{!updateSearchProductData}" reRender="detailPanel, tablePnl" immediate="true">
<apex:param id="prodId" value="" name="prodId"/>
</apex:actionFunction>

<apex:actionRegion id="prodUpdate" renderRegionOnly="false">
<apex:outputPanel id="tablePnl">
<apex:pageblockTable value="{!SOItems}" var="SOI" id="SOIList" style="width:100%">
<apex:column headerValue="Action" >
<apex:commandLink value="Del" action="{!del}" rerender="tablePnl,detailPanel" style="width:150px" >
<apex:param name="delname" value="{!SOI.id}" assignTo="{!currSOIid}"/>
</apex:commandLink>
&nbsp;|&nbsp;
<apex:commandLink value="Save" action="{!saveSOI}" rerender="tablePnl,detailPanel" style="font-weight:bold" status="saveSOIstatus" >
<apex:param name="savename" value="{!SOI.id}" assignTo="{!currSOIid}"/>
</apex:commandLink>
</apex:column>
<apex:column headerValue="Line type" id="ltcol" style="width:50px">
<apex:actionRegion id="lnTypeRgn" renderRegionOnly="false">
<apex:inputField value="{!SOI.Line_Type__c}" id="fLineType" required="true" >
<apex:actionSupport event="onchange" rerender="tablePnl" action="{!resetRowData}">
<apex:param name="currSOIid" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>

</apex:inputField>
</apex:actionRegion>
</apex:column>

<apex:column headerValue="Product" id="prodCol" style="width:50px">
<apex:actionRegion id="prodRgn">
<apex:inputField value="{!SOI.Product_Name_Custom__c}" id="fProd" onFocus="this.blur()" >
<apex:actionSupport event="onchange" reRender="detailPanel" action="{!loadSOIDs}" >
<apex:param name="currSOIid" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
<apex:param name="currSOILT" value="{!SOI.Line_Type__c}" assignTo="{!currLineType}"/>
</apex:actionSupport>
</apex:inputField>


<apex:commandLink onclick="prodLookup(this.parentNode.parentNode)" reRender="fProd">
<apex:image value="{!$Resource.lookupIcon}"/>
<apex:param name="currSOI" value="{!SOI.id}" assignTo="{!currSOIid}"/>
</apex:commandLink>
</apex:actionRegion>
</apex:column>
<apex:column headerValue="Description" style="width:50px">
<apex:actionRegion id="rgnDesc" renderRegionOnly="false" >
<apex:inputField value="{!SOI.Description__c}" id="fDescr" >
<apex:actionSupport event="onfocus" reRender="detailPanel" action="{!loadSOIDs}">
<apex:param name="currSOIid" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
<apex:param name="currSOILT" value="{!SOI.Line_Type__c}" assignTo="{!currLineType}"/>
</apex:actionSupport>
</apex:inputField>
</apex:actionRegion>
</apex:column>
<apex:column headerValue="Quantity" style="width:50px">
<apex:actionRegion >
<apex:inputField value="{!SOI.Quantity__c}" id="fQTY" required="{!SOI.Product_Name_Custom__c <> null}" >
<apex:actionSupport event="onfocus" reRender="detailPanel" action="{!loadSOIDs}">
<apex:param name="currSOIid" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
<apex:param name="currSOILT" value="{!SOI.Line_Type__c}" assignTo="{!currLineType}"/>
</apex:actionSupport>
<apex:actionSupport event="onchange" rerender="fDiscAmt,colTest,fTotalPrice,fProfit" action="{!calculateTotalPrice}">
<apex:param name="currSOIQty" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:actionRegion>
</apex:column>
<apex:column headerValue="Unit Cost" style="width:50px" >
<apex:inputField value="{!SOI.Unit_Cost__c}" id="fUnitCost">
<apex:actionSupport event="onchange" rerender="fDiscAmt,fTotalPrice,fProfit" action="{!calculateTotalPrice}">
<apex:param name="currSOIUC" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:column>
<apex:column headerValue="Sales Price ex VAT" style="width:50px">
<apex:inputField value="{!SOI.SalesPrice__c}" id="fSalesPrice" >
<apex:actionSupport event="onchange" rerender="fDiscAmt,fTotalPrice,fProfit" action="{!calculateTotalPrice}">
<apex:param name="currSOISP" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:column>
<apex:column headerValue="Line Disc Pct." style="width:50px">
<apex:inputField value="{!SOI.Line_Discount_Pct__c}" id="fDiscPct">
<apex:actionSupport event="onchange" rerender="fDiscAmt,fTotalPrice,fProfit" action="{!calculateTotalPrice}">
<apex:param name="currSOIDP" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:column>
<apex:column headerValue="Line Disc Amt." style="width:50px">
<apex:inputField value="{!SOI.Line_Discount_Amount__c}" id="fDiscAmt">
<apex:actionSupport event="onchange" rerender="fDiscPct,fTotalPrice,fProfit" action="{!calculateDiscPct}">
<apex:param name="currSOIDA" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:column>
<apex:column headerValue="Profit" style="width:50px">
<apex:outputField value="{!SOI.Profit__c}" id="fProfit"/>
</apex:column>
<apex:column headerValue="Total Price" style="width:50px">
<apex:outputField value="{!SOI.TotalPrice__c}" id="fTotalPrice"/>
</apex:column>
<apex:column headerValue="Line Status" style="width:50px">
<apex:outputField value="{!SOI.Line_Status__c}" id="fLineStatus" />
</apex:column>
</apex:pageBlockTable>
</apex:outputPanel>
</apex:actionRegion>


</apex:pageBlock>
</apex:form>
</apex:page>

Hai,

I am trying to hide and display  a inputText field ,on change of a radio button,using javascript,but the issue is that,this is affecting only to the label of that text field,and no efffect on the text field.Please suggest me a solution

 

 

<script type="text/javascript">

function showVisibility(radio_value,id)

if(radio_value==1)
document.getElementById("average_sales").style.display="block";
if(radio_value==0)
document.getElementById("average_sales").style.display="none";
}
</script>

 

*********VF page **********

<label for="typical">4.Is this typical?</label>
<apex:selectRadio id="typical" onchange="showVisibility(this.value)" >
<apex:selectOption itemValue="0" itemLabel="Yes" />
<apex:selectOption itemValue="1" itemLabel="No" />
</apex:selectRadio>

<div id="average_sales">
<label for="average_sales_price">4.1.what is the average sales price?</label>
<apex:inputText id="average_sales_price" label="4.1.what is the average sales price?"/>
</div>

 

 

Shine

I'm unable to pass a date param in a vf page ... am I doing something wrong or is this a bug? Below is an example of the page and controller. It works when passing it into a string field but not when going from date to date. 

 

<apex:page controller="testPage2Con">
    <apex:form id="mainForm">
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:outputText value="{!date1}" label="date1"/>
                <apex:outputText value="{!date2}" label="date2"/>
                <apex:outputText value="{!dateString}" label="dateString"/>
                <apex:commandButton value="Set TRX Date" reRender="mainForm" action="{!setDateAction}">
                    <apex:param name="setDate" value="{!date2}" assignTo="{!date1}" />
                    <apex:param name="setDescription" value="{!TEXT(date2)}" assignTo="{!dateString}" />
                </apex:commandButton>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

public class testPage2Con {

    public Date date1{get{return date1;}set;}    
    public String dateString{get{return dateString;}set;}
    
    public Date date2;
    
    public Date getDate2(){
        if(date2 == null)
            date2 = system.today();
        return date2;
    }

    public void setDateAction(){
    
    }

}

 

  • July 25, 2012
  • Like
  • 0

Hello All,

 

Good Morning, I'm getting below mentioned error while creating a VF page.

 

"System.QueryException: Didn't understand relationship 'accobj' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Error is in expression '{!search}' in component <apex:page> in page inlineopportunitysearch


Class.OpportunitySearchController.search: line 38, column 1"

 

 

VF Page-

 

<apex:page standardController="Account" extensions="OpportunitySearchController" >
<style type="text/css">
        body {background: #F3F3EC; padding-top: 15px}
</style>
<apex:form >
<apex:pageBlock title="Search For Opportunities With Keyword" id="block" mode="edit">
<apex:messages />
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel for="searchText">Keyword</apex:outputLabel>
<apex:panelGroup >
<apex:inputText id="searchText" value="{!searchText}"/>
<apex:commandButton value="Search" action="{!search}" status="status" reRender="resultsBlock"/>
</apex:panelGroup>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:actionStatus id="status" startText="Searching ..Please wait"/>
<apex:pageBlockSection id="resultsBlock" columns="1">
<apex:pageBlockTable value="{!searchResults}" var="srs" rendered="{!NOT(ISNULL(searchResults))}">
<apex:column headerValue="Name">
<apex:outputLink value="/{!srs.Id}">{!srs.Name}</apex:outputLink>
</apex:column>
<apex:column value="{!srs.StageName}"/>
<apex:column value="{!srs.Amount}"/>
<apex:column value="{!srs.CloseDate}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Contrller ===>

 

public class OpportunitySearchController
{
    private ApexPages.StandardController controller {get; set;}
    private Account accobj;
    public List<opportunity> searchResults {get;set;}
    public String searchText {
    get
    {
       if (searchText == null) searchText = 'Acme';
       return searchText;
    
    }
    set;
    }
   
    
    public OpportunitySearchController(ApexPages.StandardController controller)
    {
      this.controller=controller;
      this.accobj=(Account)controller.getRecord();
      
         
    }
    
    //fired when the search button is clicked
    public PageReference search()
    {
          if(searchResults==null)
          {
             searchResults = new List<opportunity>();
          }
          else
          {
           searchResults.clear();  
          }
          
          String qry = 'Select o.Id, o.Name, o.StageName, o.CloseDate, o.Amount from Opportunity o Where AccountId =\''+accobj.Id+'\' And accobj.Name LIKE \'%'+searchText+'%\' Order By o.Name';
          searchResults =Database.query(qry);
          return null;
    }

}

 

Please helpme to get it corrected. Thanks for you all help and suggestions.


Is there a way to retrieve the login hours for a profile using apex?

 

I want start and end time for a particular user.

 

Thanks in advance!

Hi all

 

i have applied a scroll for the pageblocktable using a ouputpanel but now i want to freeze the header of the pageblock table for that i googled and found that by using css we can do so and i tried the css on the headerclass it is not working when i tried to apply color to the text it worked, seting the position to fixed also worked but then freezing the header does not work i do not get an idea wat is the problem. plz help me

below is the code:

<apex:page Controller="mycontroller">
<style>
.container
{
   overflow:auto;  
   height:50px;     
}
.headerRow .headerStyle
{
     color: #CC0000 !important; 
     position:relative;
     TOP: expression(this.offsetParent.scrollTop-2);         
}

</style>
     <apex:form >
        <apex:pageBlock title="My Content" mode="edit">
           <apex:pageBlockSection title="My Content Section" columns="1"   > 
               <apex:outputPanel layout="block" styleClass="container"  >           
                <apex:pageBlockTable value="{!temp}" var="item" align="top" width="100%" columns="10" headerclass="headerStyle">
                    <apex:column value="{!item.password__c}" ></apex:column>                                         
                </apex:pageBlockTable>
             </apex:outputPanel>           
            </apex:pageBlockSection>
         </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

  • September 27, 2010
  • Like
  • 0