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
AgiAgi 

save=1 in custom button

Hi Team,

can you please help me,
i receive an error message :
Error: Invalid Data.
Review all error messages below to correct your data.
The page you submitted was invalid for your session. Please click Save again to confirm your change.
 
for my custom button:
/00T/e?who_id={!User.Id}&retURL=%2FContact.Id&RecordType=xxxxxxxxxxxxxxx&ent=Task&tsk5=Validate Contact&tsk4={!DATE( YEAR(TODAY()),month( TODAY()),DAY(TODAY()+7))}&tsk2_lkid={!Contact.Id}&tsk2={!Contact.Name}&save=1&retURL={!Contact.Id}


the task should be saved with the prepopulated fields once clicked on the button,  but i've seen in several posts that save=1 stopped working.
Can any body please advise how to put the above into Javascript / onclick JavaScript custom button?

thanks in advance,
agi
Bryn JonesBryn Jones
It is because you haven't got all the feilds filled out automatically. Your date thing needs to be just TODAY()+7. you also have 2 retURL's. delete the one at the beginning. 

WHat is the RecordTYpe  and ent=task for?


Bryn
agnes.winkler1.3890006458926333E12agnes.winkler1.3890006458926333E12
Thank you Bryn,

yes you are right, it works with tsk4={!(TODAY()+7)}

without save=1 i have no issues, and also with save=1 when i click on the button, after i dont need to fill any other fields just click on the save.

recordtype is to skip record type selection, ent=task.. i dont know, i have seen it in some sample codes but after i deleted nothing changed :)
so my code is currently
/00T/e?who_id={!User.Id}&Contact.Id&RecordType=012i00000011Hmv&tsk5=Validate Contact&
tsk4={!(TODAY()+7)}&tsk2_lkid={!Contact.Id}&tsk2={!Contact.Name}&save=1&retURL={!Contact.Id}
but i am still not able to save it automatically.

in some examples i've seen the javascript starts with
{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}

but i dont know how to continue and put the above url into javascript.

any advise is very much appreciated :)
Bryn JonesBryn Jones
Agnes,

What fields do you have as required, i think this is what may be holding you up.

There is away to find out the tsk#'s to fill in feilds but i dont want to waste your time over it right now, we can use it as next step if you have other fields mandatory.


Bryn
Bryn JonesBryn Jones
Agnes,

What feilds are mandatory or required on the page. Could you attach a screen shot of the page....

Bryn
Bryn JonesBryn Jones
What feilds are mandatory?

Are you the same person as Agnes.winkler on this ??

Bryn
AgiAgi
Bryn,


I really apreciate your help on this, but as i didn't have time to look at it, i was not able to respond.

there are no more mandatory fields,

User-added image

Agnes
Bryn JonesBryn Jones
Ok,

Sorry for the late reply....

Is Test user 1 a valid Assigned To value?
Is Validate Contact a valid Subject?

Is there more to the page than in the picture?

If you click save manually does it work?

Bryn


AgiAgi
Hi,

user / subject are valid, and when i click save manually  it works.


thanks
Bryn JonesBryn Jones
In my research i have found that this coding is obselete and save=1 has stopped.

Hopefully you can make it work by having it filled out with the address and click save manually.

Bryn