Hi There,
I have been building an auditing app in fieldmaps in which I have a layer for the site and a related table to undertake an audit on that site.
within the site layer I have built some calculations that work fine on existing sites however when I create a new site the fields return the error 'Failed to calculate' and won't let me submit.
I am assuming it is because there are not related records yet so it has nothing to calculate.
below is an example of one of the calculations to find the date of the last audit.
If there are zero records I think this line will fail
var feat = First(fs);
What I do is check for no records a little earlier than where you did.
Not proper syntax but like this - check the count on fs first.
if count(fs) == 0 then return '' if not then return var feat = First(fs);
I am not positive you can return '' to a date field though may need to use Null.
Hope that makes sense.