Custom Code Hooks

Custom Code Hooks

What are these?

# Custom code hooks are specialized functions which provide the ability to have your own custom PHP code executed inside of NolaPro when users perform various actions in the system.

How do they work?

# You can simply write a function that you want to perform some additional task and then assign it to a predefined hook (also called an event or trigger point). When the hook is reached in NolaPro, it will call the function(s) that you registered with the event. A trigger point might be when a customer record is modified, an order added, or payroll hours entered.

What are some example of their uses?

# If you want to create your own invoice or order PDF format, you can have it pop up in a new window whenever an order or invoice is added or updated.

# You could create your own event tracking and reporting system to monitor activity in NolaPro (we do provide this exact functionality as a separate add-on, but you may wish to expand or modify).

# If you use a 3rd party HR/Payroll system like iEmployee for example, you could write code to update that system when NolaPro payroll changes are made.

# You could integrate with a separate shopping cart system and use the triggers to let that system know when new inventory arrives from NolaPro POs so quantities can be updated. It could also notify when new items are added to NolaPro.

# You could use it to update a separate lead tracking system that needs to know when customer address/phone info is changed in NolaPro, or when new orders or invoices have been created, or payments made.

# You could add code so that a manager can receive copies of emails whenever the mass emailer in NolaPro is used.

# You could also add additional custom email notifiers that go out to managers whenever someone deletes a payment, invoice, or check.


****Custom Code Hooks won't allow you to alter the layout of pages. They allow you to run your own code when an event happens in NolaPro, like when a new record is added or updated.

***Typically when a code hook is needed for a hosted site, our developers write it. If the user wants to write something themselves, our developers will need to go through the code thoroughly before it can be put live (small fee applies).

***Hosted people are not able to put their own code hooks live. Our developers have to put the code live.

 

To make a code hook, start a PHP file and at the top register your code hook like the following:

register_custom('ar.invoice.update', 'custom_my_extra_invoice_processing');

You can then create a function called custom_my_extra_invoice_processing($params). The system will drop in parameters that you can use for your special processing like the invoice ID and invoice number in this example.

You can add global $conn; to your function to access the database. ($conn->execute($sql); to run a query)

Place the file in a directory called custom just below the root NolaPro directory.

Available events (separate each piece with a period to get admin.company.add for example):

Module

Section

Action

admin

company

add

admin

company

delete

admin

company

update

admin

emailcenter

send

admin

user

add

admin

user

delete

admin

user

update

ap

bill

add

ap

bill

delete

ap

bill

update

ap

check

cashed

ap

check

uncashed

ap

check

void

ap

check

write

ap

commissioncheck

write

ap

manualcheck

write

ap

po

add

ap

po

delete

ap

po

passtoap

ap

po

receive

ap

po

update

ap

preapprovedcheck

write

ap

vendor

add

ap

vendor

delete

ap

vendor

update

ap

withoutpo

receive

ar

bankdeposit

add

ar

bankdeposit

delete

ar

carrier

add

ar

carrier

delete

ar

carrier

update

ar

carriermethod

add

ar

carriermethod

delete

ar

carriermethod

update

ar

creditcheck

write

ar

customer

add

ar

customer

delete

ar

customer

update

ar

invoice

add

ar

invoice

delete

ar

invoice

update

ar

order

add

ar

order

delete

ar

order

invoice

ar

order

quote

ar

order

shipment

ar

order

update

ar

payment

add

ar

rma

add

ar

rma

delete

ar

rma

update

ar

salescategory

add

ar

salescategory

delete

ar

salescategory

update

ar

salesperson

add

ar

salesperson

delete

ar

salesperson

update

ar

salesterritory

edit

ar

shipto

add

ar

shipto

delete

ar

shipto

update

b2b

customer

update

b2b

order

add

b2b

payment

add

gl

account

add

gl

account

delete

gl

account

reactivate

gl

account

update

gl

bank

reconcile

gl

voucher

add

gl

voucher

delete

gl

voucher

post

gl

voucher

postreverse

gl

voucher

update

gl

year

close

inv

item

add

inv

item

adjustment

inv

item

delete

inv

item

transfer

inv

item

update

inv

itemlocation

add

inv

itemlocation

delete

inv

itemlocation

update

inv

itemvendor

add

inv

itemvendor

delete

inv

itemvendor

update

pr

check

edit

pr

check

write

pr

companycontribution

add

pr

companycontribution

delete

pr

companycontribution

update

pr

employee

add

pr

employee

update

pr

employeededuction

add

pr

employeededuction

delete

pr

employeededuction

update

pr

generalbenefit

add

pr

generalbenefit

delete

pr

generalbenefit

update

pr

generaldeduction

add

pr

generaldeduction

delete

pr

generaldeduction

update

pr

generalfactors

update

pr

hours

add

pr

pension

add

pr

pension

delete

pr

pension

update

pr

period

calculate