Override API files

Hello all,

I want to override the method “createRecord” or “updateRecord” from the ModuleService.php (/Api/V8/Service/ModuleService.php). I know how to override modules and methods in the files, but what I don’t know is how to override files from the API. I don’t want too create my own endpoint, so this page (Customization :: SuiteCRM Documentation) will not help me.

I made my changes directly in the ModuleService.php (so my logic works), but the problem is that when I update my SuiteCRM version, this file will be overwritten.

Can anyone help me?