Showing posts with label Label. Show all posts
Showing posts with label Label. Show all posts

Thursday, February 23, 2017

Visualforce - Beyond Basics Series 49 - Mark a table column as Required

How to give help text for a Table ?

In visualforce, table can be generated using PageBlockSection, PageBlockTable, DataGrid tags. If one wants to provide help text for a column, they need to use apex:facet tag.

How it will be useful to indicate Required Field ?

In some cases, developer may want to indicate a column as Required. So, it's possible to provide that in the table column header


Where is the Code ?


Any Screenshots ?



Walk through in a video ?


Wednesday, February 22, 2017

Visualforce - Beyond Basics Series 48 - Required field Help Text

How to give more emphasis on Required fields in form ?

Prevention is better than Cure. Most of the time users forget to fill in required fields in the form & realize than while saving the record.


How to prevent that ?

Giving a highlighted Help text through each section of the forms would give more emphasis on required fields. By doing so, user will fill some values & will never have any issues while saving the record.

Where is the Code ?


Any Screenshots ?




Walk through in a video ?


Tuesday, January 24, 2017

Visualforce - Beyond Basics Series 41 - Dynamic Forms

Issue with Standard Forms in Salesforce ?

In Standard record Edit Page, there's no way we can hide/show a set of Fields for Users to Fill In. This is the big issue when you have hundreds of fields that gets presented to the User.

How to solve with visualforce Page ?

In visualforce page, this problem can be solved by showing/hiding different sections based on the 'certain value' in Fields (or) certain User Action.

Where is the Code ?


Any Screenshots ?



Walk through in a video ?


Sunday, January 15, 2017

Visualforce - Beyond Basics Series 40 - Static Resource is not the only one

Where do you normally store resources in Salesforce ?

As a developer, we know that most of the resources for projects like images(icons, labels, loaders), javascript, css files is Static Resource. But, there are few different areas in salesforce we could leverage.


What are the specific purposes for different areas ?

These are the different areas where you could store resource & use them in your visualforce page.

Static Resource

Like the name suggests, one should store the resources that is a static one which doesn't change over the course of time. So, all images, css/js files which has a very stable version should be stored in it.


Tips :


  1. One tip is that Org should maintain a proper repository for their static resources & avoid duplicates among the resources. For example, i have seen jquery, loader images all over the static resource packages. This is very ineffective management for the storage space allocated for static resource.
  2. Another tip is to not create package per projects. This will lead to contain duplicate resources. Rather than, better maintain static resource per resource like JS, CSS, LOGOS, LOADERS, etc.


Notes & Attachments

If the resource like Text Documents (rtf, msdoc, csv, pdf, css, js, etc), Images (jpeg, png, gif), videos (flv, avi, mp4, etc) are attached to any Standard/Custom objects like Account, Contact, etc, we could leverage that & use those in Visualforce Pages.


Example :


For example, recently, i have built a visualforce page that displays the product image for an account. I could have uploaded them in static resource. But, its specific to the Account, so i have added them to Notes and Attachments & used them in visualforce.


Documents

This is the storage area one should use when the resource is not associated to any Object. If it's a single file that is slightly large one, could easily fit in this area. One more advantage is that not only developers, admins can also share this space.


Chatter Files

This is the storage area shared between chatter users, admin & developers. But, one should use this space only if the visualforce page is related to chatter functionality. Otherwise, there's no guarentee that this resource will exisit, as any chatter/admin could modify/delete this resource.

Hosted External

This is the technique of storing the resources outside Salesforce. This is also a efficient method, as there are so many reliable systems out there today for each resources.
         Javascript  - Google hosted resources, JQuery, Angular, etc
         Images      - Github, Flickr, etc
         CSS          - Google hosted resources, Bootstrap, W3.CSS, etc
         doc           - Google docs, etc

Where is the Code ?

For illustration, i have shown the images from 'Static Resource', 'Notes and attachments' & Documents.


Any Screenshots ?


Walk through in a video ?


Monday, January 2, 2017

Visualforce - Beyond Basics Series 39 - Modern Upload Button

How to upload an attachment to record ?

Using apex:inputFile tag, we can upload a file & store that as the attachment to the record. The master record id should be assigned to parentId for the Attachment.


What is the traditional way ?

Traditionally, developers use the same styling of inputFile as it is. That means there will be an upload button for user to select the file & there has to be a commandButton/commandLink to call the action function.


How to transform that to modern look ?

But, in a modern Upload button solution, a Upload label will be styled as a Button. Then, the inputFile tag will be inside the label & hidden from user. So, user will see only Label(Button), not the acutal inputFile.

Where is the Code ?

Here's the code that illustrates the traditional method & more modern method to upload the file.

Any Screenshots ?



Walk through in a video ?


Tuesday, December 20, 2016

Visualforce - Beyond Basics Series 31 - Use Custom Labels for Global reach

How is the language support from salesforce ?

Salesforce support following three model of language support,

  1.   Platform only support - It translates everything in the platform to your own language.
  2.   Setup Object support - It translates the setup related Object names & labels & instructions to your own language.
  3.   End User support - It translates only the End user view to your their own language.
One's language is determined by the Language setting in 'Language & Time Zone' under your profile


What is Custom Label ?

The translation bench is a place where you give a map of label with different values in different languages. Its nice simple concept. But, it's very powerful. It works well with even managed packages. It gives power to Admin to edit them when they want to.

How it works ?

In visualforce, instead of hard coding labels,  it best advised to get the label value from Custom Labels. So that, it gets translated automatically if its configured in Custom Labels.


Where it will be useful ?

It will be useful in following scenarios

  1.  your Org users are geologically segregated across globe
  2.  when your end user is not proficient with English & want to give their native support.
  3.  when you develop an App for international market
  4.  It's not designed only for supporting languages other than English. Even, you can have a translation for English, by which you give power to Admin to change them later if they wish to. I normally use this in all my projects.


Where is the Code ?

I have illustrated with the example of how to display the label name in native language(Hindi).