- Madhura B
- NEWBIE
- 115 Points
- Member since 2010
- Senior Software Engineer
- Accenture
-
ChatterFeed
-
4Best Answers
-
0Likes Received
-
0Likes Given
-
34Questions
-
54Replies
Create Child Object records when Parent Object record is created
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!!!
-
- salesforce User 15
- September 08, 2014
- Like
- 0
- Continue reading or reply
Make due date as a required field in my visual force page
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>
-
- vamsivanga
- September 07, 2014
- Like
- 0
- Continue reading or reply
Assign Pricebook Id to Quote
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
-
- Madhura B
- July 21, 2015
- Like
- 0
- Continue reading or reply
Helptext doesn't appear with fieldsets
I have used fieldsets in my visualforce page. Though the fields appear fine, the help text bubble doesn't appear on the layout.
Can somebody please suggest a workaround?
My code looks like this
<apex:pageBlockSection columns="2" title="Opportunity Information" collapsible="false" rendered="{!AND(NOT(isQuickCreate), (isStandard))}"> <apex:repeat value="{!$ObjectType.Opportunity.FieldSets.FS_Opportunity_Detail}" var="fld"> <apex:pageBlockSectionItem helpText="{!$ObjectType.Opportunity.fields[fld].inlineHelpText}" rendered="{!IF(AND(fld != 'Amount', fld != 'Amount_Temp__c'), true, false)}"> <apex:outputLabel value="{!fld.label}"/> <apex:inputField value="{!Opportunity[fld]}" required="{!fld.Required}"/> </apex:pageBlockSectionItem> </apex:repeat> </apex:pageBlockSection>
Many Thanks
-
- Madhura B
- September 22, 2014
- Like
- 0
- Continue reading or reply
Inline editing inconsistent
Hi
I have a vf page with output fieldsdisplayed using a wrapper list. I have to provide inline editing on few output fields and I observed that it is inconsistent. If I inline edit more than one field in a row and select a checkbox (using checkbox as I have made use of wrapper class) on the first column of the row and hit save either of the inline edited fields will be updated and not both. Could someone please suggest me to resolve this issue?
Here's my code.
<table border="1" width="100%" cellpadding="5" style="border-collapse:collapse;border:none;"> <tr> <th > <apex:inputCheckbox onclick="checkAll(this)"/> </th> <th > <apex:commandLink rendered="{!NOT(both)}" action="{!ViewFacilitator}" value="Programme {!IF(sortExpression=='programme',IF(sortDirection=='ASC','▲','▼'),'')}" style="color:#009999;"> <apex:param value="programme" name="column" assignTo="{!sortExpression}" ></apex:param> <apex:param value="{!if(eventType,'event','session')}" name="sortType" assignTo="{!sortType}" ></apex:param> </apex:commandLink> <apex:outPutText value="Programme" rendered="{!both}" style="color:#009999;"/> </th> <th > <apex:commandLink rendered="{!NOT(both)}" action="{!ViewFacilitator}" value="Session Type {!IF(sortExpression=='stype',IF(sortDirection=='ASC','▲','▼'),'')}" style="color:#009999;" > <apex:param value="stype" name="column" assignTo="{!sortExpression}" ></apex:param> <apex:param value="{!if(eventType,'event','session')}" name="sortType" assignTo="{!sortType}" ></apex:param> </apex:commandLink> <apex:outPutText value="Session Type" rendered="{!both}" style="color:#009999;" /> <apex:image url="{!URLFOR($Resource.HelpIcon)}" title="This field can be inline edited." /> </th> <th> <apex:commandLink rendered="{!NOT(both)}" action="{!ViewFacilitator}" style="color:#009999;"> <apex:param value="role1" name="column" assignTo="{!sortExpression}" ></apex:param> <apex:param value="{!if(eventType,'event','session')}" name="sortType" assignTo="{!sortType}" ></apex:param> <font style="color:#009999;">Session<br/>Role {!IF(sortExpression=='role1',IF(sortDirection=='ASC','▲','▼'),'')}</font> </apex:commandLink> </tr> <apex:repeat value="{!FinalList}" var="fl" rendered="{!NOT(ISNULL(FinalList))}" > <tr style="border-top:solid #009999;"> <td> <apex:inputCheckbox value="{!fl.checked}" id="selectLine1" /> </td> <td > <apex:outputText value="Fellows" rendered="{!fl.EventInfo.Id!=''}"/> <apex:outputText value="Teams" rendered="{!fl.SessionInfo.Id!=''}"/> </td> <td > <apex:outputField value="{!fl.EventInfo.Session_Type__c}" > <apex:inlineEditSupport event="ondblClick" /> </apex:outputField> <apex:outputField value="{!fl.SessionInfo.Session_Type__c}" > <apex:inlineEditSupport event="ondblClick" /> </apex:outputField> </td> <td>1F</td> <td > <apex:outputField value="{!fl.EventInfo.Role_1F__c}"> <apex:inlineEditSupport event="ondblClick" /> </apex:outputField> <apex:outputField value="{!fl.SessionInfo.Role_1F__c}"> <apex:inlineEditSupport event="ondblClick" /> </apex:outputField> </td> </tr> </apex:repeat> </table>
-
- Madhura B
- May 30, 2013
- Like
- 0
- Continue reading or reply
Inline Editing for Lookup on VF page
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.
-
- Madhura B
- April 09, 2013
- Like
- 0
- Continue reading or reply
Rendering a Column doesn't show the header value
Hi,
My requirement is to render a column based on changes made in a picklist present in another column. I have used dataTable.
Though the data is appearing the header value doesn't appear.
Could someone please suggest me.
-
- Madhura B
- March 20, 2013
- Like
- 0
- Continue reading or reply
Radio button in data table select only one
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>
-
- Madhura B
- March 13, 2013
- Like
- 0
- Continue reading or reply
Subtracting DateTime fields and disaplying in hh:mm:ss
Hi,
I have to subtract Login time from Logout to determine how long the user was online.
For this I have a formula field which is working fine except for a small glitch.
The formula is as follows.
IF ( LogoutSubLogin__c > 0,
TEXT(FLOOR(LogoutSubLogin__c *24 ) )& " hours " &
TEXT(FLOOR(MOD(LogoutSubLogin__c *1440,60))) & " mins " &
TEXT(FLOOR(MOD(LogoutSubLogin__c *1440,1)*60) )& " secs"
, "Not Logged Out ")
LogoutSubLogin is a Formula number field which holds the difference between Logout and Login (both DateTIme fields)
The issue I am facing is; if
LoginTime = 20/02/2013 06:25
LogoutTime= 20/02/2013 06:49
LogoutSubLogin= 0.016516
Result= 0 hours 23 mins 47 secs
which should actually be 24 minutes. As I am using the Floor function to calculate minutes, 23.78304 is rounded to 23 which should actually be 24. However if I use CEILING then in another cases where the time might be
LoginTime =20/02/2013 05:47
LogoutTime=20/02/2013 05:52
LogoutSubLogin=0.003866
Result= 0 hours 6 mins 34 secs as 5.56704 minutes would be rounded to 6 minutes. (CEILING)
Please can someone suggest me a better way to calculate the minutes such that both the cases mentiones above are satisfied.
-
- Madhura B
- February 20, 2013
- Like
- 0
- Continue reading or reply
Determine Profile when Logging in as Portal User
Hi,
I would like to perform certain actions on the customer portal only when the portal user has logged in from the site login page.
In other words, when the system admins logs in as Portal user certain actions shouldn't take place.
Is there a way to differentiate if the user has logged in from the site login page or from the platform by clicking on 'Login As Portal User' button on the Contact detail page?
Thanks!
-
- Madhura B
- February 18, 2013
- Like
- 0
- Continue reading or reply
Unable to sort picklist values alphabetically
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.
|
Any ideas?
-
- Madhura B
- January 22, 2013
- Like
- 0
- Continue reading or reply
Inline Visualforce Style
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>
-
- Madhura B
- November 08, 2012
- Like
- 0
- Continue reading or reply
String to Integer in SOQL
Hi,
I have a text field which holds numeric values like 1, 2, 3, 12,13 etc. Visualforce page displays these values as
1
12
13
2
3
how can I sort them as 1,2,3,12, 13.... Guess I can't use lpad in soql.
-
- Madhura B
- October 30, 2012
- Like
- 0
- Continue reading or reply
Scheduler class save error
Hi,
I am unable to edit my schedulable class. The error says - Error: Compile Error: Schedulable class has jobs pending or in progress at line 1 column 8
I have checked the Scheduled jobs and there are none scheduled for my class.
Any guidance will be much appreciated!
-
- Madhura B
- October 18, 2012
- Like
- 0
- Continue reading or reply
Inline Visualforce
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
-
- Madhura B
- October 02, 2012
- Like
- 0
- Continue reading or reply
Help Text in Visualforce
Hi,
My visualforce page is as follows. I would like to have the help text displayed next to my input fields.
I can't give showheader as true. So is there any other way to get the helptext bubble displayed?
<apex:outputpanel > <table width="100%"> <tr> <td> <apex:inputfield value="{!af.tdpaf.Area_of_Focus__c}" /> </td> <td> <apex:inputfield value="{!af.tdpaf.What_data_are_you_collecting__c}"/></td> <td> <apex:inputfield value="{!af.tdpaf.Baseline__c}"/></td> </table> </apex:outputpanel >
-
- Madhura B
- June 27, 2012
- Like
- 0
- Continue reading or reply
Problem with actionStatus
Hi
When i click on the commandLink action status changes to (incrementing...) but it doesn't stop. that is the stoptext (done) doesn't appear in the screen and i am guessing because of this reRender on the command link is also not working. Can someone suggest how to fix this please?
<apex:column >
<apex:commandLink action="{!incrementCounter}" target="_blank" status="counterStatus" reRender="docs" >
<apex:param assignTo="{!SelectedId}" name="selId" value="{!d.Id}"/>
<apex:image url="{!URLFOR($Resource.LibraryImages)}" title="Click to Download" />
</apex:commandLink>
</apex:column>
<apex:actionStatus startText=" (incrementing...)" stopText="(done)" id="counterStatus" />
-
- Madhura B
- April 03, 2012
- Like
- 0
- Continue reading or reply
Problem Rerendering an element
Hi
I have a pageblocktable which has to be rerendered in order to dispaly the updated field values but it fails to do so.
Following is my code.
Please help me resolve the issue.
<apex:page sidebar="false" Controller="MyLibrary">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection columns="1">
<apex:PanelGrid width="30%">
<apex:pageBlockSection >
<apex:outputLabel value="Parent Folder" styleClass="labelCol first last" for="parent"/>
<apex:selectList value="{!SelectedParentFolder}" size="1" id="parent" >
<apex:selectOptions value="{!ParentFolderList}" />
<apex:actionSupport event="onchange" reRender="folder"/>
</apex:selectList>
</apex:pageBlockSection>
</apex:PanelGrid>
<apex:PanelGrid id="folder" width="30%">
<apex:pageBlockSection >
<apex:outputLabel value="Sub Folder" styleClass="labelCol first last" for="sfolder"/>
<apex:selectList value="{!SelectFolder}" size="1" id="sfolder" >
<apex:selectOptions value="{!FolderList}" />
<apex:actionSupport event="onchange" reRender="docs" action="{!Go}"/>
</apex:selectList>
</apex:pageBlockSection>
</apex:PanelGrid>
</apex:pageBlockSection>
<apex:pageBlockSection columns="1" id="docs">
<apex:pageMessage severity="info" summary="Sorry the Folder has no Content to display." rendered="{!if(UserLib.size!=0,if(Docs.size==0,true,false),false)}"/>
<apex:pageBlockTable value="{!Docs}" var="d" rendered="{!if(Docs.size>0,true,false)}" id="mytable">
<apex:column >
<apex:outputLink value="/servlet/servlet.FileDownload?file={!d.Document_Id__c}" >
<apex:image url="{!URLFOR($Resource.LibraryImages)}" title="Click to Download" />
<apex:actionSupport event="onclick" rerender="mytable" action="{!incrementCounter}">
<apex:param assignTo="{!SelectedId}" name="selId" value="{!d.Id}"/>
</apex:actionSupport>
</apex:outputLink>
</apex:column>
<apex:column headerValue="Downloaded" >
<apex:outputText value="{!d.Counter__c}" />
</apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
--------------------------------------
public void go()
{
Docs=new List<Document_Details__c>();
Docs.clear();
try{
MyLib=[select id from My_Library__c where Folder__c=:SelectFolder];
UserLib =[select Accessed_by_User__c from User_Library__c where My_Library__c=: MyLib.id ];
if(UserLib.size()!=0)
{
for (Integer j = 0; j< UserLib.size(); j++)
{
if(u.id==UserLib[j].Accessed_by_User__c)
{
Docs=[Select id, Name__c, Document_Id__c, counter__c,Uploaded_by__c,Type__c,Description__c,Document_Created_On__c,My_Library__c From Document_Details__c where My_Library__c=: MyLib.id order by Name__c ];
system.debug('***'+docs);
}
}
}
}catch(Exception e){}
}
public pagereference incrementCounter()
{
UpdateCount = [select id, counter__c from Document_Details__c where id =:SelectedId];
Decimal num= updatecount.counter__c;
updatecount.counter__c=num+1;
update updatecount;
go();
return null;
}
The pageBlockTable doesn't seem to rerender. however the counter is working fine.
-
- Madhura B
- April 02, 2012
- Like
- 0
- Continue reading or reply
Avoid password reset
Hi,
I have to migrate users in the org from one license to another.
Say I deactive certain users and create fresh users with same details as those of deactivated but different License will the password be reset? If so then how can that be avoided?
Thanks
-
- Madhura B
- March 30, 2012
- Like
- 0
- Continue reading or reply
Problem passing a value from the list to JavaScript
Hi
Can someone please tell me how to pass a value from the list to javascript in VF page when an output Link is clicked?
My code is as follows.
<script type="text/javascript">
function Counter()
{
var id={!Docs} // i want to know how to assign the id from the list Docs here. 'coz var id ="{!Docs.id}" doesn't work and // it is not the d.Document_Id__c used in the tag below i want to use here
var updateRecords = [];
result=sforce.connection.query("Select id,counter__c From Document_Details__c where id=:id");
records = result.getArray("records");
var DocumentDetails = new sforce.SObject("Document_Details__c");
var c=records[0].counter__c;
DocumentDetails.counter__c=c++;
updateRecords.push(DocumentDetails);
result=sforce.connection.update(updateRecords);
if (result[0].getBoolean("success"))
{
log("document with id " + result[0].id + " updated");
alert("success");
}
else
{
log("failed to update document " + result[0]);
alert("falied");
}
}
</script>
<apex:pageBlockTable value="{!Docs}" var="d" rendered="{!if(Docs.size>0,true,false)}">
<apex:column >
<apex:outputLink value="/servlet/servlet.FileDownload?file={!d.Document_Id__c}" onclick="Counter()" >
<apex:image url="{!URLFOR($Resource.LibraryImages)}" title="Click to Download" />
</apex:outputLink>
</apex:column>
</apex:pageBlockTable>
Is the approach i have used right? or should i be using JavaScript remoting??
-
- Madhura B
- March 16, 2012
- Like
- 0
- Continue reading or reply
Download Counter
Hi,
Is there a way to keep a count on the number of times a document is downloaded from Documents object?
I need to show the count on a Vf page.
Thanks.
-
- Madhura B
- March 12, 2012
- Like
- 0
- Continue reading or reply
Alignment of Custom picklist and Label
Hi
I have a VF page with a pageblock section which displays fields from an object
<apex:outputpanel>
<apex:pageblocksection>
<apex:inputfield value="{!contactinfo.ABC__c}" >
<apex:actionSupport event="onchange" reRender="yeargroup"/>
</apex:inputfield>
<apex:outputPanel id="yeargroup" >
<apex:pageblocksection rendered="{!flag}">
<apex:outputLabel value="Year Group" styleClass="labelCol first last" for="year" style="align:left;"/>
<apex:selectList value="{!SelectedYearGroup}" size="1" id="year">
<apex:selectOptions value="{!YearGroup1KS3}"/>
</apex:selectList>
</apex:pageblocksection>
</apex:outputPanel>
</apex:pageblocksection>
</apex:outputpanel>
I have used outputpanel as i am reRendering this section based on what's selected on the previous field.
(if i don't use outputpanel the alignment is fine but onclick function doesn't work)
All works fine except for the alignment of my custom picklist. The outputLabel Year Group and the custom picklist are aligned very far from each other.
style="align:left;" for and id for SelectList nothing seem to help.
Any idea how this can be achieved?
Thanks
-
- Madhura B
- March 07, 2012
- Like
- 0
- Continue reading or reply
Assign Pricebook Id to Quote
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
- Madhura B
- July 21, 2015
- Like
- 0
- Continue reading or reply
Formula Not Working
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!
- Eric Boller
- September 09, 2014
- Like
- 0
- Continue reading or reply
Create Child Object records when Parent Object record is created
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!!!
- salesforce User 15
- September 08, 2014
- Like
- 0
- Continue reading or reply
Rerender visualforce when an item from a picklist is selected
<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> <apex:inputField value="{!dx.Room__c}" rendered="true" required="true"></apex:inputField> <br></br> <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...
- raysfdc1988
- September 08, 2014
- Like
- 0
- Continue reading or reply
Make due date as a required field in my visual force page
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>
- vamsivanga
- September 07, 2014
- Like
- 0
- Continue reading or reply
How to add my query to below pagenation code?
{
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>
({!IF(Con.PageNumber == 1,1,((Con.PageNumber -1) * Con.PageSize)+1)}-{!IF(Con.resultSize < Con.PageSize,Con.resultSize,Con.PageNumber * Con.pageSize)})
<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}"/>
<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>
({!IF(Con.PageNumber == 1,1,((Con.PageNumber -1) * Con.PageSize)+1)}-{!IF(Con.resultSize < Con.PageSize,Con.resultSize,Con.PageNumber * Con.pageSize)})
<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}"/>
<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.......
- k sfdc
- September 07, 2014
- Like
- 0
- Continue reading or reply
Auto populate fields for based selecting lookup field ?
- janareddy
- September 03, 2014
- Like
- 0
- Continue reading or reply
How do I get a field to populate with text based on the value of another field?
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:
- Dea Simon
- September 02, 2014
- Like
- 0
- Continue reading or reply
How to display the detail page after clicking on save in Visualforce?
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
- SFDC coder
- September 02, 2014
- Like
- 0
- Continue reading or reply
Inline Editing for Lookup on VF page
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.
- Madhura B
- April 09, 2013
- Like
- 0
- Continue reading or reply
Radio button in data table select only one
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>
- Madhura B
- March 13, 2013
- Like
- 0
- Continue reading or reply
Unable to sort picklist values alphabetically
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.
|
Any ideas?
- Madhura B
- January 22, 2013
- Like
- 0
- Continue reading or reply
Inline Visualforce Style
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>
- Madhura B
- November 08, 2012
- Like
- 0
- Continue reading or reply
Inline Visualforce
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
- Madhura B
- October 02, 2012
- Like
- 0
- Continue reading or reply
IF and INCLUDES function on a Multi-Picklist field
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
- Del_Santos
- July 12, 2011
- Like
- 0
- Continue reading or reply
Can we Export Excel sheet with more then one tab by VF page.or CRM???????????
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 !!!!!!!
- Ajay111
- October 27, 2009
- Like
- 0
- Continue reading or reply