When you create or alter a function replication definition, Replication Server automatically creates or alters the corresponding user-defined function. You must, however, create a function string for the user-defined function if you are not using a class that inherits function strings from rs_default_function_class, either directly or indirectly.
See Replication Server Administration Guide Volume 2 > Customize Database Operations > Work with Functions, Function Strings, and Classes > Functions > User-defined Functions.
Create a function string for a user-defined function in the function-string class assigned to the destination database for the replicated function. Use create function string at the primary Replication Server to create a function string for a user-defined function.
See Replication Server Administration Guide Volume 2 > Customize Database Operations > Manage Function Strings > Function Strings and Function-string Classes.
When you drop a function replication definition, Replication Server always drops the user-defined function and function strings.
You can customize function strings in function-string classes that allow it. In a typical application, the replicated user-defined function passes stored procedure parameter values to the destination Replication Server, and the function string executes the stored procedure with these values in the destination database.
To change the default function string to perform some other action, such as inserting data into an audit log, use the alter function string command at the primary Replication Server for the replicated function. The function-string class assigned to the destination database for the replicated function must allow you to customize function strings.
See Replication Server Administration Guide Volume 2 > Customize Database Operations > for information on creating and altering function strings. See Replication Server Reference Manual > Replication Server Commands > create function string.