What's the difference between API Before-Save Script and Before-save custom script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crmtesting
    Junior Member
    • Oct 2024
    • 11

    What's the difference between API Before-Save Script and Before-save custom script?

    As far as I could understand, both are run before an entity is saved. So, are they similar or entirely different things..?
  • yuri
    Member
    • Mar 2014
    • 8467

    #2
    It's explained in docs https://docs.espocrm.com/administrat...e-save-script/

    And in the UI.

    Click image for larger version

Name:	image.png
Views:	72
Size:	27.6 KB
ID:	111758
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • yuri
      Member
      • Mar 2014
      • 8467

      #3
      The API script will run only when you save via the API (that includes saving from the UI). It won't run when a record is saved from workflows, other formula script, from code, etc. This provides the ability to validate a user input or perform access checks.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      • crmtesting
        Junior Member
        • Oct 2024
        • 11

        #4
        Thank you for you response.

        Comment

        Working...