Can I create my own formula for calculated field in Sharepoint 2010 using C#

非 Y 不嫁゛ 提交于 2019-12-12 15:59:48

问题


I want to create a programmatically calculated field for Sharepoint 2010 using Visual Studio 2010 in C# language.

Is there a way to set a formula that will call to my own function and return a result back to the field?

My scenario:

  • let's say I want to create a field that always returned the sum between two other fields,
  • but I don't want to use something like "=sum([filed1],[field2])".
  • I want to call to function "calc2Fields()" and return a result.

Is it possible?


回答1:


No, it is not possible. By changing the formula you are not adding any internal logic, so the field will not know what to do with your function. You can however build a custom field and incorporate there any logic you need. Of course it is not going to be identical to the built-in calculate field, but then you can add your own functions.




回答2:


You will have to create your own custom field with this logic in.

Customizing the User Experience of SharePoint: Custom fields deep dive



来源:https://stackoverflow.com/questions/5067623/can-i-create-my-own-formula-for-calculated-field-in-sharepoint-2010-using-c-shar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!