EZ-MES provides the end-user great flexibility with the Form Script Document Type.  This allows for the addition of a custom Tab and custome Attributes.  These custom Attributes can be made to specifically handle your needs.

Current Objects That  support Custom Tab

  • PD
  • RQ
  • DC
  • FR
  • PO

Determining Custom Attribute Names

Attribute Names require a specific prefix for the application to use them properly.  Attribute Names are the field names in which your data is stored under.

Depending on what object you are creating the tab for, PD, RQ, DC, or FR, each will require a prefix to have full functionality of your custom attribute name.  After the prefix, you can name it as you like as long as it is restricted to a-z, A-Z, 0-9, and underscore.  There are no spaces or special characters allowed, other than a underscore.

For Example

 Work Orders / RQ Object Attributes ( 'sRQ_Custom_ ' is the required prefix )

sDB: 'sRQ_Custom_Text1'
sDB: 'sRQ_Custom_Number02'

Travelers / FR Object Attributes (  'sFR_Custom_ ' is the required prefix

sDB: 'sFR_Custom_Text1'
sDB: 'sFR_Custom_Number02'

Creating a Form Script Document Type

Create New Document, then set the Document Type Attribute to 'Form Script.  Give this new document the following values

  • Title: Work Order Tab - Custom
  • Doc Number: DC12-WO1
  • Revision: A
  • Document Type: Form Script

Making your Form Script

The form script is made of JSON code surrounded by a JavaScript Function.  However, the meat of the activity is performed by the JSON object.  Below you can see the image of what the JSON looks like before being enclosed in the JavaScript Function.  If you need help verifying your JSON, please use this website http://jsonviewer.stack.hu/.  

Download the Sample Code

JSON Block without the function call

CustomTabJSON1

 

You should now insert your JSON code into the Function call - Object.extend( FormObject,JSONcode,boolean)  You can view the sample Function Call without JSON Block.

Function Call without the JSON Block

CustomTabJSON-FunctionCall1

Here you can download the full Function with JSON Code inserted.

 

Uploading File to Form Script Document Type

Now that you have completed the prototype.arTab Function you can upload it to the previously created Form Script Document Type you made.

Make sure your file has a .JSON extension, then upload your file to the document and move it from Pending to Active.

JSONDocUpload1

 

Viewing Your Update

To view the custom changes you made to your Work Order Form you will need to hit F5 on your browser so that all JavaScript code will refresh.

You should see something similar to the image below.

CustomWorkOrderTab

 

Fixing broken script

If you upload a bad script it is possible to load the application with these custom scripts disabled buy appending a "?scripts=false" to your application URL. And example would be http://gemini.eazyworks.com/?scripts=false

Additional Attribute Type Samples

In addition to the above samples of Attribute types, you can also add the following.

  • Date Input

{ sType: 'datein', sL: 'Date Input:', sDB: 'sRQ_Custom_sRQDate1', sTT: 'Allows for Date Input' }

 
  • DateTime

{ sType: 'datetimein', sL: 'Date and Time Input:', sDB: 'sRQ_Custom_sRQDateAndTime1', sTT: 'Allows for Date and Time Input', sDT: 'datetime' }

  • Number

{ sType: 'textin', sL: 'Number Input:', sDB: 'sRQ_Custom_sRQNumber1', sTT: 'Restricts input to a number', sDT: 'number' }

 
  • Pulldown

{ sType: 'pulldown', sL: 'Category Type:', sDB: 'sRQ_Custom_sRQPulldown1', sTT: '', mGetData: { ezFunction: function () {
var ar = [];
ar.push({ sDsp: 'Display This Value In Pulldown', sVal: 'Save This Value When Selected' }); 
ar.push({ sDsp: 'Value 2', sVal: 'Value2' });
ar.push({ sDsp: 'Value 3', sVal: 'Value 3' });
return ar;

}}}
OR

{ sType: 'pulldown', sL: 'Organization:', sDB: 'sRQ_Custom_sFROrganization', sTT: '', sDT: 'jobname',
mGetData: {
bServer: true,
sFlow: 'OR_Flow',
mGetCheckVals: function ()
{
var ar = [];
return ar;
}
}
}

  • Hyperlink

{ sType: 'text', sL: 'Text Displayed as Hyperlink:', sDB: 'sRQ_Custom_sRQTextToHL', sTT: 'Values entered will be displayed as a Hyperlink', bHyperLink: true },

  •  
  • Multiline

{sType: 'textinml', sL: 'Multi-Line Textbox Input:', sDB: 'sRQ_Custom_sRQTextbox1', sTT: 'Multi-Line Text Input will save any text input', iML: 3  }

  • Text Input

{sType: 'textin', sL: 'Textbox Input:', sDB: 'sRQ_Custom_sRQTextboxx1', sTT: 'Text Input will save any text input' }

  • Checkbox

{sType: 'checkbox', sL: 'Checkbox Display:', sDB: 'sRQ_Custom_sRQCheckbox1', sTT: 'Checkbox will save a boolean value - true of false' }

 

  •