How to triggered Json Parsing in custom module on save button in suitecrm 7.9.1

I created custom module As LMS and in editviewdef on click of save button i need to call webservice

How should i achieve this

Thank you

There are a number of options to you. You can:

  • Create custom logic hook
  • Create a custom controller and override the action_Save method.

To create a custom logic hook, you need to create or modify the custom/modules//Logic_Hooks.php file.

 $hook_version = 1;
 $hook_array = Array();
$hook_array['after_save'] = Array();
$hook_array['after_save'][] = Array(
 'Send contact case closure email',
 'modules/AOP_Case_Updates/CaseUpdatesHook.php', // relative path to php file
 'CaseUpdatesHook', // class name
 'closureNotify'); // method name

then create a custom class with a method:


class SomeClass
{
    function someMethod($bean, $event, $arguments)
    {
    //Custom Logic
    }
}

To create a custom controller you need to create or modify modules//controller.php


<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class <TheModule>Controller extends SugarController
{
    public function action_save()
    {
         parent::action_save();
    }
}

For more details, I would recommend the SuiteCRM For Developers book https://leanpub.com/suitecrmfordevelopers it covers this in much more detail.