This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, I am using Lightspeed Professional 5.0. and have transient fields to store custom values that I have stored in another non-transient XML data field. Then on the OnSaving I take the values from the transient fields and save the values in the XML data field. The problem is that I DO NEED the transient fields to update the EntityState of changed, or the OnSaving never fires. If I could figure out how to manually have the EntityState change, then I would be good. I would appreciate any help, suggestions or workarounds that you might have. Thank you. |
|
|
The only way to manually adjust this is via Reflection and we dont recommend this. Could you not unbind your data back into the XML structure as part of the property change as this would then leave the field modified and remove the need to do the work in OnSaving? If you do want to go down the reflection route instead here is what you will need to do:
|
|
|
The XML data field contains multiple values for multiple transient fields. Ex. xData xml datatype (string) property has 3 custom data fields (CustomUserName, CustomUserLogin, DtCustom). I populate 3 transient properties from the XML on the AfterLoad event. I bind these transient data fields along with regular data properties to fields on a screen. The OnPropertyChanged event does NOT fire on transient fields, so when any of these 3 custom data fields change. The OnPropertyChanged event does not fire. I tried to have the Xml repopulated on the OnSaving event, but if the EntityState is Default, it never fires as well. How do I know if any of the transient fields have been changed so I can update the XML data field, and have not have the OnSaving do any work? Any suggestions? I am sure other people are using XML data fields to store custom properties as well. Thank you. |
|
|
Yep sorry for any confusion with my earlier comment. My suggestion would be to implement a property which uses the transient field as backing storage and then implement logic in your property setter which handles the update of the persistant XML property on the entity. You would work the property from your calling code rather than the field which would then trigger the change to the XML inline with setting values and accordingly leave the entity in a modified state.
|
|