Edit

Extending the Wiki to custom User2 lists

If your MoneyWorks has been customised with new lists based on the user2 table (for example, a list of work orders, properties, contracts), your developer can allow your custom lists access to the extended wiki, thus allowing a wiki entry for each. Note however that any search of the wiki will find matching custom records.

The following amendments, which are a wee bit technical, need to be made to the custom script:

  1. Declare the use of the two wiki handlers required:
uses __MoneyWorks_Wiki:registerUser2Wiki
uses __MoneyWorks_Wiki:wiki 
  1. Register the custom form that has wiki access by including the following call in the scripts Load handler:
__MoneyWorks_Wiki:RegisterUser2Wiki(formID, description, hasToolBar, user2CodeExpr, user2DescExpr)

formID` is the id of the form window in the UI editor (e.g. "F_MYLIST");

hasToolBar should be true only if the window is a list window with a toolbar. In this case a B_WIKI button will be added to the list's toolbar;

description is a user friendly name string for wiki, e.g. "Work Orders";

user2CodeExpr is a field to identify the record, and for User2 should always be "sequencenumber";

user2DescExpr is the user2 field or expression containing the default name for the new wiki page, e.g. "text1", "slice(text,1,`\t`)".

Note that the call will fail if the extended wiki has not been enabled.

  1. An itemhit for the wiki button that will be placed on a list window toolbar.
on ItemHit:F_MYLIST:B_WIKI(w)
    __MoneyWorks_Wiki:Wiki(w)
end

This will check that a single record in the list is highlighted, and extract the necessary data using the details passed in the registerUser2Wiki() to locate or offer to create a new wiki page associated with the highlight record.

You can also a register an entry window for your custom user2 list, but you will need to:

  • Register the form window (the hasToolBar parameter will be false);
  • Add your own Wiki button to the form (the itemhit will be equivalent to the one above);
  • Ensure the Wiki button is visible only if the user2 record exists (which it won't for new or duplicated records until they have been saved).