Save Data From Entrypoint

Can anyone help me save my data to the database after clicking a button in entrypoint like adding accounts.

For saving the Data from the Entrypoint by Clicking on the Button, We have considered the Account Module and Add Button on the Detail view of the Record.

For Adding Button on Detail View of Record, We have used Logic Hook. For that add below file in your CRM in the following path,

/custom/Extension/application/Ext/LogicHooks/AccountsLogicHook.php

Add Below code in AccountsLogicHook.php file,

After adding a logic hook, Create Accounts.php on below path,

/custom/include/Accounts.php

Add Below code in Accounts.php file,

We have added a Button on the Detail view of the Record through JS and Click Event of the Button. Below is the Custom JS file,

/custom/include/Accounts.js

After adding the Save Button, the Register entry point on the registry file in the following path.

/custom/Extension/application/Ext/EntryPointRegistry/EntryPoint.php

For Saving the Data, Create saveData Entrypoint file in below path,

/custom/saveData.php

After Creating the File add the below code in your file,

Now Click on the “Save Data” Button it will call Entrypoint and save your data in the database.

1 Like

There’s an easier way to inject the button on the top: