Whats is alternative of sugar_rename in Sugar on Demand ?

Hello,
We are using sugar_rename function in sugar crm package to make a copy of custom file via pre_execute. But in sugar cloud this function is restricted. We need an alternative of sugar_rename for sugar cloud. We know about duplicate_file. duplicate_file is for uploaded file. But we need to make copy of custom file in our package. Please give us any solution.
Thanks!

Parents
  • Can you elaborate on what it is you are attempting to accomplish with the package you are using and the customization it is intended to install?

    I am not clear on what type of customization would require you to programmatically make copies of a given file. 

  • We have created one installable zip package for sugarcrm. In pre_execute function we have below code.

    if(file_exists('custom/modules/EmailTemplates/DetailView.php')) {
    $new_file = 'custom/modules/EmailTemplates/DetailView'.$now.'.php';
    sugar_rename('custom/modules/EmailTemplates/DetailView.php',$new_file);
    }

    This will take backup of existing file(custom/modules/EmailTemplates/DetailView.php). But on cloud platform, sugar_rename did not work. So we need any alternative for sugar_rename function for sugar cloud.

Reply
  • We have created one installable zip package for sugarcrm. In pre_execute function we have below code.

    if(file_exists('custom/modules/EmailTemplates/DetailView.php')) {
    $new_file = 'custom/modules/EmailTemplates/DetailView'.$now.'.php';
    sugar_rename('custom/modules/EmailTemplates/DetailView.php',$new_file);
    }

    This will take backup of existing file(custom/modules/EmailTemplates/DetailView.php). But on cloud platform, sugar_rename did not work. So we need any alternative for sugar_rename function for sugar cloud.

Children