Giter Site home page Giter Site logo

sugaradvancedworkflowcustomphpmethods's Introduction

SugarAdvancedWorkflowCustomPHPMethods

SugarCRM's Advanced Workflow custom PHP actions

Technical Description

The purpose of this customisation is to be able to trigger complex PHP actions leveraging Advanced Workflows. The customisation is built in a way that can be module specific (ie: for Contacts are available 3 PHP methods, for Accounts 7). The coded PHP methods can be configured from the UI, so that the Sugar Administrator can choose what methods to call based on the need.

The suggestion is to leverage further custom job queues for PHP intensive methods, and send jobs to the background by using timers wherever possible. With the implemented functionality it is possible to find out the originating user of the call, so that it is a possibility to act on behalf of that user if required.

Requirements

  • Tested on Sugar Enterprise 7.8.2.0
  • Tested on Linux

Installation

  • Clone the repository and enter the cloned directory
  • Modify the required code on src/custom/modules/pmse_Project/AWFCustomActionLogic.php
  • Retrieve the Sugar Module Packager dependency by running either composer install
  • Generate the installable .zip Sugar module within the releases directory with ./vendor/bin/package `cat version`
  • Install the generated module into the instance
  • Execute a Repair and Rebuild
  • Make sure the browser's cache is purged, so that the Advanced Workflow custom action displays
  • Make sure cron is running successfully

PHP Customisations

The only class that needs to be customised is located on custom/modules/pmse_Project/AWFCustomActionLogic.php. The current version of the class, has 3 sample methods that log a fatal message on the sugarcrm.log file. Two methods are available for Accounts and one for Contacts. The method customMethodWithOriginalUserOverride, will retrieve the original user that initiated the process and act as that user, finally it will restore the user. The implemented functionality allows the user to put a job in the background using a timer, and still act in behalf of the original user, instead of Admin.

Sample Screenshot

Advanced Workflow Sample Screenshot

sugaradvancedworkflowcustomphpmethods's People

Contributors

esimonetti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sugaradvancedworkflowcustomphpmethods's Issues

Version for Module Loader

Hello,

first of all, thank you for this example!

I have just one proposal, could you prepare .zip with manifest and all files in this example, which will be possible to install via Module Loader?

Thank you,
Mariyo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.