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
kim_lebiczkim_lebicz 

Pushing the value of a formula field into a new record with a custom button.

I have created a custom button on the case object that creates child case of a different record type. The content source is URL. When the button is pushed it pushes various field values into the new case. Everything works perfectly except for one field. My question is, is it possible to push the value of a formula field over using this method.
 
Thanks in advance
Kim
werewolfwerewolf
What do you mean, push the value of a formula field?  If you mean, can you get the value of a formula field and push it into a editable field, the answer is yes.  If you mean literally push a value into the formula field, the answer is no – a formula field can only be calculated by the system, it can't be edited.
werewolfwerewolf
But if you want the child formula field to match the value of the parent formula field, you'll have to be sure that all the formula field's inputs on the 2 cases are the same.
kim_lebiczkim_lebicz

Thanks for the response. Let me see if I can be clearer. When a user clicks the custom button a child case is created with a number of fields populated with data from the parent case using a URL such as the following.

/500/e?retURL=%2F500%2Fo&RecordType=012300000001JJW&cancelURL=%2F500%2Fo&ent=Case&cas4={!Case.Account}&00N30000000mxtB={!Case.Severity__c}&cas8={!Case.Priority}&00N30000000zefu={!Case.Service_Level__c}&00N30000001EfOD={!Case.Glasshouse_Technician__c}&00N30000000mxtf={!Case.Preferred_Contact_Method__c}&cas3={!Case.Contact}&00N30000001XiUt={!Case.Other_Phone__c}&cas11={!Case.Origin}&00N30000000nDbJ={!Case.Software_Version__c}
&save=1

All of the fields are brought over to the child case with no problem except for one, which happens to be a formula field. So I was questioning whether maybe, because it is a formula field, it can not be done. I am trying to bring the value from the formula field over to the child case in a text field. I apologize if I am not being clear. Thanks for trying though.

 

 



Message Edited by kim_lebicz on 08-05-2008 11:28 AM
werewolfwerewolf
Ah.  May I suggest that, if you're in Enterprise Edition or above, rather than redirecting to a page that defaults all these things and saves the case, instead you create the case via the API using the AJAX toolkit?  It will be much easier and much less likely to break.

The code would be quite similar to this blog entry:

http://blogs.salesforce.com/support/2008/07/the-quick-case.html

Except that, rather than closing an existing case, you fill in the fields for a new one, don't set the case ID (because it's a new case), and call insert instead of update.
kim_lebiczkim_lebicz
I will look into that. Thanks for your help.