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
NiklasTNiklasT 

Custom button - passing values goes wrong

Hi,

 

I'm tearing my hair off with this:

 

I want to create a custom button in the "Related Task List" on the Account Page. When you click it should open a new task with set "Subject", "Date" and "Related Account (the referring").

 

I've tried two solutions and none of them works.

 

1. URLFOR()-function - TODAY() doesn't function

 

{!URLFOR( $Action.Task.NewTask , null, [what_id=Account.Id, retURL=URLFOR( $Action.Account.View, Account.Id), tsk5="MyText", tsk4=TODAY()+90])}

 

This works good, except for the TODAY()-function which seems to be screwed up when used in the URLFOR()-function. It generates: "Sun Nov 27 00:00:00 GMT 2011" when it's supposed to generate only a date.

 

2. Hardcoded URL - Account.ID doesn't function

/e?what_id={!Account.Id}.....

 

The use of Account.Id returns a three digit ID, and not the 15-18 digit I'm hoping for.

 

--

 

This is highly annoying, and I've tried so many set-ups that I'm actually starting to consider I've found two bugs here - but I'd be glad if you could help me get back to reality and help me solve this.

 

Thanks!

Ankit AroraAnkit Arora

For your first problem you need to format a date like this :

 

{!URLFOR( $Action.Task.NewTask , null, [what_id=Account.Id, retURL=URLFOR( $Action.Account.View, Account.Id), tsk5="MyText", tsk4= TEXT(MONTH(TODAY())) + '/' + TEXT(DAY(TODAY())) + '/'  + TEXT(YEAR(TODAY()) )])}

And am unable to understand your second problem, as "what_id=Account.Id" is returning me a proper account Id and am getting Related To account pre-filled properly.

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

NiklasTNiklasT

Thanks! Your solution works when i modify the date format to my country zone.

 

--

 

On the other solution the same setup returns not the correct Account.ID, but a three digit. Worth mentioning is that I did create a custom account field that was named ID - I'm guessing that might screwed things up.

NiklasTNiklasT

This actually brings to me another problem!

 

{!URLFOR( $Action.Task.NewTask , null, [what_id=Account.Id, save=1, retURL=URLFOR( $Action.Account.View, Account.Id), tsk5="MyText", tsk4= TEXT(YEAR(TODAY()+90)) + '-' + TEXT(MONTH(TODAY()+90)) + '-'  + TEXT(DAY(TODAY()+90) )])}

When I add "save=1" the page says: "Error: Invalid Data. The page you submitted was invalid for your session. Please click Save again to confirm your change. ". If I remove "save=1" and just click save it works perfectly.

 

What might be wrong?