I've solved my problem myself, although it may not be the best solution.
In my ajax page (default.php inside tmpl), first create JoomSEF router object:
// create JRouterJoomsef object if JoomSEF is installed
if (class_exists('JRouterJoomsef')) {
$jRouterJoomsef = new JRouterJoomsef();
} else {
// no JoomSef installed
$jRouterJoomsef = null;
}
Then before you paste the link to HTML A tag,
$link = 'index.php?option=com_custominfo&view=record&id='.$record->id;
if (null != $jRouterJoomsef) {
// JoomSEF installed and published
$link = $jRouterJoomsef->build($link)->getPath();
}
If you installed and published the JoomSEF, the JRouterJoomsef object should be created. Then you can use its function build() to return JURI object, then use JURI's getPath() function to paste the sef'ed path.
Hope this help, thanks.
Best Regards,
Michael Wai