Forums

How can I use reference to a 'global' function library in Connections?

NickOg 19 Jan, 2015
Hi

How can I add reference to a set of 'global' functions that each record will pick up? I can use the 'functions' box to build controls - things like a drop down or the date formatting shown in the example below. It would be simpler to build them in a library that I can require_once and call from the PHP functions box

For example I will use
mdlMbrReceipts.dateReceived: return (substr($cell,0,4)=='0000')? 'Not Received': date('d-M-Y', strtotime($cell));
mdlMbrReceipts.datePaid: return (substr($cell,0,4)=='0000')? 'Not Paid': date('d-M-Y', strtotime($cell));
in several connections and forms.

It would be simpler to define that in my library and then:
mdlMbrReceipts.dateReceived: return getDatePaid($cell);
mdlMbrReceipts.datePaid: return getDatePaid($cell);


Can I do that? If so, how?

Nick
This topic is locked and no more replies can be posted.