CREATE TABLE R5ROLLBACKDATA ( 
    RBK_TABLENAME  NVARCHAR( 50 )    NOT NULL,
    RBK_MODELNAME  NVARCHAR( 50 ),
    RBK_TABLEKEY   NVARCHAR( 1000 ),
    RBK_PARAMETERS NVARCHAR( 1000 )  NOT NULL,
    RBK_QUEID      INT,
    RBK_DATA       BLOB              NOT NULL 
);

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR01 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR02 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR03 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR04 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR05 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR06 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR07 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR08 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR09 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR10 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR11 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR12 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR13 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR14 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR15 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR16 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR17 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR18 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR19 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR20 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR21 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR22 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR23 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR24 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR25 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR26 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR27 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR28 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR29 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHAR30 NVARCHAR( 80 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFNUM01 NUMERIC( 24, 6 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFNUM02 NUMERIC( 24, 6 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFNUM03 NUMERIC( 24, 6 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFNUM04 NUMERIC( 24, 6 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFNUM05 NUMERIC( 24, 6 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFDATE01 DATETIME;

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFDATE02 DATETIME;

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFDATE03 DATETIME;

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFDATE04 DATETIME;

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFDATE05 DATETIME;

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHKBOX01 NVARCHAR( 1 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHKBOX02 NVARCHAR( 1 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHKBOX03 NVARCHAR( 1 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHKBOX04 NVARCHAR( 1 );

ALTER TABLE R5ACTIVITIES
 ADD COLUMN ACT_UDFCHKBOX05 NVARCHAR( 1 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR11 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR12 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR13 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR14 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR15 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR16 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR17 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR18 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR19 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR20 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR21 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR22 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR23 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR24 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR25 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR26 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR27 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR28 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR29 NVARCHAR( 80 );

ALTER TABLE R5OBJECTS
 ADD COLUMN OBJ_UDFCHAR30 NVARCHAR( 80 );

INSERT INTO R5LISTENTITY SELECT 'BCDELETE' AS LET_DATAGRID,
       913 AS LET_SEQNO,
       NULL AS LET_MASK,
       NULL AS LET_DOWNCAT,
       NULL AS LET_GROUPID,
       NULL AS LET_BLOCKSIZE,
       3 AS LET_DELINSUPD,
       NULL AS LET_FILTER,
       'R5MOBILESYNCDELETE' AS LET_TABLENAME,
       NULL AS LET_ORGKEY,
       NULL AS LET_DOWNGROUP,
       NULL AS LET_FILTERPARAMS,
       '-' AS LET_CONNECTEDMODE,
       '-' AS LET_ALWAYSDOWNLOAD,
       NULL AS LET_UPDATED,
       NULL AS LET_MASTERTABLE,
       NULL AS ROWIDENTITY;

INSERT INTO R5LISTENTITY SELECT 'OCSTRU' AS LET_DATAGRID,
       914 AS LET_SEQNO,
       NULL AS LET_MASK,
       NULL AS LET_DOWNCAT,
       NULL AS LET_GROUPID,
       NULL AS LET_BLOCKSIZE,
       3 AS LET_DELINSUPD,
       'OCOBJC' AS LET_FILTER,
       'R5STRUCTURES' AS LET_TABLENAME,
       NULL AS LET_ORGKEY,
       NULL AS LET_DOWNGROUP,
       NULL AS LET_FILTERPARAMS,
       '-' AS LET_CONNECTEDMODE,
       '-' AS LET_ALWAYSDOWNLOAD,
       NULL AS LET_UPDATED,
       NULL AS LET_MASTERTABLE,
       NULL AS ROWIDENTITY;

INSERT INTO R5LISTENTITY SELECT 'WCMANU' AS LET_DATAGRID,
       915 AS LET_SEQNO,
       NULL AS LET_MASK,
       NULL AS LET_DOWNCAT,
       NULL AS LET_GROUPID,
       NULL AS LET_BLOCKSIZE,
       3 AS LET_DELINSUPD,
       NULL AS LET_FILTER,
       'R5MANUFACTURERS' AS LET_TABLENAME,
       'MFG_ORG' AS LET_ORGKEY,
       NULL AS LET_DOWNGROUP,
       NULL AS LET_FILTERPARAMS,
       '-' AS LET_CONNECTEDMODE,
       '-' AS LET_ALWAYSDOWNLOAD,
       NULL AS LET_UPDATED,
       NULL AS LET_MASTERTABLE,
       NULL AS ROWIDENTITY;

INSERT INTO r5listentity VALUES (
    'BCCOMOBJHIST_IPAD',
    916,
    NULL,
    NULL,
    NULL,
    NULL,
    3,
    'BCCOMOBJHIST',
    'R5ADDETAILS',
    'EVT_ORG',
    NULL,
    NULL,
    '-',
    '-',
    NULL,
    'R5OBJECTS',
    NULL 
);

INSERT INTO r5listentity VALUES ( 
    'BCCOMOBJHISTWO_IPAD',
    917,
    NULL,
    NULL,
    NULL,
    NULL,
    3,
    'BCCOMOBJHISTWO',
    'R5ADDETAILS',
    'EVT_ORG',
    NULL,
    NULL,
    '-',
    '-',
    NULL,
    'R5EVENTS',
    NULL 
);

UPDATE R5LISTENTITY
   SET LET_DATAGRID = 'OCCATLOC_IPAD'
 WHERE LET_SEQNO = 54;
 
UPDATE R5GRIDFIELDS
   SET GRF_FIELDS = '{ "fields" : [{"name": "OBJ_ORG", "label": "Organization", "type": "VARCHAR"},{"name": "OBJ_LOCATION", "label": "Location", "type": "VARCHAR"},{"name": "OBJ_LOCATION_ORG", "label": "Location org", "type": "VARCHAR"},{"name": "OBJ_MRC", "label": "Department", "type": "VARCHAR"},{"name": "OBJ_CLASS", "label": "Class", "type": "VARCHAR"},{"name": "OBJ_CLASS_ORG", "label": "Class org", "type": "VARCHAR"},{"name": "OBJ_OBTYPE", "label": "Type", "type": "VARCHAR"},{"name": "OBJ_CODE", "label": "Equipment", "type": "VARCHAR"},{"name": "OBJ_DESC", "label": "Description", "type": "MIXVARCHAR"},{"name": "OBJ_STATUS", "label": "Status", "type": "VARCHAR"},{"name": "OBJ_MANUFACT", "label": "Manufacturer", "type": "VARCHAR"},{"name": "OBJ_SERIALNO", "label": "Serial number", "type": "MIXVARCHAR"},{"name": "OBJ_MANUFACTMODEL", "label": "Model", "type": "MIXVARCHAR"},{"name": "OBJ_CATEGORY", "label": "Category", "type": "VARCHAR"},{"name": "OBJ_VALUE", "label": "Value", "type": "CURRENCY"},{"name": "OBJ_COMMISS", "label": "Commission date", "type": "DATE"},{"name": "OBJ_PERSON", "label": "Assigned to", "type": "VARCHAR"},{"name": "OBJ_CRITICALITY", "label": "Criticality", "type": "VARCHAR"},{"name": "OBJ_COSTCODE", "label": "Cost code", "type": "VARCHAR"},{"name": "OBJ_STORE", "label": "Store", "type": "VARCHAR"},{"name": "OBJ_BIN", "label": "Bin", "type": "VARCHAR"},{"name": "OBJ_LOT", "label": "Lot", "type": "VARCHAR"},{"name": "OBJ_PART", "label": "Part", "type": "VARCHAR"},{"name": "OBJ_PRIMARYUOM", "label": "Meter unit", "type": "MIXVARCHAR"},{"name": "OBJ_OBRTYPE", "label": "Type", "type": "VARCHAR"},{"name": "OBJ_PART_ORG", "label": "Part org", "type": "VARCHAR"},{"name": "OBJ_DORMSTART", "label": "Dormant start", "type": "DATE"},{"name": "OBJ_DORMEND", "label": "Dormant end", "type": "DATE"},{"name": "OBJ_SYSLEVEL", "label": "System level", "type": "MIXVARCHAR"},{"name": "OBJ_COMPLEVEL", "label": "Component level", "type": "MIXVARCHAR"},{"name": "OBJ_ASMLEVEL", "label": "Assembly level", "type": "MIXVARCHAR"},{"name": "OBJ_GISOBJID", "label": "Type", "type": "NUMBER"},{"name": "OBJ_RSTATUS", "label": "Status", "type": "VARCHAR"},{"name": "OBJ_CGMP", "label": "cGMP", "type": "VARCHAR"},{"name": "OBJ_NOTUSED", "label": "Out of service", "type": "VARCHAR"},{"name": "OBJ_SAFETY", "label": "Safety", "type": "VARCHAR"},{"name": "OBJ_UDFCHAR01", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR02", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR03", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR04", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR05", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR06", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR07", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR08", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR09", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR10", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFNUM01", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "OBJ_UDFNUM02", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "OBJ_UDFNUM03", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "OBJ_UDFNUM04", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "OBJ_UDFNUM05", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "OBJ_UDFDATE01", "label": "User Defined Fields", "type": "DATE"},{"name": "OBJ_UDFDATE02", "label": "User Defined Fields", "type": "DATE"},{"name": "OBJ_UDFDATE03", "label": "User Defined Fields", "type": "DATE"},{"name": "OBJ_UDFDATE04", "label": "User Defined Fields", "type": "DATE"},{"name": "OBJ_UDFDATE05", "label": "User Defined Fields", "type": "DATE"},{"name": "OBJ_UDFCHAR11", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR12", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR13", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR14", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR15", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR16", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR17", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR18", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR19", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR20", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR21", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR22", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR23", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR24", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR25", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR26", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR27", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR28", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR29", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHAR30", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "OBJ_UDFCHKBOX01", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "OBJ_UDFCHKBOX02", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "OBJ_UDFCHKBOX03", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "OBJ_UDFCHKBOX04", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "OBJ_UDFCHKBOX05", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "OBJ_ADDRESS", "label": "Description", "type": "VARCHAR"}]}'
 WHERE grf_gridname = 'OCOBJC_IPAD';
 
 
UPDATE R5GRIDFIELDS
   SET GRF_FIELDS = '{ "fields" : [{"name": "ACT_ACT", "label": "Activity", "type": "NUMBER"},{"name": "ACT_TRADE", "label": "Trade", "type": "VARCHAR"},{"name": "ACT_START", "label": "Start date", "type": "DATE"},{"name": "ACT_EVENT", "label": "Mobile Work Order Activity", "type": "VARCHAR"},{"name": "ACT_TASK", "label": "Task", "type": "VARCHAR"},{"name": "ACT_MATLIST", "label": "Material list", "type": "VARCHAR"},{"name": "ACT_EST", "label": "Estimated hours", "type": "DECIMAL"},{"name": "ACT_PERSONS", "label": "People required", "type": "NUMBER"},{"name": "ACT_TASKREV", "label": "Revision", "type": "NUMBER"},{"name": "ACT_MATLREV", "label": "Revision", "type": "NUMBER"},{"name": "ACT_QTY", "label": "Quantity", "type": "DECIMAL"},{"name": "ACT_MRC", "label": "Department", "type": "VARCHAR"},{"name": "ACT_PERRESP", "label": "Person responsible", "type": "VARCHAR"},{"name": "ACT_COMPLETED", "label": "Completed", "type": "VARCHAR"},{"name": "ACT_RPC", "label": "Reason For Repair", "type": "VARCHAR"},{"name": "ACT_WAP", "label": "Work Accomplished", "type": "VARCHAR"},{"name": "ACT_TPF", "label": "Technician Part Failure", "type": "VARCHAR"},{"name": "ACT_MANUFACT", "label": "Manufacturer", "type": "VARCHAR"},{"name": "ACT_SYSLEVEL", "label": "System Level", "type": "MIXVARCHAR"},{"name": "ACT_ASMLEVEL", "label": "Assembly Level", "type": "MIXVARCHAR"},{"name": "ACT_COMPLEVEL", "label": "Component Level", "type": "MIXVARCHAR"},{"name": "ACT_WARRANTY", "label": "Warranty", "type": "VARCHAR"},{"name": "ACT_NOTE", "label": "Note", "type": "MIXVARCHAR"},{"name": "ACT_DEFERMAINTENANCE", "label": "Defer Maintenance", "type": "VARCHAR"},{"name": "ACT_UDFCHAR01", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR02", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR03", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR04", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR05", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR06", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR07", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR08", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR09", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR10", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR11", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR12", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR13", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR14", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR15", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR16", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR17", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR18", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR19", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR20", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR21", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR22", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR23", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR24", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR25", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR26", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR27", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR28", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR29", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFCHAR30", "label": "User Defined Fields", "type": "MIXVARCHAR"},{"name": "ACT_UDFDATE01", "label": "User Defined Fields", "type": "DATE"},{"name": "ACT_UDFDATE02", "label": "User Defined Fields", "type": "DATE"},{"name": "ACT_UDFDATE03", "label": "User Defined Fields", "type": "DATE"},{"name": "ACT_UDFDATE04", "label": "User Defined Fields", "type": "DATE"},{"name": "ACT_UDFDATE05", "label": "User Defined Fields", "type": "DATE"},{"name": "ACT_UDFNUM01", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "ACT_UDFNUM02", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "ACT_UDFNUM03", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "ACT_UDFNUM04", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "ACT_UDFNUM05", "label": "User Defined Fields", "type": "DECIMAL"},{"name": "ACT_HIRE", "label": "Hired Labor", "type": "VARCHAR"},{"name": "ACT_DURATION", "label": "Activity Duration", "type": "NUMBER"},{"name": "ACT_UDFCHKBOX01", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "ACT_UDFCHKBOX02", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "ACT_UDFCHKBOX03", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "ACT_UDFCHKBOX04", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "ACT_UDFCHKBOX05", "label": "User Defined Fields", "type": "VARCHAR"},{"name": "EVT_ORG", "label": "Activity", "type": "VARCHAR"}]}'
 WHERE grf_gridname = 'WCACTJ_IPAD';
 
UPDATE r5configsettings  SET CFS_XMLCONFIG='{"sections":[{"fields":[{"def":"","hid":"NO","id":"EVT_CODE","lbl":"Work Order","len":"30","ro":"YES","rq":"NO","type":"CHAR"},{"def":"","hid":"NO","id":"EVT_DESC","lbl":"Description","len":"80","ro":"NO","rq":"YES","type":"CHAR"},{"def":"","hid":"NO","id":"EVT_OBJECT","lbl":"Equipment","len":"30","ro":"NO","rq":"YES","type":"LOV-2"},{"def":"","hid":"NO","id":"EVT_JOBTYPE","lbl":"Type","len":"8","ro":"NO","rq":"YES","type":"LOV-1"},{"def":"","hid":"NO","id":"EVT_MRC","lbl":"Department","len":"15","ro":"NO","rq":"YES","type":"LOV-1"},{"def":"","hid":"NO","id":"EVT_STATUS","lbl":"Status","len":"8","ro":"NO","rq":"YES","type":"PICKER"},{"def":"","hid":"NO","id":"EVT_SAFETY","lbl":"Safety","len":"2","ro":"NO","rq":"NO","type":"BOOL"},{"def":"","hid":"NO","id":"EVT_WARRANTY","lbl":"Warranty","len":"2","ro":"NO","rq":"NO","type":"BOOL"}],"name":"Work Request"},{"fields":[{"def":"","hid":"NO","id":"EVT_PERSON","lbl":"Assigned To","len":"15","ro":"NO","rq":"NO","type":"LOV-1"},{"def":"","hid":"NO","id":"EVT_TARGET","lbl":"Sched. Start Date","len":"80","ro":"NO","rq":"NO","type":"DATE"},{"def":"","hid":"NO","id":"EVT_DUE","lbl":"Sched. End Date","len":"80","ro":"NO","rq":"NO","type":"DATE"},{"def":"","hid":"NO","id":"EVT_REPORTED","lbl":"Date Reported","len":"80","ro":"NO","rq":"YES","type":"DATI"}],"name":"Scheduling"},{"fields":[{"def":"","hid":"NO","id":"EVT_LOCATION","lbl":"Location","len":"30","ro":"NO","rq":"NO","type":"LOV-1"},{"def":"","hid":"NO","id":"EVT_CLASS","lbl":"Class","len":"8","ro":"NO","rq":"NO","type":"LOV-1"},{"def":"","hid":"NO","id":"EVT_COSTCODE","lbl":"Cost Code","len":"30","ro":"NO","rq":"NO","type":"LOV-1"},{"def":"","hid":"NO","id":"EVT_PRIORITY","lbl":"Priority","len":"8","ro":"NO","rq":"NO","type":"PICKER"},{"def":"","hid":"NO","id":"EVT_REQM","lbl":"Problem Code","len":"8","ro":"NO","rq":"NO","type":"LOV-1"}],"name":"Work Order Details"},{"fields":[{"def":"","hid":"NO","id":"EVT_CLOSECOMMENT","lbl":"Comment","len":"200","ro":"NO","rq":"NO","type":"MEMO-1"}],"name":"Comment"}]}'  WHERE CFS_CODE='TCJOBQ_IPAD' AND CFS_GROUP = '*';
 
UPDATE r5configsettings  SET CFS_XMLCONFIG='{"sections":[{ "name":"Equipment", "fields":[ {"id":"OBJ_CODE", "lbl":"Equipment", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"30", "hid":"NO" }, {"id":"OBJ_DESC", "lbl":"Description", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"80", "hid":"NO" }, {"id":"OBJ_ORG", "lbl":"Organization", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_STATUS", "lbl":"Status", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_MRC", "lbl":"Department", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_CLASS", "lbl":"Class", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_SAFETY", "lbl":"Safety", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_CATEGORY", "lbl":"Category", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_LOCATION", "lbl":"Location", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_COSTCODE", "lbl":"Cost Code", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_COMMISS", "lbl":"Commission Date", "type":"DATE", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_CRITICALITY", "lbl":"Criticality", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_DORMSTART", "lbl":"Dormant Start", "type":"DATE", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_DORMEND", "lbl":"Dormant End", "type":"DATE", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_SYSLEVEL", "lbl":"System Level", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_ASMLEVEL", "lbl":"Assembly Level", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_COMPLEVEL", "lbl":"Component Level", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }] }, { "name":"Tracking Details", "fields":[ {"id":"OBJ_MANUFACT", "lbl":"Manufacturer", "type":"LOV-1", "def":"", "ro":"NO", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_SERIALNO", "lbl":"Serial Number", "type":"CHAR", "def":"", "ro":"NO", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_MANUFACTMODEL", "lbl":"Model", "type":"CHAR", "def":"", "ro":"NO", "rq":"NO", "len":"15", "hid":"NO" }] }, { "name":"Parts Association", "fields":[ {"id":"OBJ_PART", "lbl":"Part", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_STORE", "lbl":"Store", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_BIN", "lbl":"Bin", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }, {"id":"OBJ_LOT", "lbl":"Lot", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"15", "hid":"NO" }] }]}'  WHERE CFS_CODE='TCOBJR_IPAD' AND CFS_GROUP = '*';



INSERT INTO R5APPSETTINGS ( 
    AST_NAME,
    AST_VALUE,
    AST_DEFAULT,
    DMLTYPE 
) 
VALUES ( 
    'CODEVERSION',
    '10121',
    0,
    'N' 
);
UPDATE R5LISTENTITY set LET_MASTERTABLE = 'R5OBJECTS' 
 where LET_DATAGRID like 'OCJOBH_IPAD';
 
UPDATE R5LISTENTITY
SET LET_UPDATED = NULL
WHERE LET_TABLENAME IN ( 'R5OBJECTS', 'R5ACTIVITIES' ) 
OR
LET_MASTERTABLE IN ( 'R5OBJECTS', 'R5ACTIVITIES' );
