I was aware of everything you said, so I created sample project from scratch and it worked! I compared it to the project where it doesn't work and found out that roAfterUpdate has no effect if DMLRefresh is set to true. Help has a note saying that RefreshOptions
should be set to false when DMLRefresh is set to true to avoid rereading fields from server. It doesn't say anythig about RefreshOptions beeing disabled when DMLRefresh is set to true.
I consider it a bug because DMLRefresh is needed for getting field values set by trigger and RefreshOptions is needed for getting field values from joined tables.
Example
Tables
Code: Select all
CREATE TABLE PARENTS
(
ID INTEGER NOT NULL,
NAME VARCHAR(30)
);
CREATE TABLE CHILDREN
(
ID INTEGER NOT NULL, // field value is set by trigger
PARENTID INTEGER,
NAME VARCHAR(30)
);
Query.SQL
Code: Select all
SELECT c.ID, c.NAME, c.PARENTID, p.NAME
FROM CHILDREN c
JOIN PARENTS p ON p.ID = c.PARENTID
Query.SQLRefresh
Code: Select all
SELECT c.ID, c.NAME, c.PARENTID, p.NAME
FROM CHILDREN c
JOIN PARENTS p ON p.ID = c.PARENTID
WHERE c.ID = :ID
After insert in table CHILDREN, DMLRefresh (if set to true) is used to get ID.
After edit (and insert too) RefreshRecord (if roAfterUpdate and roAfterInsert are set to true) is used to get p.NAME.
But, they don't work together.