PDA

View Full Version : Events on deleting and copying nodes



Xarxus
July 23rd, 2023, 11:15
I have a strange behavior. I have a structure which contains some data. Some fields point to the elements of this structure. So far, so good.
The problem is that this structure is populated with data from another structure. To do this, since the two structures are identical, I use
DB.copyNode. But the original structure might not have a field, and it's fair that the target structure doesn't have one either.

The problem is that using DB.copyNode the absent field, if previously present, is not deleted, with the result that my field continues to
show a value that shouldn't be there.

I tried deleting (DB.deleteChild) the destination structure and recreating it with the DB.copyNode, but the data refresh doesn't
work for me. The fields in my form seem to sense the delete event (the data disappears), but not the copy event (on the DB all the data are
correct). Erasing and copying are sequential, one after the other.

How can I fix?

Trenloe
July 23rd, 2023, 16:28
I have a strange behavior. I have a structure which contains some data. Some fields point to the elements of this structure. So far, so good.
The problem is that this structure is populated with data from another structure. To do this, since the two structures are identical, I use
DB.copyNode. But the original structure might not have a field, and it's fair that the target structure doesn't have one either.

The problem is that using DB.copyNode the absent field, if previously present, is not deleted, with the result that my field continues to
show a value that shouldn't be there.
That's correct operation.


I tried deleting (DB.deleteChild) the destination structure and recreating it with the DB.copyNode, but the data refresh doesn't
work for me. The fields in my form seem to sense the delete event (the data disappears), but not the copy event (on the DB all the data are
correct). Erasing and copying are sequential, one after the other.

How can I fix?
Perform an update on your window. Most FG windows will have an update function that executes when the window is locked/unlocked, try running this code.