The Receipt
A receipt (CRecepit) is a value object defined in Page1.inc that is used to communicate success or failure to the user or to the page. In the case of an Ajax call a receipt can be used pass information to the page that will trigger the page to refresh certain pieces.
The receipt constructor takes three required parameters into additional optional parameters. The parameters are:
Parameter Index | Parameter Description |
---|---|
1 | a string with a value: 'S' = success, 'F' = failure, optionally appended by '-U' = update, '-D' = delete, '-C' = create, '-R'= replace. |
2 | an English language message explaining the receipt (e.g. “Contact Created” |
3 | a string representing the class of object being updated (e.g. 'contact' ) which is used to notify the page which objects need to be updated (i.e. some contact) |
4 | (optional) string representing the ID of the object that needs to be updated |
5 | (optional) an array or hash representing the data that has been updated |
Typically a receipt is returned with returnTarget after a process is completed.