DROP TABLE R5NONCONFORMITIES;

create table R5NONCONFORMITIES
(
NCF_CODE                    nvarchar(30) NOT NULL,
NCF_DESC                    nvarchar(80) NOT NULL,
NCF_ORG                     nvarchar(15) NOT NULL,
NCF_OBJECT                  nvarchar(30) NOT NULL,
NCF_OBJECT_ORG              nvarchar(15) NOT NULL,
NCF_LOCATION                nvarchar(30),
NCF_LOCATION_ORG            nvarchar(15),
NCF_CLASS                   nvarchar(8),
NCF_CLASS_ORG               nvarchar(15),
NCF_SYSLEVEL                nvarchar(30),
NCF_ASMLEVEL                nvarchar(30),
NCF_COMPLEVEL               nvarchar(30),
NCF_PART                    nvarchar(30),
NCF_PART_ORG                nvarchar(15),
NCF_MATLTYPE                nvarchar(8),
NCF_STATUS                  nvarchar(4) NOT NULL,
NCF_RSTATUS                 nvarchar(4) NOT NULL,
NCF_NCTTYPE                 nvarchar(30),
NCF_NCTTYPE_ORG             nvarchar(15),
NCF_SEVERITY                nvarchar(8),
NCF_INTENSITY               nvarchar(8),
NCF_SIZE                    numeric(24,6),
NCF_IMPORTANCE              nvarchar(8),
NCF_PRIORITY                nvarchar(8),
NCF_CONDITIONSCORE          numeric(24,6),
NCF_CONDITIONINDEX          nvarchar(8),
NCF_NEXTINSPECTDATE         datetime,
NCF_NEXTINSPECTDATEOVERRIDE datetime,
NCF_RECOMMREPAIRDATE        datetime,
NCF_ESTLABORCOST            numeric(24,6),
NCF_ESTMATLCOST             numeric(24,6),
NCF_ESTMISCCOST             numeric(24,6),
NCF_CREATED                 datetime,
NCF_CREATEDBY               nvarchar(30),
NCF_UPDATED                 datetime,
NCF_UPDATEDBY               nvarchar(30),
NCF_FROMPOINT               numeric(24,6),
NCF_FROMREFDESC             nvarchar(80),
NCF_FROMGEOREF              nvarchar(1000),
NCF_TOPOINT                 numeric(24,6),
NCF_TOREFDESC               nvarchar(80),
NCF_TOGEOREF                nvarchar(1000),
NCF_INSPECTIONDIRECTION     nvarchar(8),
NCF_FLOW                    nvarchar(8),
NCF_UDFCHAR01               nvarchar(80),
NCF_UDFCHAR02               nvarchar(80),
NCF_UDFCHAR03               nvarchar(80),
NCF_UDFCHAR04               nvarchar(80),
NCF_UDFCHAR05               nvarchar(80),
NCF_UDFCHAR06               nvarchar(80),
NCF_UDFCHAR07               nvarchar(80),
NCF_UDFCHAR08               nvarchar(80),
NCF_UDFCHAR09               nvarchar(80),
NCF_UDFCHAR10               nvarchar(80),
NCF_UDFCHAR11               nvarchar(80),
NCF_UDFCHAR12               nvarchar(80),
NCF_UDFCHAR13               nvarchar(80),
NCF_UDFCHAR14               nvarchar(80),
NCF_UDFCHAR15               nvarchar(80),
NCF_UDFCHAR16               nvarchar(80),
NCF_UDFCHAR17               nvarchar(80),
NCF_UDFCHAR18               nvarchar(80),
NCF_UDFCHAR19               nvarchar(80),
NCF_UDFCHAR20               nvarchar(80),
NCF_UDFCHAR21               nvarchar(80),
NCF_UDFCHAR22               nvarchar(80),
NCF_UDFCHAR23               nvarchar(80),
NCF_UDFCHAR24               nvarchar(80),
NCF_UDFCHAR25               nvarchar(80),
NCF_UDFCHAR26               nvarchar(80),
NCF_UDFCHAR27               nvarchar(80),
NCF_UDFCHAR28               nvarchar(80),
NCF_UDFCHAR29               nvarchar(80),
NCF_UDFCHAR30               nvarchar(80),
NCF_UDFNUM01                numeric(24,6),
NCF_UDFNUM02                numeric(24,6),
NCF_UDFNUM03                numeric(24,6),
NCF_UDFNUM04                numeric(24,6),
NCF_UDFNUM05                numeric(24,6),
NCF_UDFDATE01               datetime,
NCF_UDFDATE02               datetime,
NCF_UDFDATE03               datetime,
NCF_UDFDATE04               datetime,
NCF_UDFDATE05               datetime,
NCF_UDFCHKBOX01             nvarchar(1) default '-',
NCF_UDFCHKBOX02             nvarchar(1) default '-',
NCF_UDFCHKBOX03             nvarchar(1) default '-',
NCF_UDFCHKBOX04             nvarchar(1) default '-',
NCF_UDFCHKBOX05             nvarchar(1) default '-',
NCF_UPDATECOUNT             numeric(38) default 0,
NCF_CPR                     nvarchar(30),
NCF_CPR_ORG                 nvarchar(15),
NCF_MRC                     nvarchar(15),
NCF_SOURCEOBSERVATION       nvarchar(30),
NCF_OBSERVATIONOVERRIDE     nvarchar(1) default '-',
NCF_MERGEDINTO              nvarchar(30),
NCF_HISTORYFLAG             nvarchar(1),
DMLTYPE nchar(1) NULL DEFAULT ('N'),
PRIMARY KEY (NCF_CODE)
);


create table R5NONCONFORMOBSERVATIONS
(
NCO_PK                      nvarchar(30) not null,
NCO_CODE                    nvarchar(30),
NCO_OBSERVATION             numeric(8),
NCO_TASK                    nvarchar(20),
NCO_TASKREV                 numeric(4),
NCO_STATUS                  nvarchar(4),
NCO_RSTATUS                 nvarchar(4),
NCO_SEVERITY                nvarchar(8),
NCO_INTENSITY               nvarchar(8),
NCO_SIZE                    numeric(24,6),
NCO_IMPORTANCE              nvarchar(8),
NCO_NOTE                    nvarchar(1000),
NCO_RECORDED                datetime,
NCO_RECORDEDBY              nvarchar(30),
NCO_CONDITIONSCORE          numeric(24,6),
NCO_CONDITIONINDEX          nvarchar(8),
NCO_NEXTINSPECTDATE         datetime,
NCO_NEXTINSPECTDATEOVERRIDE datetime,
NCO_WORKORDER               nvarchar(30),
NCO_CREATED                 datetime,
NCO_CREATEDBY               nvarchar(30),
NCO_UPDATED                 datetime,
NCO_UPDATEDBY               nvarchar(30),
NCO_PERFORMED               datetime,
NCO_PERFORMEDBY             nvarchar(30),
NCO_PERFORMEDTYPE           nvarchar(4),
NCO_REVIEWED                datetime,
NCO_REVIEWEDBY              nvarchar(30),
NCO_REVIEWEDTYPE            nvarchar(4),
NCO_CODEBEFOREMERGE         nvarchar(30),
NCO_UDFCHAR01               nvarchar(80),
NCO_UDFCHAR02               nvarchar(80),
NCO_UDFCHAR03               nvarchar(80),
NCO_UDFCHAR04               nvarchar(80),
NCO_UDFCHAR05               nvarchar(80),
NCO_UDFCHAR06               nvarchar(80),
NCO_UDFCHAR07               nvarchar(80),
NCO_UDFCHAR08               nvarchar(80),
NCO_UDFCHAR09               nvarchar(80),
NCO_UDFCHAR10               nvarchar(80),
NCO_UDFCHAR11               nvarchar(80),
NCO_UDFCHAR12               nvarchar(80),
NCO_UDFCHAR13               nvarchar(80),
NCO_UDFCHAR14               nvarchar(80),
NCO_UDFCHAR15               nvarchar(80),
NCO_UDFCHAR16               nvarchar(80),
NCO_UDFCHAR17               nvarchar(80),
NCO_UDFCHAR18               nvarchar(80),
NCO_UDFCHAR19               nvarchar(80),
NCO_UDFCHAR20               nvarchar(80),
NCO_UDFCHAR21               nvarchar(80),
NCO_UDFCHAR22               nvarchar(80),
NCO_UDFCHAR23               nvarchar(80),
NCO_UDFCHAR24               nvarchar(80),
NCO_UDFCHAR25               nvarchar(80),
NCO_UDFCHAR26               nvarchar(80),
NCO_UDFCHAR27               nvarchar(80),
NCO_UDFCHAR28               nvarchar(80),
NCO_UDFCHAR29               nvarchar(80),
NCO_UDFCHAR30               nvarchar(80),
NCO_UDFNUM01                numeric(24,6),
NCO_UDFNUM02                numeric(24,6),
NCO_UDFNUM03                numeric(24,6),
NCO_UDFNUM04                numeric(24,6),
NCO_UDFNUM05                numeric(24,6),
NCO_UDFDATE01               datetime,
NCO_UDFDATE02               datetime,
NCO_UDFDATE03               datetime,
NCO_UDFDATE04               datetime,
NCO_UDFDATE05               datetime,
NCO_UDFCHKBOX01             nvarchar(1) default '-',
NCO_UDFCHKBOX02             nvarchar(1) default '-',
NCO_UDFCHKBOX03             nvarchar(1) default '-',
NCO_UDFCHKBOX04             nvarchar(1) default '-',
NCO_UDFCHKBOX05             nvarchar(1) default '-',
NCO_UPDATECOUNT             numeric(38) default 0,
NCO_HISTORYFLAG             nvarchar(1),
DMLTYPE nchar(1) NULL DEFAULT ('N'),
PRIMARY KEY (NCO_PK)
);

CREATE TABLE R5LINEARDIRECTIONS (
LDR_DIRECTION NVARCHAR (8) NOT NULL,
LDR_OPPOSITEDIRECTION NVARCHAR (8),
LDR_NOTE NVARCHAR (256),
DMLTYPE NCHAR(1) NULL DEFAULT ('N'),
PRIMARY KEY(LDR_DIRECTION)
);

ALTER TABLE R5OBJLINEARREF add column LRF_FROM_REFERENCE number(38);
ALTER TABLE R5OBJLINEARREF add column LRF_FROM_OFFSET numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_FROM_OFFSET_PERCENTAGE numeric(5,2);
ALTER TABLE R5OBJLINEARREF add column LRF_FROM_OFFSET_DIRECTION NVARCHAR (8);
ALTER TABLE R5OBJLINEARREF add column LRF_FROM_XCOORDINATE numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_FROM_YCOORDINATE numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_FROM_LATITUDE numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_FROM_LONGITUDE numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_TO_REFERENCE number(38);
ALTER TABLE R5OBJLINEARREF add column LRF_TO_OFFSET numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_TO_OFFSET_PERCENTAGE numeric(5,2);
ALTER TABLE R5OBJLINEARREF add column LRF_TO_OFFSET_DIRECTION NVARCHAR (8);
ALTER TABLE R5OBJLINEARREF add column LRF_TO_XCOORDINATE numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_TO_YCOORDINATE numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_TO_LATITUDE numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_TO_LONGITUDE numeric(24,6);
ALTER TABLE R5OBJLINEARREF add column LRF_BRANCH_POINT NVARCHAR (1);
ALTER TABLE R5OBJLINEARREF add column LRF_IDENTIFIER NVARCHAR (80);
ALTER TABLE R5OBJLINEARREF add column LRF_BRANCH_DIRECTION NVARCHAR (8);
ALTER TABLE R5OBJLINEARREF add column LRF_LINEAR_REFTYPE NVARCHAR (1);
ALTER TABLE R5OBJLINEARREF add column LRF_POINTREFERENCE NVARCHAR (1);
ALTER TABLE R5OBJLINEARREF add column LRF_OVERVIEWSEQUENCE number (3);
ALTER TABLE R5OBJLINEARREF add column lrf_applytorouterow NVARCHAR (1); 

ALTER TABLE R5EVENTS add column EVT_FROM_REFERENCE number(38);
ALTER TABLE R5EVENTS add column EVT_FROM_OFFSET numeric(24,6);
ALTER TABLE R5EVENTS add column EVT_FROM_OFFSET_PERCENTAGE numeric(5,2);
ALTER TABLE R5EVENTS add column EVT_FROM_OFFSET_DIRECTION NVARCHAR (8);
ALTER TABLE R5EVENTS add column EVT_TO_REFERENCE number(38);
ALTER TABLE R5EVENTS add column EVT_TO_OFFSET numeric(24,6);
ALTER TABLE R5EVENTS add column EVT_TO_OFFSET_PERCENTAGE numeric(5,2);
ALTER TABLE R5EVENTS add column EVT_TO_OFFSET_DIRECTION NVARCHAR (8);
ALTER TABLE R5EVENTS add column EVT_RELATIONSHIP_TYPE NVARCHAR(8);
ALTER TABLE R5EVENTS add column EVT_SCHEDGRP NVARCHAR(30);
ALTER TABLE R5EVENTS add column EVT_PPOINCLUDENONCONFORMITIES NVARCHAR(1);


ALTER TABLE R5OBJECTS add column OBJ_DIRECTION nvarchar(8);
ALTER TABLE R5OBJECTS add column OBJ_LINEAROBJTYPE nvarchar(8);
ALTER TABLE R5OBJECTS add column OBJ_LINEARCOSTWEIGHT  numeric(6,0);
ALTER TABLE R5OBJECTS add column OBJ_ESUSER NVARCHAR (40);
ALTER TABLE R5OBJECTS add column OBJ_ESPASSWORD NVARCHAR (12);
ALTER TABLE R5OBJECTS add column OBJ_ESTYPE NVARCHAR (8);
ALTER TABLE R5OBJECTS add column OBJ_ESCERTNUM NVARCHAR (20);
ALTER TABLE R5OBJECTS add column OBJ_ESCERTTYPE NVARCHAR (8);
ALTER TABLE R5OBJECTS add column OBJ_EXTERNALDATE DATETIME;


CREATE TABLE R5GISDATAMAPS(
GMP_MAPPINGID numeric(38, 0) NOT NULL,
GMP_LAYERNAME nvarchar(60) NULL,
GMP_LAYERATTRIBUTE nvarchar(64) NULL,
GMP_LAYERCONSTANT nvarchar(1000) NULL,
GMP_ASSETATTRIBUTE nvarchar(64) NULL,
GMP_ASSETCONSTANT nvarchar(1000) NULL,
GMP_ACTION nvarchar(1) NULL,
GMP_OWNER nvarchar(1) NULL,
GMP_SEQUENCE int NULL,
GMP_DELIMITER nvarchar(10) NULL,
GMP_SOURCE nvarchar(1) NULL,
GMP_LRS nvarchar(1) NULL,
GMP_TYPE nvarchar(8) NULL,
GMP_GRIDLOOKUPNAME nvarchar(40) NULL,
GMP_ASSETATTRIBUTELABEL nvarchar(100),
GMP_XPATH nvarchar(100),
DMLTYPE NCHAR(1) NULL DEFAULT ('N'),
PRIMARY KEY(GMP_MAPPINGID)
);

ALTER TABLE r5listentity ADD COLUMN let_clearcondition NVARCHAR(200) NULL;

ALTER TABLE R5PARTS ADD COLUMN PAR_IMPORTANCE NVARCHAR(8); 
ALTER TABLE R5PARTS ADD COLUMN PAR_MATERIALTYPE NVARCHAR(8);

CREATE TABLE R5NONCONFORMITYSETUP(
NCP_ORG       nvarchar(15) NOT NULL,
NCP_PROTECTHEADER    nvarchar(1),
NCP_PROTECTOBSDATAONHDR    nvarchar(1),
NCP_SYNCHRONIZE      nvarchar(1),
NCP_USEOBSSTATUS     nvarchar(4),
NCP_SUPERSEDEDSTATUS nvarchar(4),
NCP_REINSPECTSTATUS  nvarchar(4),
NCP_AUTOAPPROVESTATUS      nvarchar(4),
NCP_AUTOSKIPSTATUS   nvarchar(4),
NCP_INCLUDECONDITION nvarchar(1),
NCP_PREVOBSCOUNT     numeric(24,6),
DMLTYPE NCHAR(1) NULL DEFAULT ('N'),
PRIMARY KEY(NCP_ORG)
);

DELETE FROM "R5SYSCOLUMNS" WHERE TABLE_NAME = 'R5NONCONFORMITIES';
INSERT INTO "R5SYSCOLUMNS" VALUES('R5NONCONFORMITIES','NCF_CODE','+',NULL,NULL,NULL,NULL,NULL,NULL,'N');
INSERT INTO "R5SYSCOLUMNS" VALUES('R5NONCONFORMOBSERVATIONS','NCO_PK','+',NULL,NULL,NULL,NULL,NULL,NULL,'N');
INSERT INTO "R5SYSCOLUMNS" VALUES('R5LINEARDIRECTIONS','LDR_DIRECTION','+',NULL,NULL,NULL,NULL,NULL,NULL,'N');
INSERT INTO "R5SYSCOLUMNS" VALUES('R5GISDATAMAPS','GMP_MAPPINGID','+',NULL,NULL,NULL,NULL,NULL,NULL,'N');
INSERT INTO "R5SYSCOLUMNS" VALUES('R5NONCONFORMITYSETUP','NCP_ORG','+',NULL,NULL,NULL,NULL,NULL,NULL,'N');

INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('WCNOCO_IPAD',211,0,3,'WCNOCF','R5NONCONFORMOBSERVATIONS',NULL,'-','-');
INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('OCLDSE_IPAD',212,0,3,'OCLREF','R5LINEARDIRECTIONS',NULL,'-','-');


INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('OCNOCF_IPAD',213,0,3,'OCNOCF','R5NONCONFORMITIES',NULL,'-','-');
INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('OCNOCO_IPAD',214,0,3,'OCNOCF','R5NONCONFORMOBSERVATIONS',NULL,'-','-');
INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('BCCOMOBJNOCO_IPAD',215,0,3,'OCNOCF','R5ADDETAILS',NULL,'-','-');
INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('BCDOCOBJNOCO_IPAD',216,0,3,'OCNOCF','R5DOCUMENTS',NULL,'-','-');
INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('BCCOMOBJNOCF_IPAD',217,0,3,'OCNOCF','R5ADDETAILS',NULL,'-','-');
INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('BCDOCOBJNOCF_IPAD',218,0,3,'OCNOCF','R5DOCUMENTS',NULL,'-','-');
INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('WCNCSP_IPAD',219,0,3,'WCNOCF','R5NONCONFORMITYSETUP',NULL,'-','-');

INSERT INTO R5LISTENTITY(LET_DATAGRID,LET_SEQNO,LET_GROUPID,LET_DELINSUPD,LET_FILTER,LET_TABLENAME,LET_ORGKEY,LET_CONNECTEDMODE,LET_ALWAYSDOWNLOAD)
VALUES('OCGGMP_IPAD',220,0,3,NULL,'R5GISDATAMAPS',NULL,'-','-');

UPDATE R5LISTENTITY SET LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID = 'WCNOCF_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID = 'WCNOCO_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID = 'OCNCTP_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID = 'OCNCNTP_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID = 'OCNCMTS_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID = 'OCNCNTE_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID = 'OCCSMS_IPAD';
UPDATE R5LISTENTITY SET LET_DATAGRID = 'BCCOMWONOCO_IPAD', LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID = 'BCCOMWONOCF_IPAD';
UPDATE R5LISTENTITY SET LET_DATAGRID = 'BCDOCWONOCO_IPAD', LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID = 'BCDOCWONOCF_IPAD';
UPDATE R5LISTENTITY SET LET_DATAGRID = 'BCPROMWONOCO_IPAD', LET_FILTER = 'WCNOCF' WHERE LET_DATAGRID =  'NEW_BCPROMNOCF_IPAD';

UPDATE R5LISTENTITY SET LET_FILTER = 'OCINVP' WHERE LET_DATAGRID = 'OCINVR_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'OCINVP' WHERE LET_DATAGRID = 'OCINVP_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'OCINVP' WHERE LET_DATAGRID = 'OCINVDEL_IPAD';

UPDATE R5LISTENTITY SET LET_FILTER = 'OCLREF' WHERE LET_DATAGRID = 'OCEQLREF_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'OCLREF' WHERE LET_DATAGRID = 'OCEVTOBJ_IPAD';
UPDATE R5LISTENTITY SET LET_FILTER = 'OCLREF' WHERE LET_DATAGRID = 'OCULPREF_IPAD';

DELETE FROM R5LISTENTITY WHERE LET_DATAGRID='BCCOMOBJHISTWO_IPAD';

UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''STWO''' WHERE LET_DATAGRID='BCCOMST';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''TASK''' WHERE LET_DATAGRID='BCCOMTSK';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''EVNT'' AND ADD_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='BCCOMWO';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''OBJ'' AND ADD_FLAG=''+''' WHERE LET_DATAGRID='BCCOMOBJ';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''OBJ'' AND ADD_FLAG=''-''' WHERE LET_DATAGRID='BCCOMOBJWO';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''NOCO'' AND ADD_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='BCCOMWONOCO_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''NOCO'' AND ADD_HISTORYFLAG=''+''' WHERE LET_DATAGRID='BCCOMOBJNOCO_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''NOCF'' AND ADD_HISTORYFLAG=''+''' WHERE LET_DATAGRID='BCCOMOBJNOCF_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''TCLI''' WHERE LET_DATAGRID='BCCOMTCLI_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''PPM''' WHERE LET_DATAGRID='BCCOMPPM_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''EVNT'' AND ADD_HISTORYFLAG=''-''' WHERE LET_DATAGRID='OCJOBHW_ADD_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ADD_RENTITY=''EVNT'' AND ADD_HISTORYFLAG=''+''' WHERE LET_DATAGRID='OCJOBHO_ADD_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND DOC_RENTITY=''EVNT'' AND DOC_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='BCDOCWO_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND DOC_RENTITY=''OBJ''' WHERE LET_DATAGRID='BCDOCOBJ_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND DOC_RENTITY=''NOCO'' AND DOC_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='BCDOCWONOCO_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND DOC_RENTITY=''NOCO'' AND DOC_HISTORYFLAG=''+''' WHERE LET_DATAGRID='BCDOCOBJNOCO_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND DOC_RENTITY=''NOCF'' AND DOC_HISTORYFLAG=''+''' WHERE LET_DATAGRID='BCDOCOBJNOCF_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND DOC_RENTITY=''EVNT'' AND DOC_HISTORYFLAG=''-''' WHERE LET_DATAGRID='OCJOBHW_DOC_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND DOC_RENTITY=''EVNT'' AND DOC_HISTORYFLAG=''+''' WHERE LET_DATAGRID='OCJOBHO_DOC_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND OBJ_OBRTYPE IN(''A'',''S'',''P'',''L'')' WHERE LET_DATAGRID='OCOBJC_FULL_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND OBJ_OBRTYPE IN(''C'')' WHERE LET_DATAGRID='OCCATLOC_FULL_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND PRV_RENTITY=''EVNT'' AND PRV_CODE <> ''*'' AND PRV_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='BCPROMWO';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND PRV_CODE = ''*'' AND PRV_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='BCPROMV_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND PRV_RENTITY=''OBJ'' AND PRV_FLAG=''+'' AND PRV_CODE <> ''*''' WHERE LET_DATAGRID='BCPROMOBJ';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND PRV_RENTITY=''OBJ'' AND PRV_FLAG=''-'' AND PRV_CODE <> ''*''' WHERE LET_DATAGRID='BCPROMOBJWO';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND PRV_RENTITY=''SWCF'' AND PRV_CODE <> ''*''' WHERE LET_DATAGRID='BCPROMST';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND PRV_RENTITY=''NOCO'' AND PRV_CODE <> ''*'' AND PRV_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='BCPROMWONOCO_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND PRV_RENTITY=''EVNT'' AND PRV_HISTORYFLAG=''-''' WHERE LET_DATAGRID='OCJOBHW_PRV_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND PRV_RENTITY=''EVNT'' AND PRV_HISTORYFLAG=''+'' ' WHERE LET_DATAGRID='OCJOBHO_PRV_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND TRA_RTYPE=''I''' WHERE LET_DATAGRID='WCTRAN';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND TRA_RTYPE=''STTK''' WHERE LET_DATAGRID='SCPHYS_FULL_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND 1 = 2' WHERE LET_DATAGRID like '%_MEC%';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND EVT_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='WCJOBS_FULL_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND EVT_HISTORYFLAG=''-''' WHERE LET_DATAGRID='OCJOBHW_EVT_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND EVT_HISTORYFLAG=''+''' WHERE LET_DATAGRID='OCJOBHO_EVT_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ACT_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='WCACTJ_FULL_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ACT_HISTORYFLAG=''-''' WHERE LET_DATAGRID='OCJOBHW_ACT_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND ACT_HISTORYFLAG=''+''' WHERE LET_DATAGRID='OCJOBHO_ACT_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND NCF_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='WCNOCF_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND NCO_HISTORYFLAG IS NULL' WHERE LET_DATAGRID='WCNOCO_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND NCF_HISTORYFLAG=''+''' WHERE LET_DATAGRID='OCNOCF_IPAD';
UPDATE R5LISTENTITY SET LET_CLEARCONDITION='AND NCO_HISTORYFLAG=''+''' WHERE LET_DATAGRID='OCNOCO_IPAD';


UPDATE r5configsettings  SET CFS_XMLCONFIG='{"sections": [{"name": "Nonconformity","fields": [{ "id": "NCO_PK","lbl": "Observation PK","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_CODE","lbl": "Nonconformity","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_DESC","lbl": "Description","type": "CHAR","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_ORG","lbl": "Organization","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"}]},
{"name": "Nonconformity Details","fields": [{"id": "NCO_OBSERVATION","lbl": "Observation","type": "NUM","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_OBJECT","lbl": "Equipment","type": "LOV-2","def": "","ro": "NO","rq": "YES","len": "30","hid": "NO"},
{"id": "NCF_OBJECT_CRITICALITY","lbl": "Equipment Criticality","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_OBJECT_SAFETY","lbl": "Equipment Safety","type": "BOOL","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_LOCATION","lbl": "Location","type": "LOV-2","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_PART","lbl": "Part","type": "LOV-2","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_MRC","lbl": "Department","type": "LOV-2","def": "","ro": "NO","rq": "YES","len": "30","hid": "NO"},
{"id": "NCF_CLASS","lbl": "Class","type": "LOV-1","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_CLASS_ORG","lbl": "Class Organization","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCO_TASK","lbl": "Task Plan for Checklist","type": "LOV-1","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCO_TASKREV","lbl": "Task Plan for Checklist Revision","type": "NUM","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_SYSLEVEL_DISP","lbl": "System Level","type": "LOV-1","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_ASMLEVEL_DISP","lbl": "Assembly Level","type": "LOV-1","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_COMPLEVEL_DISP","lbl": "Component Level","type": "LOV-1","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_EMRS_DESC","lbl": "EMRS Description","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_MATLTYPE","lbl": "Material Type","type": "PICKER","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCO_STATUS","lbl": "Observation Status","type": "PICKER","def": "","ro": "NO","rq": "YES","len": "30","hid": "NO"},
{"id": "NCF_NCTTYPE","lbl": "Type","type": "LOV-2","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_PRIORITY","lbl": "Priority","type": "PICKER","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCO_NOTE","lbl": "Note","type": "MEMO-1","def": "","ro": "NO","rq": "NO","len": "256","hid": "NO"},
{"id": "NCO_SEVERITY","lbl": "Severity","type": "PICKER","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCO_SIZE","lbl": "Size","type": "NUM","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCO_INTENSITY","lbl": "Intensity","type": "PICKER","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCO_IMPORTANCE","lbl": "Importance","type": "PICKER","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_STATUS","lbl": "Status","type": "PICKER","def": "","ro": "NO","rq": "YES","len": "30","hid": "NO"},
{"id": "NCF_SEVERITY","lbl": "Nonconformity Severity","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_INTENSITY","lbl": "Nonconformity Intensity","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_SIZE","lbl": "Nonconformity Size","type": "NUM","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_IMPORTANCE","lbl": "Nonconformity Importance","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_CONDITIONSCORE","lbl": "Nonconformity Condition Score","type": "NUM","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_CONDITIONINDEX","lbl": "Nonconformity Condition Index","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"}]},
{"name": "Tracking Details","fields": [{"id": "NCO_RECORDEDBY","lbl": "Recorded By","type": "LOV-1","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCO_RECORDED","lbl": "Date Recorded","type": "DATI","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCO_CONDITIONSCORE","lbl": "Condition Score","type": "NUM","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCO_CONDITIONINDEX","lbl": "Condition Index","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCO_NEXTINSPECTDATE","lbl": "Next Inspection Date","type": "DATE","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCO_NEXTINSPECTDATEOVERRIDE","lbl": "Next Inspection Date Override","type": "DATE","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_RECOMMREPAIRDATE","lbl": "Recomended Repair Date","type": "DATE","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_ESTLABORCOST","lbl": "Estimated Labor Costs","type": "NUMDESC","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_ESTMATLCOST","lbl": "Estimated Material Costs","type": "NUMDESC","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_ESTMISCCOST","lbl": "Estimated Misc Costs","type": "NUMDESC","def": "","ro": "NO","rq": "NO","len": "30","hid": "NO"},
{"id": "NCF_TOTALCOST","lbl": "Total Estimated Costs","type": "NUMDESC","def": "","ro": "YES","rq": "NO","len": "30","hid": "NO"},
{"id": "NCO_WORKORDER","lbl": "Work Order","type": "CHAR","def": "","ro": "YES", "rq": "NO","len": "80","hid": "NO"},
{"id": "NCO_CREATEDBY","lbl": "Created By","type": "CHAR","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCO_CREATED","lbl": "Date Created","type": "DATE","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCO_UPDATEDBY","lbl": "Updated By", "type": "CHAR","def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"},
{"id": "NCO_UPDATED","lbl": "Date Updated","type": "DATE", "def": "","ro": "YES","rq": "NO","len": "80","hid": "NO"}]},
{"name": "Linear Reference Details","fields": [{"id": "NCF_FROMPOINT","lbl": "From Point","type": "LOV-3","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_FROMREFDESC","lbl": "From Point Ref. Description","type": "CHAR","def": "","ro": "NO","rq": "NO","len": "80", "hid": "NO"},
{"id": "NCF_FROMGEOREF","lbl": "From Point Geographical Ref.","type": "CHAR","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_TOPOINT","lbl": "To Point", "type": "LOV-3","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_TOREFDESC","lbl": "To Point Ref. Description","type": "CHAR","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_TOGEOREF","lbl": "To Point Geographical Ref.","type": "CHAR","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_INSPECTIONDIRECTION","lbl": "Inspection Direction","type": "PICKER","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"},
{"id": "NCF_FLOW","lbl": "Flow","type": "PICKER","def": "","ro": "NO","rq": "NO","len": "80","hid": "NO"}]}]}' WHERE CFS_CODE='TCNCF_IPAD';

update r5configsettings set CFS_XMLCONFIG='{
"sections":[ 
{ 
"name":"Work Order",
"fields":[ 
{ 
"id":"EVT_CODE",
"lbl":"Work Order",
"type":"CHAR",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"30",
"hid":"NO"
},
{ 
"id":"EVT_DESC",
"lbl":"Description",
"type":"CHAR",
"def":"",
"ro":"NO",
"rq":"YES",
"len":"80",
"hid":"NO"
},
{ 
"id":"EVT_OBJECT",
"lbl":"Equipment",
"type":"LOV-2",
"def":"",
"ro":"NO",
"rq":"YES",
"len":"30",
"hid":"NO"
},
{ 
"id":"EVT_STANDWORK",
"lbl":"Standard WO",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"20",
"hid":"NO"
},
{ 
"id":"EVT_JOBTYPE",
"lbl":"Type",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"YES",
"len":"8",
"hid":"NO"
},
{ 
"id":"EVT_MRC",
"lbl":"Department",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"YES",
"len":"15",
"hid":"NO"
},
{ 
"id":"EVT_STATUS",
"lbl":"Status",
"type":"PICKER",
"def":"",
"ro":"NO",
"rq":"YES",
"len":"8",
"hid":"NO"
},
{ 
"id":"EVT_SAFETY",
"lbl":"Safety",
"type":"BOOL",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"2",
"hid":"NO"
},
{ 
"id":"EVT_WARRANTY",
"lbl":"Warranty",
"type":"BOOL",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"2",
"hid":"NO"
},
{ 
"id":"EVT_MULTIEQUIP",
"lbl":"Multiple Equipment",
"type":"BOOL",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"2",
"hid":"YES"
}
]
},
{ 
"name":"Linear Reference Details",
"hid":"YES",
"ro":"YES",
"mode":"CON",
"fields":[ 
{ 
"id":"EVT_FROMPOINT",
"lbl":"From Point",
"type":"LOV-3",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"30",
"hid":"NO"
},
{ 
"id":"EVT_FROMREFDESC",
"lbl":"Ref. Description",
"type":"CHAR",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"80",
"hid":"NO"
},
{ 
"id":"EVT_FROMGEOREF",
"lbl":"Geographical Ref.",
"type":"CHAR",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"80",
"hid":"NO"
},
{ 
"id":"EVT_TOPOINT",
"lbl":"To Point",
"type":"LOV-3",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"30",
"hid":"NO"
},
{ 
"id":"EVT_TOREFDESC",
"lbl":"Ref. Description",
"type":"CHAR",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"80",
"hid":"NO"
},
{ 
"id":"EVT_TOGEOREF",
"lbl":"Geographical Ref.",
"type":"CHAR",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"80",
"hid":"NO"
},
{ 
"id":"EVT_INSPECTIONDIRECTION",
"lbl":"Inspection Direction",
"type":"PICKER",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"30",
"hid":"NO"
},
{ 
"id":"EVT_FLOW",
"lbl":"Flow",
"type":"PICKER",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"30",
"hid":"NO"
},
{ 
"id":"EVT_RELATIONSHIP_TYPE",
"lbl":"Relationship Type",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"30",
"hid":"YES"
},
{ 
"id":"EVT_FROM_REFERENCE_POINT",
"lbl":"From Reference Point",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"100",
"hid":"YES"
},
{ 
"id":"EVT_FROM_OFFSET",
"lbl":"From Offset",
"type":"NUM",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"24",
"hid":"YES"
},
{ 
"id":"EVT_FROM_OFFSET_PERCENTAGE",
"lbl":"From Offset %",
"type":"NUM",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"5",
"hid":"YES"
},
{ 
"id":"EVT_FROM_OFFSET_DIRECTION",
"lbl":"From Offset Direction",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"80",
"hid":"YES"
},
{ 
"id":"EVT_FROM_LR_REFERENCE",
"lbl":"From Reference",
"type":"CHAR",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"80",
"hid":"YES"
},
{ 
"id":"EVT_FROM_LR_OFFSET",
"lbl":"From Ref. Offset",
"type":"CHAR",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"24",
"hid":"YES"
},
{ 
"id":"EVT_FROM_LR_OFFSET_DIRECTION",
"lbl":"From Ref. Offset Direction",
"type":"CHAR",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"80",
"hid":"YES"
},
{ 
"id":"EVT_TO_REFERENCE_POINT",
"lbl":"To Reference Point",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"100",
"hid":"YES"
},
{ 
"id":"EVT_TO_OFFSET",
"lbl":"To Offset",
"type":"NUM",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"24",
"hid":"YES"
},
{ 
"id":"EVT_TO_OFFSET_PERCENTAGE",
"lbl":"To Offset %",
"type":"NUM",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"5",
"hid":"YES"
},
{ 
"id":"EVT_TO_OFFSET_DIRECTION",
"lbl":"To Offset Direction",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"80",
"hid":"YES"
},
{ 
"id":"EVT_TO_LR_REFERENCE",
"lbl":"To Reference",
"type":"CHAR",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"80",
"hid":"YES"
},
{ 
"id":"EVT_TO_LR_OFFSET",
"lbl":"To Ref. Offset",
"type":"CHAR",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"24",
"hid":"YES"
},
{ 
"id":"EVT_TO_LR_OFFSET_DIRECTION",
"lbl":"To Ref. Offset Direction",
"type":"CHAR",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"80",
"hid":"YES"
}
]
},
{ 
"name":"Scheduling",
"fields":[ 
{ 
"id":"EVT_PERSON",
"lbl":"Assigned To",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"15",
"hid":"NO"
},
{ 
"id":"EVT_TARGET",
"lbl":"Sched. Start Date",
"type":"DATE",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"80",
"hid":"NO"
},
{ 
"id":"EVT_DUE",
"lbl":"Sched. End Date",
"type":"DATE",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"80",
"hid":"NO"
},
{ 
"id":"EVT_REPORTED",
"lbl":"Date Reported",
"type":"DATI",
"def":"",
"ro":"NO",
"rq":"YES",
"len":"80",
"hid":"NO"
}
]
},
{ 
"name":"Work Order Details",
"fields":[ 
{ 
"id":"EVT_LOCATION",
"lbl":"Location",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"30",
"hid":"NO"
},
{ 
"id":"EVT_CLASS",
"lbl":"Class",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"8",
"hid":"NO"
},
{ 
"id":"EVT_COSTCODE",
"lbl":"Cost Code",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"30",
"hid":"NO"
},
{ 
"id":"EVT_PRIORITY",
"lbl":"Priority",
"type":"PICKER",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"8",
"hid":"NO"
},
{ 
"id":"EVT_REQM",
"lbl":"Problem Code",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"8",
"hid":"NO"
},
{ 
"id":"EVT_PARENT",
"lbl":"Parent WO",
"type":"LOV-1",
"def":"",
"ro":"NO",
"rq":"NO",
"len":"30",
"hid":"NO"
},
{ 
"id":"EVT_OBJCRITICALITY",
"lbl":"Criticality",
"type":"CHAR",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"8",
"hid":"NO"
},
{ 
"id":"EVT_METUOM",
"lbl":"Meter",
"type":"CHAR",
"def":"",
"ro":"YES",
"rq":"NO",
"len":"30",
"hid":"NO"
}
]
}
]
}
' where cfs_code='TCJOBR_IPAD' and cfs_group='*';

update r5configsettings set CFS_XMLCONFIG='{
"sections": [{
"name": "Equipment",
"fields": [{
"id": "OBJ_OBTYPE",
"lbl": "Type",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "YES",
"len": "30",
"hid": "NO"
}, {
"id": "OBJ_CODE",
"lbl": "Equipment",
"type": "CHAR",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
}, {
"id": "OBJ_DESC",
"lbl": "Description",
"type": "CHAR",
"def": "",
"ro": "NO",
"rq": "YES",
"len": "80",
"hid": "NO"
}, {
"id": "OBJ_ORG",
"lbl": "Organization",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "YES",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_STATUS",
"lbl": "Status",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "YES",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_MRC",
"lbl": "Department",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "YES",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_CLASS",
"lbl": "Class",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_CATEGORY",
"lbl": "Category",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_COSTCODE",
"lbl": "Cost Code",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_COMMISS",
"lbl": "Commission Date",
"type": "DATE",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_CRITICALITY",
"lbl": "Criticality",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_DORMSTART",
"lbl": "Dormant Start",
"type": "DATE",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_DORMEND",
"lbl": "Dormant End",
"type": "DATE",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_SYSLEVEL",
"lbl": "System Level",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_ASMLEVEL",
"lbl": "Assembly Level",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_COMPLEVEL",
"lbl": "Component Level",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_VMRS_DESC",
"lbl": "VMRS Description",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "NO"
}, {
"id": "OBJ_COMPLOCATION",
"lbl": "Component Location",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
}, {
"id": "OBJ_PROFILE",
"lbl": "Profile",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_SAFETY",
"lbl": "Safety",
"type": "BOOL",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_NOTUSED",
"lbl": "Out of Service",
"type": "BOOL",
"def": "",
"ro": "NO",
"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": "Part Association",
"fields": [{
"id": "OBJ_PART",
"lbl": "Part",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_STORE",
"lbl": "Store",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_BIN",
"lbl": "Bin",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_LOT",
"lbl": "Lot",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "15",
"hid": "NO"
}]
}, {
"name": "Hierarchy",
"fields": [{
"id": "OBJ_PARENT",
"lbl": "Parent Asset",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
}, {
"id": "OBJ_PARENT_DEPEND",
"lbl": "Dependent",
"type": "BOOL",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "2",
"hid": "NO"
}, {
"id": "OBJ_PARENT_COST_ROLL_UP",
"lbl": "Cost Roll-up",
"type": "BOOL",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "2",
"hid": "NO"
}, {
"id": "OBJ_POSITION",
"lbl": "Position",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
}, {
"id": "OBJ_POSITION_DEPEND",
"lbl": "Dependent",
"type": "BOOL",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "2",
"hid": "NO"
}, {
"id": "OBJ_POSITION_COST_ROLL_UP",
"lbl": "Cost Roll-up",
"type": "BOOL",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "2",
"hid": "NO"
}, {
"id": "OBJ_LOCATION",
"lbl": "Location",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
}, {
"id": "OBJ_PRIMARYSYSTEM",
"lbl": "Primary System",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
}, {
"id": "OBJ_PRIMARYSYSTEM_DEPEND",
"lbl": "Dependent",
"type": "BOOL",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "2",
"hid": "NO"
}, {
"id": "OBJ_PRIMARYSYSTEM_COST_ROLL_UP",
"lbl": "Cost Roll-up",
"type": "BOOL",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "2",
"hid": "NO"
}]
}, {
"name": "GIS Details",
"fields": [{
"id": "OBJ_GISOBJID",
"lbl": "GIS ID",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "38",
"hid": "NO"
}, {
"id": "OBJ_GISLAYER",
"lbl": "Layer",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "60",
"hid": "NO"
}, {
"id": "OBJ_GISMAP",
"lbl": "Map",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "NO"
}, {
"id": "OBJ_GISMAP_ORG",
"lbl": "Map Org.",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "15",
"hid": "NO"
}, {
"id": "OBJ_XLOCATION",
"lbl": "Location X",
"type": "NUM",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "24",
"hid": "NO"
}, {
"id": "OBJ_YLOCATION",
"lbl": "Location Y",
"type": "NUM",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "24",
"hid": "NO"
}]
}, {
"name": "Linear Reference Details",
"fields": [{
"id": "OBJ_LENGTH",
"lbl": "Equipment Length",
"type": "NUM",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "24",
"hid": "NO"
}, {
"id": "OBJ_LENGTHUOM",
"lbl": "Equip. Length UOM",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "10",
"hid": "NO"
}, {
"id": "OBJ_LINEARREFUOM",
"lbl": "Linear Ref. UOM",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "10",
"hid": "NO"
}, {
"id": "OBJ_LINEARREFPRECISION",
"lbl": "Ref. Precision",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "2",
"hid": "NO"
}, {
"id": "OBJ_GEOREF",
"lbl": "Geographical Ref.",
"type": "CHAR",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "1000",
"hid": "NO"
}, {
"id": "OBJ_INSPECTIONDIRECTION",
"lbl": "Inspection Direction",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
}, {
"id": "OBJ_FLOW",
"lbl": "Flow",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "OBJ_DIRECTION",
"lbl": "Direction",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "OBJ_LINEAROBJTYPE",
"lbl": "Linear Equipment Type",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
}, {
"id": "OBJ_FROMPOINT",
"lbl": "From Point",
"type": "NUMDESC",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "24",
"hid": "YES"
}, {
"id": "OBJ_TOPOINT",
"lbl": "To Point",
"type": "NUMDESC",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "24",
"hid": "YES"
}, {
"id": "OBJ_LINEARCOSTWEIGHT",
"lbl": "Linear Cost Weight",
"type": "NUM",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "6",
"hid": "YES"
}, {
"id": "OBJ_LENGTH_OVERRIDE",
"lbl": "Equipment Length Override",
"type": "BOOL",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "6",
"hid": "YES"
}]
}]
}' where cfs_code='TCOBJA_IPAD' and cfs_group='*';

update r5configsettings set CFS_XMLCONFIG='{"sections":[{ "name":"Equipment", "fields":[{"id":"EVT_OBJECT", "lbl":"Equipment", "type":"LOV-1", "def":"", "ro":"NO", "rq":"YES", "len":"30", "hid":"NO" }, {"id":"EVT_OBJECT_DESC", "lbl":"Description", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"80", "hid":"NO" }, {"id":"EVT_OBTYPE", "lbl":"Type", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"8", "hid":"YES" }, {"id":"EVT_MRC", "lbl":"Department", "type":"LOV-1", "def":"", "ro":"NO", "rq":"YES", "len":"15", "hid":"YES" }, {"id":"EVT_LOCATION", "lbl":"Location", "type":"LOV-1", "def":"", "ro":"NO", "rq":"NO", "len":"30", "hid":"YES" }, {"id":"EVT_COSTCODE", "lbl":"Cost Code", "type":"LOV-1", "def":"", "ro":"NO", "rq":"NO", "len":"30", "hid":"YES" }, {"id":"EVT_SAFETY", "lbl":"Safety", "type":"BOOL", "def":"", "ro":"NO", "rq":"NO", "len":"2", "hid":"YES" }, {"id":"EVT_WARRANTY", "lbl":"Warranty", "type":"BOOL", "def":"", "ro":"NO", "rq":"NO", "len":"2", "hid":"YES" },{"id":"EVT_CODE", "lbl":"Related Work Order", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"30", "hid":"YES" }, {"id":"EVT_STATUS", "lbl":"Status", "type":"CHAR", "def":"", "ro":"YES", "rq":"NO", "len":"8", "hid":"YES" },{"id":"EVT_FROMPOINT","lbl":"From Point","type":"LOV-3","def":"","ro":"NO","rq":"NO","len":"30","hid":"NO"},{"id":"EVT_FROMREFDESC","lbl":"Ref. Description","type":"CHAR","def":"","ro":"NO","rq":"NO","len":"80","hid":"NO"},{"id":"EVT_FROMGEOREF","lbl":"Geographical Ref.","type":"CHAR","def":"","ro":"NO","rq":"NO","len":"80","hid":"NO"},{"id":"EVT_TOPOINT","lbl":"To Point","type":"LOV-3","def":"","ro":"NO","rq":"NO","len":"30","hid":"NO"},{"id":"EVT_TOREFDESC","lbl":"Ref. Description","type":"CHAR","def":"","ro":"NO","rq":"NO","len":"80","hid":"NO"},{"id":"EVT_TOGEOREF","lbl":"Geographical Ref.","type":"CHAR","def":"","ro":"NO","rq":"NO","len":"80","hid":"NO"},{"id":"EVT_INSPECTIONDIRECTION","lbl":"Inspection Direction","type":"PICKER","def":"","ro":"NO","rq":"NO","len":"30","hid":"NO"},{"id":"EVT_FLOW","lbl":"Flow", "type":"PICKER","def":"","ro":"NO","rq":"NO","len":"30","hid":"NO"},{"id":"EVT_RELATIONSHIP_TYPE", "lbl":"Relationship Type", "type":"LOV-1", "def":"", "ro":"NO", "rq":"NO", "len":"30", "hid":"YES" }]}]}' where
cfs_code='TCJWOEQR_IPAD' and cfs_group='*';

insert into  r5configsettings (CFS_CODE,CFS_GROUP,CFS_USER,CFS_COMPTYPE,CFS_CONFIG,CFS_XMLCONFIG,CFS_UPDATED,CFS_DESK)
values('TCGNCF_IPAD','*','*','U',1, '{
"sections": [{
"name": "Nonconformity",
"fields": [{
"id": "NCF_ISLINEAR",
"lbl": "Linear",
"type": "BOOL",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "2",
"hid": "NO"
},
{
"id": "NCO_PK",
"lbl": "Observation PK",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_CODE",
"lbl": "Nonconformity",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_DESC",
"lbl": "Description",
"type": "CHAR",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "NO"
},
{
"id": "NCF_ORG",
"lbl": "Organization",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCO_OBSERVATION",
"lbl": "Observation",
"type": "NUM",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_OBJECT",
"lbl": "Equipment",
"type": "LOV-2",
"def": "",
"ro": "NO",
"rq": "YES",
"len": "30",
"hid": "NO"
},
{
"id": "NCF_OBJECT_CRITICALITY",
"lbl": "Equipment Criticality",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_OBJECT_SAFETY",
"lbl": "Equipment Safety",
"type": "BOOL",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_LOCATION",
"lbl": "Location",
"type": "LOV-2",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_PART",
"lbl": "Part",
"type": "LOV-2",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_MRC",
"lbl": "Department",
"type": "LOV-2",
"def": "",
"ro": "NO",
"rq": "YES",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_CLASS",
"lbl": "Class",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_CLASS_ORG",
"lbl": "Class Organization",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCO_TASK",
"lbl": "Task Plan for Checklist",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCO_TASKREV",
"lbl": "Task Plan for Checklist Revision",
"type": "NUM",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_SYSLEVEL_DISP",
"lbl": "System Level",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_ASMLEVEL_DISP",
"lbl": "Assembly Level",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_COMPLEVEL_DISP",
"lbl": "Component Level",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_EMRS_DESC",
"lbl": "EMRS Description",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_MATLTYPE",
"lbl": "Material Type",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCO_STATUS",
"lbl": "Observation Status",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "YES",
"len": "30",
"hid": "NO"
},
{
"id": "NCF_NCTTYPE",
"lbl": "Type",
"type": "LOV-2",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "NCF_PRIORITY",
"lbl": "Priority",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCO_SEVERITY",
"lbl": "Severity",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "NCO_SIZE",
"lbl": "Size",
"type": "NUM",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "NCO_INTENSITY",
"lbl": "Intensity",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "NCO_IMPORTANCE",
"lbl": "Importance",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "NCF_STATUS",
"lbl": "Status",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_SEVERITY",
"lbl": "Nonconformity Severity",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_INTENSITY",
"lbl": "Nonconformity Intensity",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_SIZE",
"lbl": "Nonconformity Size",
"type": "NUM",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_IMPORTANCE",
"lbl": "Nonconformity Importance",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_CONDITIONSCORE",
"lbl": "Nonconformity Condition Score",
"type": "NUM",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCF_CONDITIONINDEX",
"lbl": "Nonconformity Condition Index",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCO_RECORDEDBY",
"lbl": "Recorded By",
"type": "LOV-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCO_RECORDED",
"lbl": "Date Recorded",
"type": "DATI",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCO_CONDITIONSCORE",
"lbl": "Condition Score",
"type": "NUM",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCO_CONDITIONINDEX",
"lbl": "Condition Index",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "YES"
},
{
"id": "NCO_NEXTINSPECTDATE",
"lbl": "Next Inspection Date",
"type": "DATE",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "NO"
},
{
"id": "NCO_NEXTINSPECTDATEOVERRIDE",
"lbl": "Next Inspection Date Override",
"type": "DATE",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "NO"
},
{
"id": "NCF_RECOMMREPAIRDATE",
"lbl": "Recomended Repair Date",
"type": "DATE",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_ESTLABORCOST",
"lbl": "Estimated Labor Costs",
"type": "NUMDESC",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "NCF_ESTMATLCOST",
"lbl": "Estimated Material Costs",
"type": "NUMDESC",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "NCF_ESTMISCCOST",
"lbl": "Estimated Misc Costs",
"type": "NUMDESC",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "NCF_TOTALCOST",
"lbl": "Total Estimated Costs",
"type": "NUMDESC",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "30",
"hid": "NO"
},
{
"id": "NCO_NOTE",
"lbl": "Note",
"type": "MEMO-1",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "256",
"hid": "NO"
},
{
"id": "NCO_WORKORDER",
"lbl": "Work Order",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCO_CREATEDBY",
"lbl": "Created By",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCO_CREATED",
"lbl": "Date Created",
"type": "DATE",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCO_UPDATEDBY",
"lbl": "Updated By",
"type": "CHAR",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCO_UPDATED",
"lbl": "Date Updated",
"type": "DATE",
"def": "",
"ro": "YES",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_FROMPOINT",
"lbl": "From Point",
"type": "LOV-3",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_FROMREFDESC",
"lbl": "From Point Ref. Description",
"type": "CHAR",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_FROMGEOREF",
"lbl": "From Point Geographical Ref.",
"type": "CHAR",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_TOPOINT",
"lbl": "To Point",
"type": "LOV-3",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_TOREFDESC",
"lbl": "To Point Ref. Description",
"type": "CHAR",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_TOGEOREF",
"lbl": "To Point Geographical Ref.",
"type": "CHAR",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_INSPECTIONDIRECTION",
"lbl": "Inspection Direction",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
},
{
"id": "NCF_FLOW",
"lbl": "Flow",
"type": "PICKER",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "YES"
}]
},
{
"name": "COMMENTS",
"sectype": "COMMENTS",
"fields": []
},
{
"name": "PHOTOS",
"sectype": "DOCUMENTS",
"fields": []
},
{
"name": "LOCATION",
"sectype": "LOCATION",
"fields": [{
"id": "BUTTON_LOCATION",
"lbl": "Set Map Location",
"type": "LOCATION",
"def": "",
"ro": "NO",
"rq": "NO",
"len": "80",
"hid": "NO"
}]
}]
}',date('now'),1);

ALTER TABLE R5EVENTOBJECTS add column EOB_EVENT_OBJECT nvarchar(30); 
ALTER TABLE R5EVENTOBJECTS add column EOB_EVENT_STATUS nvarchar(4); 

UPDATE R5APPSETTINGS SET AST_VALUE = '11301' WHERE AST_NAME='DBVERSION';
