Error message at the creation

hi there, I’ve been working on Corteza for two weeks now, and suddenly I can’t create a record, it shows
Could not create record: check error messages on the form

what is the form it meant ?

and this is from server logs

19:35:45.676 DEBUG actionlog {“timestamp”: “19:35:45.676”, “requestOrigin”: “api/rest”, “requestID”: “7c8c602880a9/E4hn1tlSxh-001146”, “actorIPAddr”: “”, “actorID”: 269976792540905474, “resource”: “compose:record”, “action”: “create”, “severity”: 0, “error”: “invalid record value input”, “description”: “”, “policy-match”: true, “meta”: {}}

what is the policy-match here?

after many failed tries, I found the issue.

I made a calculated field(F2) that depends on another field(F1) in the same module.
the F1 is filled by a workflow on the BeforCreate trigger.
so the user doesn’t need to fill F1 (it will be filled by the workflow) but when creating the F2 finds F1 null and though the error.
what did I do to solve the issue? I made F2 as a not-calculated field, and create another workflow to fill it on the AfterCreate trigger.

hope this can help someone someday, but what I didn’t like so far about corteza is its error handling and how vague they are.

and btw, I tried using new.F1 in F2 expression but no luck

Hmm… I’ll sync internally to see if the order of what happens for record create/update is as it should be (so are computed fields evaluated before WFs or the other way around).

A few extra notes for you to consider in regards to your solution:

  • You might still be able to use a calculated field if you add some null exception handling.
    This is from the top of my head, but the following template should be about right: (value_here ?? false) ? do_the_calc : use_default_constant; so in case the value is not present you use some constant default value, else you calculate it.
  • You need to be careful when using before and after create/update triggers as you could cause execution cycles (see here).
    TL;DR: if you have a before update trigger for module A and your after create trigger for module A performs an update, the before update trigger will be executed again.
    We did add a failsafe to limit this recursion but you should still try to avoid it as much as possible.
    Instead of having two workflows for the two calculations consider doing both calculations in the same workflow (the before update one).
1 Like