Hello Community,
I want to calculate the difference between two dates through domain ( Entity ) Formula=« true » field but still not able to generate it.
I have calculated difference in the form view through CDATA ,
Here is the code.
First and foremost, regarding the domain attribute formula , it appears there was a misunderstanding. The attribute formula is actually a boolean attribute that specifies whether the field’s value should be treated as an SQL formula or not. You can find more information about it in the documentation here: link to documentation.
However, the requirement you mentioned can still be achieved using a domain field of type string.
Currently, the field is being managed from the view, but you can define it as a string field in the domain as follows:
<string name="totalExperience" title="Total Experience">
<![CDATA[
// Write your Java code here to process the value and return it
return "";
]]>
</string>
By doing this, the value will be auto processed when the record is saved.
If you have any further questions or need additional clarification, please let me know. Thank you.