Posting Duplicates records using webhook

Problem

Generating 2 identical POST request records with one web hook ( method:POST. Module:case, trigger: after save).

Expected Output:

Generate only one record (POST request) of the case being saved.

Context

I've set up a web hook that sends a POST request to an external endpoint, (Admin->Web Logic Hooks) and it does work, but every time i save a record i keep receiving to identical records of the same case.sometimes it sends two different records of the same case ( i believe this is when i update a record) but now (after upgrading to version 10.1.0), it sends two identical records every time someone creates a record in the cases module, i know i could find a way around this from the endpoint receiving the request but i already increased the 'max_allowed_packetsee link and i don't want to use the table queue any more than it has to. 

besides setting up the web hook from the admin panel, is there something else i should configure? is this a version error and should i upgrade to 10.0.1? 

Note: when i check for duplicate records in the webhook, the list shows up empty.see Docco

  • Hi Karen,

    Do you have any "after_save" Logic Hooks in your module that saves the record again? That could possibly trigger the second web hook.

    Maybe try disabling any custom Logic Hooks to test only the Web Logic Hook - or try testing on another module which doesn't have custom logic hooks.

  • Hey Neeranja,

    thanks, even though it appears as i'm having one logic, the deleted web kooks are still store in <custom/modules/Cases/logic_hooks.php>...maybe doing a quick repair and build could solve it....but i just went ahead and delete it the logic_hooks.php file of the current module and it automatically build the file when i re-configured the webwook in the admin panel.

      

  • Hello

    Web Logic Hooks are sometimes an enigma .

    I would suggest just to configure your user story as a logic hook.

    I use the tool which is created for such purpose - the Logic Builder - and below is a working example
    Please, feel free to install and use it :)


    You may easily read user story implementation logic by following the white line:




    As you can see,  according to the logic, whenever a new Case is registered, selected fields of the Case record will be sent to the external URL with POST request.

    Please note -  the destination URL is not specified directly in the flowchart to deliver more flexibility without editing - URL should be provided in the Description field of the Note, that has special Subject = "==external_endpoint_url==" 

    On design ready, clicking Generate button provides a regular Sugar zip extension that implements the user story implementation configured.

    To get this solution work:

    1. Add the Note with Subject = "==external_endpoint_url=="  and Description = <your endpoint URL> (you may even not relate it to any module.
    2. Install z20200925_flowchart_lb5f6e344e3a1998_00984538.zip via Module Loader


    More details about configuring user stories instead of coding them you may find here: www.integroscrm.com/logic-builder/

    Please let me know if any questions.
    If you like to adjust the flowchart logic by yourself, please let me know too - I would be happy to guide


    All the Best,
    Dmytro


    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient