This project has moved. For the latest updates, please go here.

Calculated Fields still an issue?

Jun 27, 2016 at 8:14 AM
I'm using SharePoint 2010 and have SPEasyForm 2015.01.02 loaded. Works great. But I'm not seeing calculated fields.

I have a calculated target date field. I see it in the Default Form. But I can't place it in any container and have it show up. I saw previous discussion on this but my understanding was that the latest updates were to take care of this. I believe I have the most recent version.

What am I missing? Did I set something up wrong?
Jun 29, 2016 at 12:03 AM
I'm not aware of still having an issue with calculated fields. Could it be a caching issue? If you've close and reopened the browser or hit the clear cache button on the settings page ribbon, and still have the issue, the it's not caching in which case I'll have to look into it.

Jun 29, 2016 at 11:51 AM
I have cleared cache and tried everything. It shows up in the WYSIWYG display on the right when I drag it to the Referral (tab) container. AND it continues to show up in the DefaultForm Container. But it doesn't show up on form in either place when I go to it in SharePoint. Both images are below. Any ideas what to try next?




This is the resulting form

Jul 4, 2016 at 7:22 PM
Normally, calculated columns only show up on the view form, not the new or edit forms. That has nothing to do with SPEasyForms, that's just the way SharePoint works. The form you show above is clearly either the New or Edit form, so SharePoint does not render the calculated field and therefore it's not there for SPEasyForms to move. SPEasyForms doesn't render any fields, it just manipulates the fields that SharePoint renders.

I've confirmed that SPEasyForms is currently working as expected with calculated fields. i.e. if they are rendered, SPEasyForms can move them to containers, apply conditional visibility rules to them, etc.

I have seen various blog posts over the years about how to get calculated fields to display in new and/or edit forms, but OOTB they don't display. They usually involve running some PowerShell to manipulate the field settings. If you did that, then SPEasyForms would work with the field just fine, but if SharePoint doesn't render it then there is nothing SPEasyForms can do with it.

Marked as answer by mcsheaj on 7/4/2016 at 12:22 PM
Jul 5, 2016 at 8:08 PM
That’s good information. I guess I hadn’t noticed this behavior before. All I’m trying to do is display a target date (calculated field) based on another date entered. And yes, this is on a New form as it is when the initial date is captured. I must be making this harder than it is.

I just tried it on a test list and my calculated field wasn't on the New form. Hum....never noticed that.

Any ideas or suggestions that anyone has would be most appreciated.

Jul 5, 2016 at 10:56 PM
I don't think what you want can be done without writing some custom JavaScript. There are numerous blog posts for different techniques to get calculated fields to appear on new/edit forms. They all involve some sort of PowerShell or JavaScript/CSOM code to change the properties of the field (things like setting DisplayInNewForm and DisplayInEditForm to true, I haven't actually tried any of them but that's the idea).

The problem is that you want something calculated fields weren't designed to do, if I understand correctly. You want the user to enter a date field on the New form and instantly see a calculated field on the new form that gets updated? I suspect the reason calculated fields don't appear on new/edit forms is because there's a pretty dumb control behind them, not dynamic at all. A calculated field in SharePoint doesn't actually get it's value until it's saved, and the calculation doesn't occur on the client side, it occurs on the back end.

To do what you want, you really need some custom JavaScript that listens for changes to the source date, calculates the target date, and shoves it into the target date field. The target field wouldn't be a calculated field as far as SharePoint is concerned, it could be a date field or even a text field, which you're JavaScript would also turn into a "read-only" field in a similar fashion to the conditional visibility code in SPEasyForms. Other than that, I really don't think there is a way to achieve what you want in a SharePoint form.

Jul 11, 2016 at 2:43 PM
Joe, that's good information. Guess I never knew that. I didn't think what I was asking for was all that unusual. I've not done any JavaScript like you described but there's no time like the present to start. In reading the past discussions I guess I didn't pick up on the fact that people were talking about the Calculated Fields not showing up on the View Form and not the New/Edit Form.

Thanks again. Great product.