+ Start a Discussion
EyalEyal 

Custom Buttons - HELP !

Hello

 

I'm a very new in all the salesforce business

i'm trying to make a new button in the account that will open me a new task with some data in the fields

 

 

Someone can help me ?

 

Thanks

Elad

 

 

AkaedingAkaeding

Hey Elad,

 

I just went through a very similar little excersize last week.

 

My first suggestion would be to google "salesforce custom buttons" and do a little reading.

 

Most likely your button is going to involves the creation of a little javascript...I was able to find an button that did something sort of similar to the one I needed to create, and tweak that code.  I am no coding wizard by any means...

 

Plus, you came to the right place, in my experience, people are pretty helpful around here, and most of them know WAY more than I do...so hang tight!

 

Perhaps if you put a little bit more detail into your request for help, someone might be able to get you a little further down the road...i.e. - What data do you need loaded into which fields?  My button might ba able to be tweaked even!

MigMig

That's called a dynamic URL button : have a search about this. you can have some examples ...

 

In short : something like this 

 

 

00T/e?what_id={Account.Id}&fieldId={Object.field}&fieldId={Object.field}&retURL={Account.Id}

 

 00T/e -> Task edit page
the field Id -> you need to get it somewhere ( by using Firebug per exemple )

 And then the Value you want to fill in...

 

 

EyalEyal

Hey

 

First of all thank for all the answers,

 

I successed to open a new task by button but now i want that the name of the account

will apper in the new task window - someone know how to do it ?

 

by the way this is line i wrote :

 

{! urlFor(  $Action.Task.NewTask )}

 

Thanks

zen_njzen_nj
Just a quick question - why aren't you just using the Open Activities related list section and click on the New Task  button to create a new task? This would have automatically populate the task with the Account Name.
AkaedingAkaeding

Well, specifically we are talking about Cases not tasks within cases.

 

We are still looking at how we handle Activities or Tasks withing those case records.

zen_njzen_nj

I see. We had similar requirements where we wanted to click on a button from the Account page to create a Case (of specific case record type, and pre-populated with certain values from Account field).
So we did it using URL as followed:

 

 

/500/e?retURL=%2F500%2Fo&RecordType=0120000000002H7&cancelURL=%2F500%2Fo&ent=Case&cas4={!Account.Name}&CF00N00000006qTDJ={!Account.Name}&00N00000006qTDe={!Account.Softrax_Cust_No__c}

 

Note cas4 corresponds to the Account Name field in our Case page layout and  the other values (CF00N00000006qTDJ and 00N00000006qTDe) corresponds to the IDs of the specific fields in our Case that we wanted to extract values from the Account page into.  You can find out what are the appropriate IDs corresponding to each field in your Case page layout by either downloading the web developer tool or just click on the Page Source option of your browser (when you are editing your case) and then search for the Case field name in it and then search for the <input> tag there and then copy the text after name=

 

LStraubLStraub
where do i find this "web developer tool" you reference for finding field ids?
zen_njzen_nj

We use firefox as our browser. So you can download this add-on via this link:

 

https://addons.mozilla.org/en-US/firefox/addon/60

 

 

Note you can also just view the page source of the salesforce page directly and search for the name/id. See previous message.