+ Start a Discussion
bikla78bikla78 

Calendar Custom Links

I have created some custom links on the homepage so that the users can hyperlink to a certain user's calendar for the current month. Each month, I have to manually update the links . I do this on the last Friday of each month to show the next month. I basically go in and change the link. Is there a way I can automate this in APEX so it looks at the system date and the link date?

 

 for example:

 

https://na4.salesforce.com/00U/c?cType=1&cal_lkid=00530000000d0Uz&md0=2009&md1=3

 

https://na4.salesforce.com/00U/c?cType=1&cal_lkid=00530000000d0Uz&md0=2009&md1=4

mtbclimbermtbclimber

Well, technically yes, you can create a solution around this that keeps you from having to update it as frequently as you are today. It would involve creating a custom link that points to a visualforce page that does a redirect to the same generated URL but as it would be aware of the current date it could adjust automatically.

 

That being said (more for later consumption by others) this implementation and the one I describe above is not supported. It falls under the category of "observed" but unsupported behavior.  We can and probably will change our URL parameters in the future.

 

As long as you are not a partner (who can't "fix" this easily if/when it breaks) and are OK with the caveat that this can break at any time and if it does you'll have to fix it (which you probably are since you are already fixing this every month anyway) then proceed..... with caution :)

bikla78bikla78

I can see how I can do this with a vf page but if I pass test coverage, why would it break? The whole benefit from developing applications  the force.com cloud is that we can write code without worrying about building the infrastructure ourselves...

 

 

I was wondering if anyone had a quicker idea since I would have to recreate the page and write the controller from scratch.

 

thanks

mtbclimbermtbclimber

Certainly if you rebuild the page completely in Visualforce then nothing will break when we release and if it does salesforce is obligated to fix it ASAP. I was not, however, suggesting  that you rebuild the entire page with Visualforce when I said "It would involve creating a custom link that points to a visualforce page that does a redirect to the same generated URL but as it would be aware of the current date it could adjust automatically." The suggestion was to use Visualforce to build the link and redirect, effectively, not to build the page.

 

Let me try to be more clear about breaking. There is no guarantee anywhere that the "md1" parameter will exist and or do what you observe it to do today or for that matter any of the parameters in the URL you are constructing:

 

https://na4.salesforce.com/00U/c?cType=1&cal_lkid=00530000000d0Uz&md0=2009&md1=3

 

Nothing is stopping you from programming against them, I just wanted you to be aware of your dependency on something that is not guaranteed like Visualforce, Apex, the API, etc from being unaffected by salesforce releases. 

 

If you go down this path, salesforce is obligated to make sure the output of your Visualforce/Apex is unaffected but not obligated to assure the behavior of the standard UI will be unaffected when interpretting that output following any given salesforce release.

 

bikla78bikla78
Thanks Andrew. I appreciate your input