Hi i am new to visual force i wanted to learn how to reset the field in VisualForce Page
Set immediate="true" on the reset button
Related
I am using custom object for my visualforce. How can i create a "New" button on my VF page so that it redirect me to the page where i can create my new record for that object ?
You can use {!URLFOR($Action.Custom_Object__c.New)} to get the URL.
i have 1 custom object test_2__c and i created tab of it.
i have overridden this tab with a visual force page (tab redirect).
<apex:page action="{!URLFOR($Action.Test_2__c.List,$ObjectType.Test_2__c)}"/>
and i have 1 list button called "New". it is a button URL.
{!URLFOR($Action.Test_2__c.New)}?returnURL={/apex/tabredirect}
so when i click on this button from list view it opens an edit page for inserting a new record (The standard salesforce edit page, i didn't override it).
Now I am facing an issue here, when i click on "cancel" button from edit page, it remains on that page, i want to redirect it to list view which i have overridden with the visual force page.
Have you tried adding a cancelURL parameter to the URL? For example, you can send the user to a new visualforce page on cancel with the following parameter
...&cancelURL=/apex/YourApexPageNameHere
i am using one Vf page in opportunity page and and have one checkbox above the VF page as
Approverd ---------- checkbox
....................................................Visual force page..........................................
Data
.............................................................................................................................
what i did is when check box is uncheked the vf page or view that show above is hide on save button click that work perfectly.but the blank space is there in the place of VF page .
I hope you got what I mean.
You can create 2 different opportunity page layouts. The first layout with your checkbox the second with the visualforce page. You assign the 2 page layouts to different RecordTypes. Your checkbox can trigger a workflow that is changing the record type and the pagelayout.
The next option is to use javascript to hide the section, but this is not reliable.
I have done a VF page in this pages controller. I have written a query to get some record. If the condition is false then an error message is shown. If the error message is shown then I want to disable the working of the save button.
Is it possible to enable the working of save button, or disable a save button? In Apex code.
The disabled attribute of an <apex:commandbutton> can be set to enable/disable a button. Setting this attribute to a bound Apex variable would allow you to control whether or not the button is enabled in your Apex Controller or Extension.
Example Visualforce markup:
<apex:commandbutton action="{!save}" value="Save" id="theButton" disabled="{!myApexBooleanVariable}" />
Example Controller or Extension Apex code:
public Boolean myApexBooleanVariable {get;set;}
I'm trying to put a checkbox in a salesforce page but the problem is that the required message is more than 40 characters so it doesn't fit in the checkbox label (40 character max)
I tried adding two custom fields on top of the checkbox but the problem that these fields even though if they are read only the user can edit there content(text(255)) or not be able to see them(formula(text)) in edit mode.
Is there any way I can do that without creating a custom page and appending it in the page?
It isn't an ideal solution but you could create a new section on your page layout which will allow more text than a label to be displayed. Then only put your confirmation check box field in that section.
That will affectively give you the long label description you are looking for.
You can create a very simple Visualforce page:
<apex:page standardController="Account" showHeader="false" sidebar="false">
I confirm that the new account is open
</apex:page>
Set the controller to your object; I use "Account" here.
You then insert the Visualforce page directly into the page layout, just like you would a field.
It sounds like you need visualforce or S-Controls (now deprecated)
An alternate is to make a text box and prepopulate it with the info, but I think that too would need those technologies
If you come up with a solution to this- let me know.