Where have you set this callback? The only callback supported by default is for value matching, so it's only used when saving the value. It does actually take the value as the second argument by reference, so it can be modified at that time.
thank you @Mike. I thought I could use the callback to process the field value every time the resource is viewed, not only during value matching. I have to save an array of IDs (22364,638482,79792) and fetch information from an external database according to these IDs when viewing a single resource. But then I cannot use RM for this purpose.
Your best bet may be to use the class extension system to extend XenResource_Model_Resource::prepareResource to "prepare" this custom field before display, and then you can use the prepared version in the template.