Add a label custom field in Salesforce Page - salesforce

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.

Related

Salesforce Custom field in Edit Page ONLY

I wanted to display a custom field as Read-Only on the Edit page ONLY of a custom object. This field should be hidden on the detail page. I tried wrapping the field in a section and display the section in Edit Page only(Page layout editor). That didn't work. I don't want to create a custom visual force page for the EDIT Page. Please suggest.
Thanks
Kumar
Unfortunately, there's no way to put a field on just edit or just detail. It's both or neither.
You have two options, custom Visualforce page as an Edit override is the easiest one, but if you want to leave the page layout editor as something useful to admins, there's also a very hacky option...
Create two record types, one that displays the field and one that doesn't. Create a new button that launches a Flow (with a return URL of the edit page for that object). The Flow should change the object's recordtype to the one that displays the field. Additionally, create a Process or trigger that changes the recordtype back to the one that does not display the trigger after you save the object.
I definitely recommend the VF page...

Creat dynamic Form in visualforce

I came lately with an important issue and I do not know which solutions are aviable to me for solving it.
Indeed I need to creat dynamic form, let me explain it:
I have a form for an object where user can fill in mandatory fields of this object and when he save this object the other fields are fill in with default values. My issue is that i want the user to be able to chose the fields that he will fill in.
So I imagine like to put a multiselection picklist where all the object's fields are aviable and the user can chose the one that he wanna fill. Bellow I would put an 'Add' button and after my click I would like my form to be update with the new fields that my user selected. The thing is that i do not know weather I can do such dynamic form in visualforce. Did you ever had to creat this kind of stuff? If yes which tools did you use?
Thank you everyone for reading
Yes you definitely can create such form with visualforce and it shouldn't be hard.
You can make a use of rendered property for a fixed number of fields or use apex:repeat tag for dynamically growing list. For example
<apex:repeat value="{!fields}" var="f">
<apex:inputField value="{!sObject[f]}" />
</apex:repeat>
Where in controller fields is a List of strings containing field names.

May I customize 'edit custom object records' page layout on SalesForce?

For example, to create or edit an object, when I want to add or change some value to one specific field, I need to refer another website to retrieve some info.In this way, may I add one button or link on the edit page?
The help link of SalesForce is here: https://help.salesforce.com/apex/htviewhelpdoc?id=co_edit.htm&language=en_US
Thanks.
Custom buttons and links don't display on new/edit page layouts so even if you'd make one, it will be visible only on detail view.
Not too invasive option would be to create a URL or text fied, set it's default value to your link, make sure it's displayed on the page but readonly. Haven't tried it but should work (you'll have to test it as somebody other than System Administrator because you'll bypass the readonly property of the page layout).
More invasive option would be to override the new and edit page layouts with Visualforce. More work but somewhat clean solution.
Really crazy option would be to embed a piece of Javascript into section header on the standard page layout or even into sidebar. It's an ugly hack but it works, I've used it for example to disable editing of Name field.
To use method #3:
create new section header, add something to the section (blank space is fine, you need something otherwise headers for blank sections aren't rendered), mark the section as visible on edit pages only.
Section name has limit of 80 characters but can contain code like <script>document.getElementById('Name').disabled = true;</script>. You need longer script though to somehow create an URL at runtime and append it somewhere on the page near your "special" field.
Upload a static resource with your script, then use this as the section header: <script src="filename.js" type="text/javascript"></script>
I'm not too proud of this hack and if you can - go with custom Visualforce new & edit page. It's quick & dirty, probably should be used only when you're not allowed to override pages.. but it works.

Visualforce Custom lookup visualforce page

I was wondering if there is a way to override the native functionality of the lookup field in Salesforce and replace it with a visualforce page. The reason I'm trying to override this button is because when the user does a look up, the look up returns everybody with that name. What we want to return is a list of all the contacts by account for the contact being searched.
Here's what I'm trying to achieve:
When the user clicks the lookup button my visualforce page will launch and allow the user to see the account and all the contacts of that account.
Is this even possible? What other ways would you suggest going about this?
Here's a screen shot of what I'm trying to change:
Thanks for all your help!
It sounds really like you just need to customise the columns on the lookup to make it better suited to your needs. If you go to Setup -> Customize -> Contacts -> Search Layouts, you'll see entries for Lookup Dialogs and Lookup Phone Dialogs, there you can edit the columns displayed in the lookup windows.
If you really need a custom solution:
You can't override the lookup page itself, but you could create a new visualforce page for your account, using <apex:detail> and other similar tags to make your life simpler. Then you could include a search section underneath, where a user can enter various search terms which you put into a dynamic SOQL query and then render the results for them to choose from.
yeah its possible by javascript as i did by visual force page that will show the records of related lists and upon selection id of that record passed to parent window by jscipt. and performed same functionality ..
As far as I know - NO.
As a workaround you can use JavaScript.
What we did in our situation? We implement everything in JavaScript. We created an inputText and right on the right of this inputText we placed image with this lookup icon. On image click we create ExtJS popup window (I think you can simply create VF page and show this page in popup window). After window was closed you fill in the inputText field.
There's no out-of-the-box override for this button, last I checked, so something custom would be required. If you're set on having a popup and do not want an inline solution, I'd recommend reviewing this tutorial to get familiar with some of the issues with popups in Visualforce.
But considering what you are looking to accomplish, you could also have your account and filtered list of all contacts associated with that account appear inline on your page when the user clicks a new, custom search button. Of course that page would itself be in Visualforce (or inline Visualforce in a standard page layout) - which you may or may not want to have to code and maintain.
The AJAX Toolkit might also be a good place to start if you want to go with a custom JavaScript button placed on a standard page layout.

How to get a field from account object to be loaded in VF page on selection of account in salesforce

In my VF page i have option of selecting an account, i need to auto populate a label in VisualForce page with a custom field from the selected account.
How can this be done?
Thanks
Prady
the inputField and outputFIeld tags will display the label as well as the appropriate input box/data if used within a pageBlockSectionItem tag.
It might also just do it normally when used, but I know for certain it does within the pageBlockSectionItem tag.
Hope this helps!

Resources