Reason codes are optionally defined as site configuration elements.

If Reason codes for Quantity bad has been configured for a site, then for every time registration containing a Quantity bad registration, the employee will be prompted to select a reason code. The reason code selected is saved in the database as part of the time registration, in order to account for down time periods in e.g. BI or OEE calculations.

This is an example of the Reason codes for Quantity bad, the employee must select between (using the configuration shown below)

Defining reason codes for Quantity bad

In version 7.4.2 reason codes are defined programmatically. Editing of reason codes from a graphical user interface is currently not supported.

The following groovy script shows how to create reason codes. The script only need to be executed once. Please see inline comments for an explanation

def ccs = pluginAPI.getBaseModelAPI().getCodeCollectionsService();

// The concept of 'Code collections' are used for storing both
//   'Job types'                     : "TT_JOB_TYPE"
//   'Quantity bad codes'            : "TT_QTY_BAD_CODE"
//   'Reason codes' for Pause/Cancel : "TT_REG_CODE"

// Quantity bad codes
def qb1 = ccs.build().codeData().id("RENG").name("Cleaning").color("#EC7C26").tag("TT_QTY_BAD_CODE").addOrUpdate();
def qb2 = ccs.build().codeData().id("NEDB").name("Breakdown").color("#4E3B31").tag("TT_QTY_BAD_CODE").add();


def qbcc = ccs.build()
  .codeCollection()
    .name("Quantity bad codes")
    .codes(qb1, qb2)
    .tag("TT_QTY_BAD_CODE")
    .add();

ccs.build().codeCollectionMapping().key("TT_QTY_BAD_CODE", "", "").codeCollection(qbcc).add();

 

Read more about code data, collections and mappings here.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment