• Madhura B
  • NEWBIE
  • 115 Points
  • Member since 2010
  • Senior Software Engineer
  • Accenture

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 34
    Questions
  • 54
    Replies

Hi,

I would like to know if there is a way to assign PriceBook Id to Quote using configuration. 

My org has just one pricebook and the same is assigned to all Quotes when a new Quote is getting created in a class. This leads to 'unbale to lock row exception' or lookup skew. 


Thanks in advance


 

AND(PRIORVALUE( pi__score__c )< pi__score__c - 25, Lead_Record_Type_Text__c = "School Lead", OR(LastActivityDate < TODAY() +5, LastActivityDate=null) )

Can someone help me with this formula. It worked until I added the syntax ' , OR(LastActivityDate > TODAY() +5, LastActivityDate=null)'. I'm trying to say the last activity date has to be greater than today+ 5 days OR equal to blank.
 

Thanks for the help!

Hi All,

Can any one help me to find the best way to accomplish this requirement?

When a parent Object record is created I have to populate 5 child object records. By using Apex trigger I can do this or I have to develop a VF page? Please guide me on this. Thanks in advance!!!
<apex:page controller="BookRoom" docType="html-5.0" >

<apex:form >

<apex:pageBlock  >
<apex:pageMessages id="msg"></apex:pageMessages>
////////This Is Picklist field/////////////////
<apex:outputtext ><b>Room No</b></apex:outputtext>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<apex:inputField value="{!dx.Room__c}" rendered="true" required="true"></apex:inputField>
<br></br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
<apex:outputText escape="true"><b>Date</b></apex:outputText>
<apex:inputfield value="{!dummyroom.Date__c}" required="true" rendered="true" /></br>
<apex:outputtext ><b>Client Name</b></apex:outputtext>
<apex:inputfield value="{!dx.Contact__c}" required="true"  label="Client Name" />
<br/>
<apex:commandButton value="Check Availability" action="{!CheckAvailability}" rendered="true"/>
<br/>
</apex:pageBlock>
/////////////////////////////////////////////////////////////////////////

<apex:pageBlock rendered="{!ShowpageBlockFlag}">
<apex:dataTable value="{!BookingSlots}" var="bs" id="thetable" columnClasses="col1,col2,col3,col4" width="60%">
<apex:column value="{!bs.event.subject}"/>
<apex:column value="{!bs.event.startdatetime}"/>
<apex:column value="{!bs.event.enddatetime}"/>
<apex:column ><apex:inputCheckbox value="{!bs.checkbox}" required="true"/></apex:column>
</apex:dataTable>
<br/><br/><br/>

<apex:commandButton value="Book the slot" action="{!Savedetails}" rerender="msg,ol"/>
<apex:commandButton value="Cancel" action="{!Cancel}" rerender="msg,pl"/>
</apex:pageBlock>

 

</apex:form>
</apex:page>
I want Rerender the first pageblock after item from picklist is changed...


Hello all,

I have custom visual force page for our case page.

We have two custom checkbox felds called Followup_required and call_back_needed. So when ever one of those fields are checked, I wanted my due date to be a required field.

I wrote this code but it doesnt work

<apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.ActivityDate__c.label}"/>
                              <apex:outputPanel id="DueDate">
                             <apex:inputField value="{!NewCase.ActivityDate__c}" required="{{!Newcase.Are_you_going_to_call_back__c}||{!Newcase.Follow_up_required__c}}"/>
                              </apex:outputPanel>
                         </apex:pageblockSectionItem>






This is my visual force page. I highlighted the area of code im having trouble with. Please help


<apex:page tabStyle="case" standardController="contact" extensions="NewCaseController" recordSetVar="Cases">
    <apex:sectionHeader title="{!$ObjectType.Case.label}" subtitle="New {!$ObjectType.Case.label}" id="header"/>
    <apex:pagemessages id="pgmsgs"/>
    <apex:form >
        <apex:pageblock title="New Case">
            <apex:pageblockButtons >
                <apex:commandButton value="Save" action="{!SaveandRedirect}" />
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageblockButtons>
            <apex:pageblockSection columns="2" title="Case Information" collapsible="false">
                 <apex:inputfield value="{!NewCase.ContactId}"/>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="{!$ObjectType.Case.label} Owner"/>
                     <apex:outputText value="{!$User.FirstName} {!$User.LastName}"/>
                 </apex:pageblockSectionItem>
                 <apex:inputfield value="{!NewCase.Origin}" required="true"/>
                 <apex:inputfield value="{!NewCase.AccountId}"/>
                 <apex:inputField value="{!NewCase.Type}" required="true"/>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="ContactPhone" for="contactphone"/>
                     <apex:outputText value="{!contactphone}" id="contactphone"/>
                 </apex:pageblockSectionItem>   
                 <apex:inputfield value="{!NewCase.SubType__c}" required="true"/>
                 <apex:inputfield value="{!NewCase.Subject}" required="true"/>
                 <apex:inputfield value="{!NewCase.Priority}"/>             
                 <apex:inputfield id="description" value="{!NewCase.Description}" required="true" style="width:400px;height:120px;"/>                  
                 <apex:pageblockSectionItem >
                     <apex:outputlabel value="{!$ObjectType.Case.fields.status.label}"/>
                     <apex:actionRegion >
                         <apex:inputfield value="{!NewCase.Status}" required="true">
                            <apex:actionsupport event="onchange" rerender="pgmsgs, followupfield, callbackfield" action="{!statuschange}"/>
                         </apex:inputfield>
                     </apex:actionRegion>
                 </apex:pageblockSectionItem>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="Internal Comments" for="internalcomments"/>
                     <apex:inputTextarea value="{!Internalcomments}" id="internalcomments" style="width:400px;height:120px;"/>
                 </apex:pageblockSectionItem>
                 <apex:pageblockSectionItem >
                     <apex:outputlabel value="{!$ObjectType.Case.fields.Supervisor_Call_Back_Required__c.label}"/>
                     <apex:inputCheckbox value="{!NewCase.Supervisor_Call_Back_Required__c}"/>
                 </apex:pageblockSectionItem>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="This is past 48 hours requirement. Would you still like to proceed?"/>
                     <apex:inputCheckbox value="{!OverrideActivityValidation}"/>
                 </apex:pageblockSectionItem>
             
           </apex:pageblockSection>
           <apex:pageblockSection columns="1">    
                 <apex:pageblockSectionItem >
                     <apex:pageblockSection columns="4">
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.Follow_up_required__c.label}"/>
                             <apex:actionRegion >
                                 <apex:outputPanel id="followupfield">
                                     <apex:inputcheckbox value="{!NewCase.Follow_up_required__c}" disabled="{!Newcase.status == 'Closed'}">
                                         <apex:actionSupport action="{!mutualexclusionrule_followup}"  reRender="callbackfield,callbacknumber" event="onchange"/>
                                     </apex:inputcheckbox>
                                 </apex:outputPanel>   
                             </apex:actionRegion>   
                         </apex:pageblockSectionItem>
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.Are_you_going_to_call_back__c.label}"/>
                             <apex:actionRegion >
                                 <apex:outputPanel id="callbackfield">
                                     <apex:inputcheckbox value="{!NewCase.Are_you_going_to_call_back__c}" disabled="{!Newcase.status == 'Closed'}">
                                         <apex:actionSupport action="{!mutualexclusionrule_cb}" reRender="followupfield,callbacknumber" event="onchange"/>
                                     </apex:inputcheckbox>
                                 </apex:outputPanel>
                             </apex:actionRegion>
                         </apex:pageblockSectionItem>
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.Callback_Number__c.label}" />
                             <apex:outputPanel id="callbacknumber">
                                 <apex:inputField value="{!NewCase.Callback_Number__c}" required="{!Newcase.Are_you_going_to_call_back__c}"/>
                             </apex:outputPanel>
                         </apex:pageblockSectionItem>
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.ActivityDate__c.label}"/>
                              <apex:outputPanel id="DueDate">
                             <apex:inputField value="{!NewCase.ActivityDate__c}" required="{{!Newcase.Are_you_going_to_call_back__c}||{!Newcase.Follow_up_required__c}}"/>
                              </apex:outputPanel>
                         </apex:pageblockSectionItem>

                    </apex:pageblockSection>
                 </apex:pageblockSectionItem>
             </apex:pageblockSection>
        </apex:pageblock>
    </apex:form>
</apex:page>


public pageReference doSearch()
    {
        System.debug('***dbPDF***'+dbPDF);
       
    display=true;
        String strQuery = 'SELECT Name, Accountnumber__c, Phone, Fax FROM Account ';
       
       // Date onOrAfterDate  = dbPDF.Instrument_Date__c;
       // Date onOrBeforeDate = con.Birthdate;
       
       
       
         if(dbPDF.name != null || dbPDF.Accountnumber__c != NULL || dbPDF.Phone != NULL || dbPDF.Fax  != NULL){
            strQuery += 'WHERE ';
        }
       
        if(dbPDF.Accountnumber__c != NULL){
            strQuery += 'name =\'' + dbPDF.name + '\' AND ' ;
        }
       
        if(dbPDF.Accountnumber__c != NULL){
            strQuery += 'Accountnumber__c =\'' + dbPDF.Accountnumber__c + '\' AND ' ;
        }
       
        if(dbPDF.Fax != NULL){
            strQuery += 'Fax  =\'' + dbPDF.Fax  + '\' AND ' ;
        }
       
        if(dbPDF.Phone != NULL){
            strQuery += 'Phone  =\''+dbPDF.Phone+ '\'AND ';
        }
  
       
       
         strQuery = strQuery.substring(0, strQuery.length()-4);
          System.debug('!!! '+strQuery);
         
             
            records = Database.query(strQuery);
                   
                    
        return null;
     }

How to add above code in below  controller code

Mypage:
--------

<apex:page controller="pagingControllerForUser1">
    <apex:form >
        <apex:pageBlock >
           
            <apex:pageMessages id="pgm"/>
           
            <apex:pageBlockButtons >
                <apex:commandButton value="Search" action="{!Search}"/>
            </apex:pageBlockButtons>
           
            <apex:pageBlockSection >
                 <apex:inputField value="{!dbPDF.name}"/>
                 <apex:inputField value="{!dbPDF.phone}"/>
                 <apex:inputField value="{!dbPDF.Fax}"/>
                <apex:inputField value="{!dbPDF.Accountnumber__c}"/>
               
 
                <!-- <apex:inputField value="{!con.Birthdate}" label="On or Before"/>-->
   
            </apex:pageBlockSection>

        </apex:pageBlock>

        <apex:pageBlock rendered="{!IF(AllSearchUsers.size != null && AllSearchUsers.size > 0, true , false)}">
                    <apex:outputPanel layout="block" styleClass="pSearchShowMore" id="otpNav2">
              Total Records Found: <apex:outputText rendered="{!IF(Con.resultSize==10000,true,false)}">10000 +</apex:outputText><apex:outputText rendered="{!IF(Con.resultSize < 10000,true,false)}">{!Con.resultSize}</apex:outputText>
                  <apex:image url="/img/search_prevarrow_disabled.gif" styleClass="prevArrow" rendered="{!NOT(Con.HasPrevious)}"/>
                  <apex:image url="/img/search_prevarrow.gif" title="Previous Page" styleClass="prevArrow" rendered="{!Con.HasPrevious}"/>
                  <apex:commandLink action="{!Previous}" title="Previous Page" value="Previous Page" rendered="{!Con.HasPrevious}"/>
                  <apex:outputPanel styleClass="pShowLess noLink" style="color:grey" rendered="{!NOT(Con.HasPrevious)}">Previous Page</apex:outputPanel>        
                  &nbsp;({!IF(Con.PageNumber == 1,1,((Con.PageNumber -1) * Con.PageSize)+1)}-{!IF(Con.resultSize < Con.PageSize,Con.resultSize,Con.PageNumber * Con.pageSize)})&nbsp;
                  <apex:outputPanel styleClass="pShowLess noLink" style="color:grey" rendered="{!NOT(Con.HasNext)}">Next Page</apex:outputPanel>        
                  <apex:commandLink title="Next Page" value="Next Page" rendered="{!Con.HasNext}" action="{!Next}"/>&nbsp;
                  <apex:image url="/img/search_nextarrow.gif" title="Next Page" styleClass="nextArrow" rendered="{!Con.HasNext}"/>
                  <apex:image url="/img/search_nextarrow_disabled.gif" rendered="{!NOT(Con.HasNext)}"/>         
              </apex:outputPanel>
           
           <apex:pageBlockSection columns="1">
               <apex:pageBlockTable var="UR" value="{!AllSearchUsers}" id="pbTable">
                <apex:column value="{!UR.Name}" />
                <apex:column headerValue="Accountnumber">
                    <apex:commandLink value="{!UR.Accountnumber__c}" action="{!displayFields}">
                        <apex:param name="RecordId Id" value="{!UR.Id}" assignTo="{!RecordId}"/>
                    </apex:commandlink>
                </apex:column>
                <apex:column value="{!UR.phone}" />
                <apex:column value="{!UR.Fax}" />
             
               
            </apex:pageBlockTable>
            </apex:pageBlockSection>
            <apex:outputPanel layout="block" styleClass="pSearchShowMore" id="otpNav">
              Total Records Found: <apex:outputText rendered="{!IF(Con.resultSize==10000,true,false)}">10000 +</apex:outputText><apex:outputText rendered="{!IF(Con.resultSize < 10000,true,false)}">{!Con.resultSize}</apex:outputText>
                  <apex:image url="/img/search_prevarrow_disabled.gif" styleClass="prevArrow" rendered="{!NOT(Con.HasPrevious)}"/>
                  <apex:image url="/img/search_prevarrow.gif" title="Previous Page" styleClass="prevArrow" rendered="{!Con.HasPrevious}"/>
                  <apex:commandLink action="{!Previous}" title="Previous Page" value="Previous Page" rendered="{!Con.HasPrevious}"/>
                  <apex:outputPanel styleClass="pShowLess noLink" style="color:grey" rendered="{!NOT(Con.HasPrevious)}">Previous Page</apex:outputPanel>        
                  &nbsp;({!IF(Con.PageNumber == 1,1,((Con.PageNumber -1) * Con.PageSize)+1)}-{!IF(Con.resultSize < Con.PageSize,Con.resultSize,Con.PageNumber * Con.pageSize)})&nbsp;
                  <apex:outputPanel styleClass="pShowLess noLink" style="color:grey" rendered="{!NOT(Con.HasNext)}">Next Page</apex:outputPanel>        
                  <apex:commandLink title="Next Page" value="Next Page" rendered="{!Con.HasNext}" action="{!Next}"/>&nbsp;
                  <apex:image url="/img/search_nextarrow.gif" title="Next Page" styleClass="nextArrow" rendered="{!Con.HasNext}"/>
                  <apex:image url="/img/search_nextarrow_disabled.gif" rendered="{!NOT(Con.HasNext)}"/>         
              </apex:outputPanel>

        </apex:pageBlock>

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

Example   Controller:
--------------------------------

public class pagingControllerForUser
{
    public List<Account> AllSearchUsers
    {
        get
        {
            if(con != null)
                return (List<Account>)con.getRecords();
            else
                return null ;
        }
        set;}
   
    public Account usr {get; set;}
   
    //Controller
    public pagingControllerForUser()
    {
        AllSearchUsers = new List<Account>() ;
        usr = new Account() ;
    }
   
     public PageReference Search()
    {  
        if(usr.Name != null)
        {
            con = new ApexPages.StandardSetController(Database.getQueryLocator([select Id , name , phone,Fax from Account where name = :usr.Name]));

            // sets the number of records in each page set
            con.setPageSize(25);
        }
        else
        {
            con = null;
        }
        return null ;
    }
   
    //Instantiate the StandardSetController
    public ApexPages.StandardSetController con{get; set;}
   
    //Boolean to check if there are more records after the present displaying records
    public Boolean hasNext
    {
        get
        {
            return con.getHasNext();
        }
        set;
    }

    //Boolean to check if there are more records before the present displaying records
    public Boolean hasPrevious
    {
        get
        {
            return con.getHasPrevious();
        }
        set;
    }

    //Page number of the current displaying records
    public Integer pageNumber
    {
        get
        {
            return con.getPageNumber();
        }
        set;
    }

    //Returns the previous page of records
    public void previous()
    {
        con.previous();
    }

    //Returns the next page of records
    public void next()
    {
        con.next();
    }
}


Note:In above page is my visualforce page controller i get from Google

How to add My  doSearch() in above controller?



please help me.......
Hi  i have two objects A anad B , i have 3 fields  same in both objects and lookup relation is there, when i create B object recoird  i selecting lookup field automatically that three fields populate in B object what ever values in A object can help me Any one for this task?
I have a custom object named County that houses all U.S. data for zipcodes and counties.

I have a County custom field on my contacts.

I need help creating a simple trigger that will update the County field on my contact.  I want to match the zipcode on the contact with the zipcode on the county object and return the value of the county.

Screen shots are below:

Contact Image



User-added image
hi

I have a custom controller in which i have placed the logic of the save method.
However after clicked on save i want to display the detail page of the newly inserted record to the user

How do i do it?

Any help would be appreciated

Thanks

Hi,

 

I have inline editing to one of the fields (lookup field to Contact) of a Custom object in my VF page.

When i double click the field, enter a value and hit save it is saving a null value. It works sometimes but not always.

 

I can't figure out why the inconsistency.

 

Please suggest. Following is my code.

 

<td >
    
    <apex:outputField value="{!fl.EventInfo.Facilitator_1__c}">
    <apex:inlineEditSupport event="ondblClick"  showOnEdit="saveButton"/>
    </apex:outputField>
    <apex:outputField value="{!fl.SessionInfo.Facilitator1__c}"> 
    <apex:inlineEditSupport event="ondblClick"  showOnEdit="saveButton"/>
    </apex:outputField>

</td>

 EventInfo and SessionInfo are my wrapper classes. Facilitator_1__c and Facilitator1__c are lookup to contact.

Hi,

 

I would like to have radio buttons in each row of a dataTable and the user must be allowed to select only one. That is, the previously selected radio button should be reset when a new radio button on a different row is selected.

 

Please suggest. 

 

Also please suggest how to assign value to a variable in the wrapper class from the <input type="radio" >

I tried <apex:param but it did not seem to work 

 

<input type="radio" name="test" onclick="return confirmSubmit();" value="1">

</input>

 

Hi,

 

I added few new values to a picklist field. The values were not sorted alphabetically earlier so I tried doing it now after adding my new values and I get this error.

 

Conflict Encountered During Save

You attempted to save changes that conflicted with the changes of another user. Please try again. 

Click here to return to the previous page.

 

 

Any ideas?

Hi

 

I have an inline visualforce added to my standard contact page. All works fine but the field font doesn't match with the standard salesforce style.

Could anybody please tell me what style should be added for this to be achieved

 

<apex:page standardController="Contact" extensions="contactSubRecords" tabstyle="Contact" showheader="true">

<apex:pageBlock >
<apex:pageblockSection title="Alumnus"  columns="1" rendered="{!if(contact.Alumnus__c==True,true,false)}">
<apex:tabPanel switchType="client" value="{!selectedTab}" tabClass="activeTab" inactiveTabClass="inactiveTab" >
<apex:tab label="Alumnus"  > 
  <apex:pageBlock >
   <apex:pageBlockSection title="Alumnus Details">
			<apex:outputField value={!Contact.field1__c}" />
			<apex:outputField value="{!Contact.field2__c}" />
   </apex:pageBlockSection>
 </apex:pageBlock> 
</apex:tab>
</apex:tabPanel>
</apex:pageblockSection>
</apex:pageBlock>
<apex:page>

 

Hi,

 

I have an inline visualforce page which displays the related lists of Contacts.

Though the related lists are appearing fine when I click on the record it opens in the frame.

Is there a way to open this in a new tab?

 

<apex:page standardController="Contact" extensions="customContact">
<style>
.activeTab { width:235px;background:url(/resource/1306399243000/tabpicture) }
.inactiveTab { background-color: lightgrey; color:black; background-image:none;size:400x400}
</style>

<apex:tabPanel switchType="client" value="{!selectedTab}" tabClass="activeTab" inactiveTabClass="inactiveTab">
 
  <apex:tab label="Improvement Initiative Std "  > 
   <apex:relatedList list="Improvement_Initiative__r" /> 
  </apex:tab>

</apex:tabPanel>
</apex:page>

 

 

Thanks 

Hi Everyone,

 

I am trying to create a formula using the IF and INCLUDES function out of the multi-picklist field. Here's the scenario:

I have a mutli-picklist Area__c with options as: Manila West, Manila Central, Pasay North. I want the result to return "Manila" if user picked any of these values.

 

Here's my formula, but when a user select all of the options it resulted to Manila;Manila;Manila.

How can make the ouput to single Manila only if user selected 2 or more options.

 

 

IF(INCLUDES(Areas__c,"Manila West"), "Manila;","") &
IF(INCLUDES(Areas__c,"Manila Central"), "Manila;","") &
IF(INCLUDES(Areas__c,"Pasay North"), "Manila;","")

 

Thanks,

Del

Can we Export Excel sheet with more then one tab by VF page.or CRM???????????

 

I want to show more then one object's record in a Excel sheet with diffrent tab.

 

I am useing code..........

 

<apex:smileytongue:age standardController="Account" contenttype="application/vnd.ms-excel">

 

 

 

 

Help me plz 

 

Thanks !!!!!!!