Convert FindChild object to NameMapping object
- 6 years ago
You can't, not in code. NameMapping is an object repository configured and created in design time to identifiy components. Once it's been mapped, the objects then can be refernenced in code using Aliases.
FindChild and find methods are dynamic runtime methods for finding and identifying objects. You cannot convert that into the NameMapping because the NameMapping is not written to at runtime but only read from.
What I would do is that, once you've found the object, persist it in a variable that is globally available. However, if the object is destroyed in memory and recreated, anything stored in that variable will no longer be available. So, you would need to find it again. If it's such a dynamic object, that will probably be your best bet.