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

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
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.
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.

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.


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
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:

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.
I will look into that. Thanks for your help.