Tips and Tricks of Sage ACCPAC ERP's Views: 1. Do you know how to get notification from the Accpac Views?

By | May 17, 2011

PROBLEMS:
I have done sub classing of PO Receipt [Header/Detail] views, but I need to add logic such that the detail will perform some calculation whenever the Receipt header is updated/deleted/inserted. I need to look for an event where I need to write the logic which may help me in achieving this functionality.
SOLUTION:
There is an event in the views called Composite Notify which tracks the entire change event [Insert/Update/Delete] in the views.

A small snippet of code which may help the developer to make use of this method:

1st STEP: You need to call the method by uncommenting the below snippet in the XXXX1.h file
#define DO_COMPOSITENOTIFY 1
2nd STEP: The developer has to mark the view with the NOTIFY option ON as mentioned:
Extern CMPNAME cmpNameList [CMP_COUNT+MAN_CMP_COUNT]
{
{PORCPL_VIEW, 0, 0, 0, CMPNAME_OPTION_NOTIFY}.
}
3rd STEP:
CHECK_CALL (e, CompositeNotifyBase (context, reason, rotoID, info, extra, rvh, view));
Switch (reason )
{
case INSTANCE_NOTIFY_RECORD_WRITTEN:
//you can write the logic here
case INSTANCE_NOTIFY_RECORD_DELETED
//you can write the logic here
}
Happy Coding 🙂