function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Marcus GranathMarcus Granath 

Display weeknumber in Date & Date/Time fields?

Hi! 
I'm looking for a way to display each row in the calendar with its corresponding weeknumber.

Is it possible to customize the calendar widget that appears when you are about to enter your input? Or any other way to approach this?
Rehes RarbaRehes Rarba

Hey Marcus!

 

Absolutely, you can spice up your calendar with week numbers. Unfortunately, Salesforce's standard calendar widget doesn't have a built-in option for this, but fear not, we can still rock this!

 

What you can do is create a custom formula field to extract the week number from your Date/Date Time field. Here's a quick recipe:

 

Create a Formula Field:

Go to your object's setup, find the Fields & Relationships section, and add a new Formula field. Choose the type that fits your date field.

 

Write the Formula:

Use the WEEKNUM function to get the week number. It's something like:

 
WEEKDAY(Date_Field__c)
 

Make sure to replace Date_Field__c with the actual API name of your date field.

 

Sprinkle it on the Page Layout:

Once your formula field is ready, edit your page layout. Drag your shiny new field onto your page, and voila! The week numbers will be right there, cozying up with your dates.

 

Filters and Sorting:

You can also use this new field for filters and sorting. If you want to see what's cooking in week 42, just set up your views accordingly.

 

Give it a try , and your calendar will be sporting week numbers in no time because this is what me and my team at triotech systems do. If you hit any bumps on the trail, I'm right here to help you untangle them.

Marcus GranathMarcus Granath
Thank you for the reply Rehes
The reason this is needed is because if you want to change a record from week 3 to week 16 you have no idea which date interval week 16 is in. A formula field which you suggested will only mirror the field's week for that record. What I am asking for is a way before providing the input OR changing input the ability to find the proper week so you can chose a correct date-interval without having to look this up on a third-party site.