I tried to create triger in geopackage so one layer would get updated by data from the other, both in the same geopackage. It worked perfectly within deskop Qgis but I get this error message in Qfield:

Qfield error

Trigger i added to layer 1:

CREATE TRIGGER "insert_trigger" AFTER       
ON "layer1" 
UPDATE "layer1" SET "grid" = (select "col1"     
from  "layer2" where
st_intersects(new."geom","geom")) WHERE
new."fid" == "fid"; 

I used qfield sync plugin to package project using "copy" layer configuration. When using "offline editing" configuration i get no errors, fields are updated on sync as expected.

Trigger should be ok since it works in desktop. Geopackage is "mini database" with triggers in it by default that do work in qfield so trigger support shouldnt be a problem. What else could be wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.