What can be used instead of ECHO to display the execution result for a specific action ?

Hello,

we use to call the ECHO fonction to display the execution result of custom script (for instance, a specific action required to init some records with values required for a new feature.

So basically, we create a custom HOOK or JOB or code to handle the feature, but it requires to init the records. To do that, we create a custom action that must be run once (or maybe more for error management etc.). 

It is really important for that kind of script to follow the execution, understand what the script is doing etc. (same way that the module loader or quick repair are displaying a real time summary of the execution).

The problem is that echo canno't be use anymore for cloud instance (for most of the context).

Of course we can log this in Sugarcrm.log but it is less comfortable.

So is there a nice alternative to ECHO for cloud instance ?

Best regards,

Fred

Parents
  • Hi ,

    Have you tried using SugarAlerts?

    For example, I have a custom piece of code in Quotes that looks up tax in our ERP.

    The "process" Alert   is used to say "Looking up Tax in ERP..." just before the ERPGetTax API is called,

    app.alert.show('erp_tax', {
    
            level: 'process',
    
            title: 'Looking up Tax in ERP...'
    
          });

    then it  dismisses the alert when the API call comes back with results: 

     app.alert.dismiss('erp_tax');

    In your case, in your init, you could give a process alert before you start the execution (so if there are delays the user knows) then as soon as it's done you can dismiss the process alert and display an info or confirmation alert to show the results of the processing in the "message" part of the alert. autoClose: false will give the user a chance to read before they dismiss the alert.

    In another case, on a Custom Contracts module, I have "buttons" on my record view and when a given button is clicked an API is called to retrieve some standard language from another custom module, then append that data in a text field on the record. 

    But the latter only makes sense if you need to preserve the retrieved data in the record.

    FrancescaS

  • Hi ,

    in our case, it's more a script that load several beans, running several init / setup action so we were more looking to a basic way to echo feedback during the script, that could takes several minute (like a tail in linux).

    Fred

Reply Children
No Data