Jira Code: APC-21
Created an online form for creating test report custom record from sales order as well as NetSuite centre tab. When creating a test report from sales order the PO number, SO number and Tester field should be automatically populated to the online form and need to disable these fields from editing from the UI.
APC-7 JJ standalone Test Report
<NLFORM>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Test Report</title>
<!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> -->
</head>
<style>
.req {
color: #E24F3F;
margin-left: 4px;
}
.labels {
font-size: 15px;
font-family: 'Nunito Sans', sans-serif;
color: #2e2e2e;
}
.form-head {
font-size: 34px;
font-weight: bold;
font-family: 'Nunito Sans', sans-serif;
color: #0f3a6b;
}
.form-sub {
font-size: 22px;
font-family: 'Nunito Sans', sans-serif;
color: #2e2e2e;
}
.fullWidth {
width: 100%;
margin-bottom: 10px;
}
.halfWidth {
width: 49%;
display: inline-block;
}
.textAlign {
text-align: center;
}
.totalAlign {
padding: 1% 10%;
}
.textStyle {
color: #0f3a6b;
}
input[type=text],
input[type=number],
textarea,
select {
display: block;
width: 97% !important;
height: 34px;
!important;
padding: 6px 12px;
font-size: 14px !important;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 2px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
#comments {
display: block;
width: 97% !important;
height: 100px !important;
padding: 6px 12px;
font-size: 14px !important;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 2px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.button {
/*background-color: #144796;*/
background-color: white;
/*border: none;*/
border: 2px solid #4CAF50; /* Green */
/*color: white;*/
color: black;
padding: 10px 32px;
font-family: 'Nunito Sans', sans-serif;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.buttonhover {
background-color: #0f3a6b;
color: white;
border: 2px solid #0f3a6b;
}
.buttonhover:hover {
background-color: #1e4e84;
color: white;
}
table,
th,
td {
border: 1px solid #bdbaba;
border-collapse: collapse;
}
th,
td {
padding: 15px;
}
</style>
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans" rel="stylesheet">
<body>
<div class="totalAlign">
<h1 align="center" class="form-head">Test Report</h1>
<!-- <p class="form-sub"> Dear Friend, This is a test html for a custom record in Netsuite</p> -->
<form>
<h3 class="textStyle">Basic Information</h3>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Date</label>
<nlcustrecord_date>
</nlcustrecord_date>
</div>
<div class="halfWidth">
<label class="labels">Tester</label>
<nlcustrecord_tester>
</nlcustrecord_tester>
</div>
</div>
<!-- <div class="fullWidth">
<div class="halfWidth">
<label class="labels">Sales Order #</label>
<nlcustrecord_sales_order_no>
</nlcustrecord_sales_order_no>
</div>
</div>-->
<br>
<h3 class="textStyle">Identification Information</h3>
<div class="fullWidth">
<!-- <div class="halfWidth">
<label class="labels">Customer</label>
<nlcustrecord_customer>
</nlcustrecord_customer>
</div>-->
<!--<div class="halfWidth">
<label class="labels">Purchase Order #</label>
<nlcustrecord_purchase_order_no>
</nlcustrecord_purchase_order_no>
</div>-->
</div>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Manufacturer</label>
<nlcustrecord_manufactuerer>
</nlcustrecord_manufactuerer>
</div>
<div class="halfWidth">
<label class="labels">Model / Part Number</label>
<nlcustrecord_model_part_number>
</nlcustrecord_model_part_number>
</div>
</div>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Poles</label>
<nlcustrecord_poles>
</nlcustrecord_poles>
</div>
<div class="halfWidth">
<label class="labels">Frame Size</label>
<nlcustrecord_frame>
</nlcustrecord_frame>
</div>
</div>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Voltage Max</label>
<nlcustrecord_voltage_max>
</nlcustrecord_voltage_max>
</div>
<div class="halfWidth">
<label class="labels">AIC Rating</label>
<nlcustrecord_aic_rating>
</nlcustrecord_aic_rating>
</div>
</div>
<div class="fullWidth">
<label class="labels">Trip Amp</label>
<nlcustrecord_trip_details>
</nlcustrecord_trip_details>
</div>
<br>
<h3 class="textStyle">Environment Information</h3>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Local Temperature</label>
<nlcustrecord_local_temperature>
</nlcustrecord_local_temperature>
</div>
<div class="halfWidth">
<label class="labels">Local Humidity</label>
<nlcustrecord_local_humidity>
</nlcustrecord_local_humidity>
</div>
</div>
<br>
<h3 class="textStyle">Visual Inspection</h3>
<div class="fullWidth">
<div class="halfWidth">
<div hidden="">
<nlcustrecord_frame_inspected>
</nlcustrecord_frame_inspected>
</div>
<div hidden="">
<nlcustrecord_lugs>
</nlcustrecord_lugs>
</div>
<div hidden="">
<nlcustrecord_arc_chute>
</nlcustrecord_arc_chute>
</div>
<div hidden="">
<nlcustrecord_phase_seperators>
</nlcustrecord_phase_seperators>
</div>
<div hidden="">
<nlcustrecord_contacts>
</nlcustrecord_contacts>
</div>
<div hidden="">
<nlcustrecord_accessories>
</nlcustrecord_accessories>
</div>
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th>Good</th>
<th>Poor</th>
<th>N/A</th>
</tr>
<tr>
<td class="labels">Frame</td>
<td align="center"><input class="radio-btn" type="radio" name="frame" id="frame1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="frame" id="frame2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="frame" id="frame3" value="3"></td>
</tr>
<tr>
<td class="labels">Lugs</td>
<td align="center"><input class="radio-btn" type="radio" name="lugs" id="lugs1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="lugs" id="lugs2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="lugs" id="lugs3" value="3"></td>
</tr>
<tr>
<td class="labels">Arc Chute</td>
<td align="center"><input class="radio-btn" type="radio" name="arcchute" id="arcchute1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="arcchute" id="arcchute2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="arcchute" id="arcchute3" value="3"></td>
</tr>
<tr>
<td class="labels">Phase Separators</td>
<td align="center"><input class="radio-btn" type="radio" name="phoneseparators" id="phoneseparators1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="phoneseparators" id="phoneseparators2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="phoneseparators" id="phoneseparators3" value="3"></td>
</tr>
<tr>
<td class="labels">Contacts</td>
<td align="center"><input class="radio-btn" type="radio" name="contacts" id="contacts1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="contacts" id="contacts2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="contacts" id="contacts3" value="3"></td>
</tr>
<tr>
<td class="labels">Accessories</td>
<td align="center"><input class="radio-btn" type="radio" name="accessories" id="accessories1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="accessories" id="accessories2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="accessories" id="accessories3" value="3"></td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<h3 class="textStyle">Accessories Test</h3>
<div class="fullWidth">
<div class="halfWidth">
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th>Voltage</th>
<th>Test Voltage</th>
<th>Result</th>
</tr>
<tr>
<td class="labels" width="20%">Shunt Trip</td>
<td>
<nlcustrecord_shunt_trip_voltage>
</nlcustrecord_shunt_trip_voltage>
</td>
<td>
<nlcustrecord_shunt_trip_test_voltage>
</nlcustrecord_shunt_trip_test_voltage>
</td>
<td>
<nlcustrecord_shunt_trip_result>
</nlcustrecord_shunt_trip_result>
</td>
</tr>
</tbody>
</table>
</div>
<div class="halfWidth">
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th>NO</th>
<th>NC</th>
<th>Result</th>
</tr>
<tr>
<td class="labels">Auxiliary</td>
<td>
<nlcustrecord_auxiliary_no>
</nlcustrecord_auxiliary_no>
</td>
<td>
<nlcustrecord_auxiliary_nc>
</nlcustrecord_auxiliary_nc>
</td>
<td>
<nlcustrecord_auxiliary_result>
</nlcustrecord_auxiliary_result>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div class="fullWidth">
<div class="halfWidth">
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th>Description</th>
<th>Test</th>
<th>Result</th>
</tr>
<tr>
<td class="labels">Other</td>
<td>
<nlcustrecord_other_1_description>
</nlcustrecord_other_1_description>
</td>
<td>
<nlcustrecord_other_1_test>
</nlcustrecord_other_1_test>
</td>
<td>
<nlcustrecord_other_1_result>
</nlcustrecord_other_1_result>
</td>
</tr>
<tr>
<td class="labels">Other</td>
<td>
<nlcustrecord_other_2_description>
</nlcustrecord_other_2_description>
</td>
<td>
<nlcustrecord_other_2_test>
</nlcustrecord_other_2_test>
</td>
<td>
<nlcustrecord_other_2_result>
</nlcustrecord_other_2_result>
</td>
</tr>
<tr>
<td class="labels">Other</td>
<td>
<nlcustrecord_other_3_description>
</nlcustrecord_other_3_description>
</td>
<td>
<nlcustrecord_other_3_test>
</nlcustrecord_other_3_test>
</td>
<td>
<nlcustrecord_other_3_result>
</nlcustrecord_other_3_result>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div class="fullWidth">
<div class="halfWidth">
<h3 class="textStyle">Resistance Test</h3>
<table style="width:100%">
<tbody>
<tr>
<th class="textAlign" colspan="3">Resistance Test</th>
</tr>
<tr>
<td align="center">A</td>
<td align="center">B</td>
<td align="center">C</td>
</tr>
<tr>
<td>
<nlcustrecord_resistance_test>
</nlcustrecord_resistance_test>
</td>
<td>
<nlcustrecord_resistance_test_b>
</nlcustrecord_resistance_test_b>
</td>
<td>
<nlcustrecord_resistance_test_c>
</nlcustrecord_resistance_test_c>
</td>
</tr>
</tbody>
</table>
</div>
<div class="halfWidth">
<h3 class="textStyle">Insulation Test</h3>
<table style="width:100%">
<tbody>
<tr>
<th class="textAlign" colspan="6">Insulation Test</th>
</tr>
<tr>
<td align="center">A-B</td>
<td align="center">A-C</td>
<td align="center">B-C</td>
<td align="center">A-G</td>
<td align="center">B-G</td>
<td align="center">C-G</td>
</tr>
<tr>
<td>
<nlcustrecord_insulation_test_a_b>
</nlcustrecord_insulation_test_a_b>
</td>
<td>
<nlcustrecord_insulation_test_a_c>
</nlcustrecord_insulation_test_a_c>
</td>
<td>
<nlcustrecord_insulation_test_b_c>
</nlcustrecord_insulation_test_b_c>
</td>
<td>
<nlcustrecord_insulation_test_a_g>
</nlcustrecord_insulation_test_a_g>
</td>
<td>
<nlcustrecord_insulation_test_b_g>
</nlcustrecord_insulation_test_b_g>
</td>
<td>
<nlcustrecord_insulation_test_c_g>
</nlcustrecord_insulation_test_c_g>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<h3 class="textStyle">Current Test</h3>
<div class="fullWidth">
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th></th>
<th class="textAlign" colspan="3">Current Result</th>
<th class="textAlign" colspan="3">Trip Time</th>
</tr>
<tr>
<td align="center">Function</td>
<td align="center">Current Setting</td>
<td align="center">A</td>
<td align="center">B</td>
<td align="center">C</td>
<td align="center">A</td>
<td align="center">B</td>
<td align="center">C</td>
</tr>
<tr>
<td>Long Time Trip</td>
<td>
<nlcustrecord_long_time_trip_setting>
</nlcustrecord_long_time_trip_setting>
</td>
<td>
<nlcustrecord_long_time_current_a>
</nlcustrecord_long_time_current_a>
</td>
<td>
<nlcustrecord_long_time_current_b>
</nlcustrecord_long_time_current_b>
</td>
<td>
<nlcustrecord_long_time_current_c>
</nlcustrecord_long_time_current_c>
</td>
<td>
<nlcustrecord_long_time_trip_trip_time_a>
</nlcustrecord_long_time_trip_trip_time_a>
</td>
<td>
<nlcustrecord_long_time_trip_trip_time_b>
</nlcustrecord_long_time_trip_trip_time_b>
</td>
<td>
<nlcustrecord_long_time_trip_trip_time_c>
</nlcustrecord_long_time_trip_trip_time_c>
</td>
</tr>
<tr>
<td>Long Time Delay</td>
<td>
<nlcustrecord_long_time_delay_setting>
</nlcustrecord_long_time_delay_setting>
</td>
<td>
<nlcustrecord_long_time_delay_current_a>
</nlcustrecord_long_time_delay_current_a>
</td>
<td>
<nlcustrecord_long_time_delay_current_b>
</nlcustrecord_long_time_delay_current_b>
</td>
<td>
<nlcustrecord_long_time_delay_current_c>
</nlcustrecord_long_time_delay_current_c>
</td>
<td>
<nlcustrecord_long_time_delay_trip_time_a>
</nlcustrecord_long_time_delay_trip_time_a>
</td>
<td>
<nlcustrecord_long_time_delay_trip_time_b>
</nlcustrecord_long_time_delay_trip_time_b>
</td>
<td>
<nlcustrecord_long_time_delay_trip_time_c>
</nlcustrecord_long_time_delay_trip_time_c>
</td>
</tr>
<tr>
<td>Short Time Trip</td>
<td>
<nlcustrecord_short_time_trip_setting>
</nlcustrecord_short_time_trip_setting>
</td>
<td>
<nlcustrecord_short_time_trip_current_a>
</nlcustrecord_short_time_trip_current_a>
</td>
<td>
<nlcustrecord_short_time_trip_current_b>
</nlcustrecord_short_time_trip_current_b>
</td>
<td>
<nlcustrecord_short_time_trip_current_c>
</nlcustrecord_short_time_trip_current_c>
</td>
<td>
<nlcustrecord_short_time_trip_time_a>
</nlcustrecord_short_time_trip_time_a>
</td>
<td>
<nlcustrecord_short_time_trip_time_b>
</nlcustrecord_short_time_trip_time_b>
</td>
<td>
<nlcustrecord_short_time_trip_time_c>
</nlcustrecord_short_time_trip_time_c>
</td>
</tr>
<tr>
<td>Short Time Delay</td>
<td>
<nlcustrecord_short_time_delay_setting>
</nlcustrecord_short_time_delay_setting>
</td>
<td>
<nlcustrecord_short_time_delay_current_a>
</nlcustrecord_short_time_delay_current_a>
</td>
<td>
<nlcustrecord_short_time_delay_current_b>
</nlcustrecord_short_time_delay_current_b>
</td>
<td>
<nlcustrecord_short_time_delay_current_c>
</nlcustrecord_short_time_delay_current_c>
</td>
<td>
<nlcustrecord_short_time_delay_trip_a>
</nlcustrecord_short_time_delay_trip_a>
</td>
<td>
<nlcustrecord_short_time_delay_trip_b>
</nlcustrecord_short_time_delay_trip_b>
</td>
<td>
<nlcustrecord_short_time_delay_trip_c>
</nlcustrecord_short_time_delay_trip_c>
</td>
</tr>
<tr>
<td>Instantaneous Trip</td>
<td>
<nlcustrecord_instantaneous_trip_setting>
</nlcustrecord_instantaneous_trip_setting>
</td>
<td>
<nlcustrecord_instantaneous_current_a>
</nlcustrecord_instantaneous_current_a>
</td>
<td>
<nlcustrecord_instantaneous_current_b>
</nlcustrecord_instantaneous_current_b>
</td>
<td>
<nlcustrecord_instantaneous_current_c>
</nlcustrecord_instantaneous_current_c>
</td>
<td>
<nlcustrecord_instantaneous_trip_time_a>
</nlcustrecord_instantaneous_trip_time_a>
</td>
<td>
<nlcustrecord_instantaneous_trip_time_b>
</nlcustrecord_instantaneous_trip_time_b>
</td>
<td>
<nlcustrecord_instantaneous_trip_time_c>
</nlcustrecord_instantaneous_trip_time_c>
</td>
</tr>
<tr>
<td>Ground Fault Trip</td>
<td>
<nlcustrecord_ground_fault_trip_setting>
</nlcustrecord_ground_fault_trip_setting>
</td>
<td>
<nlcustrecord_ground_fault_trip_current_a>
</nlcustrecord_ground_fault_trip_current_a>
</td>
<td>
<nlcustrecord_ground_fault_trip_current_b>
</nlcustrecord_ground_fault_trip_current_b>
</td>
<td>
<nlcustrecord_ground_fault_trip_current_c>
</nlcustrecord_ground_fault_trip_current_c>
</td>
<td>
<nlcustrecord_ground_fault_trip_trip_time_a>
</nlcustrecord_ground_fault_trip_trip_time_a>
</td>
<td>
<nlcustrecord_ground_fault_trip_trip_time_b>
</nlcustrecord_ground_fault_trip_trip_time_b>
</td>
<td>
<nlcustrecord_ground_fault_trip_trip_time_c>
</nlcustrecord_ground_fault_trip_trip_time_c>
</td>
</tr>
<tr>
<td>Ground Fault Delay</td>
<td>
<nlcustrecord_ground_fault_delay_setting>
</nlcustrecord_ground_fault_delay_setting>
</td>
<td>
<nlcustrecord_ground_fault_delay_current_a>
</nlcustrecord_ground_fault_delay_current_a>
</td>
<td>
<nlcustrecord_ground_fault_delay_current_b>
</nlcustrecord_ground_fault_delay_current_b>
</td>
<td>
<nlcustrecord_ground_fault_delay_current_c>
</nlcustrecord_ground_fault_delay_current_c>
</td>
<td>
<nlcustrecord_ground_fault_delay_trip_time_>
</nlcustrecord_ground_fault_delay_trip_time_>
</td>
<td>
<nlcustrecord_ground_fault_delay_trip_timeb>
</nlcustrecord_ground_fault_delay_trip_timeb>
</td>
<td>
<nlcustrecord_ground_fault_delay_delay_trip>
</nlcustrecord_ground_fault_delay_delay_trip>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<h3 class="textStyle">Pass/Fail Final Result</h3>
<input type="radio" name="passorfail" id="pass" value="1">PASS<br>
<input type="radio" name="passorfail" id="fail" value="2">FAIL<br>
<div hidden="">
<nlcustrecord_final_result>
</nlcustrecord_final_result>
</div>
<br>
<br>
<button type="submit" text-align="center" style="margin:0 50%;position:relative;left:-50px;" class="button buttonhover">SUBMIT</button>
<script>
var url_string = window.location.href;
var url = new URL(url_string);
var customer = url.searchParams.get("customer");
var tester = url.searchParams.get("tester");
var poNumber = url.searchParams.get("poNumber");
var salesorder = url.searchParams.get("salesorder");
console.log('salesorder', salesorder);
$(document).ready(function() {
$("#custrecord_customer").val(customer);
$("#custrecord_tester").val(tester);
$("#custrecord_purchase_order_no").val(poNumber);
if(salesorder != null)
$("#custrecord_sales_order_no").val("Sales Order #" + salesorder);
});
//***************************************************
$('#pass').click(function() {
var value = $('#pass').attr('value');
$('#custrecord_final_result').val(value);
})
$('#fail').click(function() {
var value = $('#fail').attr('value');
$('#custrecord_final_result').val(value);
})
//***************************************************
$('#frame1').click(function() {
var value = $('#frame1').attr('value');
$('#custrecord_frame_inspected').val(value);
})
$('#frame2').click(function() {
var value = $('#frame2').attr('value');
$('#custrecord_frame_inspected').val(value);
})
$('#frame3').click(function() {
var value = $('#frame3').attr('value');
$('#custrecord_frame_inspected').val(value);
})
//***************************************************
$('#lugs1').click(function() {
var value = $('#lugs1').attr('value');
$('#custrecord_lugs').val(value);
})
$('#lugs2').click(function() {
var value = $('#lugs2').attr('value');
$('#custrecord_lugs').val(value);
})
$('#lugs3').click(function() {
var value = $('#lugs3').attr('value');
$('#custrecord_lugs').val(value);
})
//***************************************************
$('#arcchute1').click(function() {
var value = $('#arcchute1').attr('value');
$('#custrecord_arc_chute').val(value);
})
$('#arcchute2').click(function() {
var value = $('#arcchute2').attr('value');
$('#custrecord_arc_chute').val(value);
})
$('#arcchute3').click(function() {
var value = $('#arcchute3').attr('value');
$('#custrecord_arc_chute').val(value);
})
//***************************************************
$('#phoneseparators1').click(function() {
var value = $('#phoneseparators1').attr('value');
$('#custrecord_phase_seperators').val(value);
})
$('#phoneseparators2').click(function() {
var value = $('#phoneseparators1').attr('value');
$('#custrecord_phase_seperators').val(value);
})
$('#phoneseparators3').click(function() {
var value = $('#phoneseparators3').attr('value');
$('#custrecord_phase_seperators').val(value);
})
//***************************************************
$('#contacts1').click(function() {
var value = $('#contacts1').attr('value');
$('#custrecord_contacts').val(value);
})
$('#contacts2').click(function() {
var value = $('#contacts2').attr('value');
$('#custrecord_contacts').val(value);
})
$('#contacts3').click(function() {
var value = $('#contacts3').attr('value');
$('#custrecord_contacts').val(value);
})
//***************************************************
$('#accessories1').click(function() {
var value = $('#accessories1').attr('value');
$('#custrecord_accessories').val(value);
})
$('#accessories2').click(function() {
var value = $('#accessories2').attr('value');
$('#custrecord_accessories').val(value);
})
$('#accessories3').click(function() {
var value = $('#accessories3').attr('value');
$('#custrecord_accessories').val(value);
})
//***************************************************
/*var mappedobj = {
'lugs1': 'custrecord_lugs',
'lugs2': 'custrecord_lugs',
'pass': 'custrecord_final_result',
'fail': 'custrecord_final_result'
}
for (var key in mappedobj) {
$('#' + key).click(function() {
var value = $('#' + key).attr('value');
$('#' + mappedobj[key]).val(value);
})
}*/
</script>
</form>
</div>
</body>
</html>
APC-7 JJ Test Report
<NLFORM>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Test Report</title>
<!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> -->
</head>
<style>
.req {
color: #E24F3F;
margin-left: 4px;
}
.labels {
font-size: 15px;
font-family: 'Nunito Sans', sans-serif;
color: #2e2e2e;
}
.form-head {
font-size: 34px;
font-weight: bold;
font-family: 'Nunito Sans', sans-serif;
color: #0f3a6b;
}
.form-sub {
font-size: 22px;
font-family: 'Nunito Sans', sans-serif;
color: #2e2e2e;
}
.fullWidth {
width: 100%;
margin-bottom: 10px;
}
.halfWidth {
width: 49%;
display: inline-block;
}
.textAlign {
text-align: center;
}
.totalAlign {
padding: 1% 10%;
}
.textStyle {
color: #0f3a6b;
}
input[type=text],
input[type=number],
textarea,
select {
display: block;
width: 97% !important;
height: 34px;
!important;
padding: 6px 12px;
font-size: 14px !important;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 2px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
#comments {
display: block;
width: 97% !important;
height: 100px !important;
padding: 6px 12px;
font-size: 14px !important;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 2px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.button {
/*background-color: #144796;*/
background-color: white;
/*border: none;*/
border: 2px solid #4CAF50; /* Green */
/*color: white;*/
color: black;
padding: 10px 32px;
font-family: 'Nunito Sans', sans-serif;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.buttonhover {
background-color: #0f3a6b;
color: white;
border: 2px solid #0f3a6b;
}
.buttonhover:hover {
background-color: #1e4e84;
color: white;
}
table,
th,
td {
border: 1px solid #bdbaba;
border-collapse: collapse;
}
th,
td {
padding: 15px;
}
</style>
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans" rel="stylesheet">
<body>
<div class="totalAlign">
<h1 align="center" class="form-head">Test Report</h1>
<!-- <p class="form-sub"> Dear Friend, This is a test html for a custom record in Netsuite</p> -->
<form>
<h3 class="textStyle">Basic Information</h3>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Date</label>
<nlcustrecord_date>
</nlcustrecord_date>
</div>
<div class="halfWidth">
<label class="labels">Tester</label>
<nlcustrecord_tester>
</nlcustrecord_tester>
</div>
</div>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels" disabled=" ">Sales Order #</label>
<nlcustrecord_sales_order_no>
</nlcustrecord_sales_order_no>
</div>
</div>
<br>
<h3 class="textStyle">Identification Information</h3>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Customer</label>
<nlcustrecord_customer>
</nlcustrecord_customer>
</div>
<div class="halfWidth">
<label class="labels">Purchase Order #</label>
<nlcustrecord_purchase_order_no>
</nlcustrecord_purchase_order_no>
</div>
</div>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Manufacturer</label>
<nlcustrecord_manufactuerer>
</nlcustrecord_manufactuerer>
</div>
<div class="halfWidth">
<label class="labels">Model / Part Number</label>
<nlcustrecord_model_part_number>
</nlcustrecord_model_part_number>
</div>
</div>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Poles</label>
<nlcustrecord_poles>
</nlcustrecord_poles>
</div>
<div class="halfWidth">
<label class="labels">Frame Size</label>
<nlcustrecord_frame>
</nlcustrecord_frame>
</div>
</div>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Voltage Max</label>
<nlcustrecord_voltage_max>
</nlcustrecord_voltage_max>
</div>
<div class="halfWidth">
<label class="labels">AIC Rating</label>
<nlcustrecord_aic_rating>
</nlcustrecord_aic_rating>
</div>
</div>
<div class="fullWidth">
<label class="labels">Trip Amp</label>
<nlcustrecord_trip_details>
</nlcustrecord_trip_details>
</div>
<br>
<h3 class="textStyle">Environment Information</h3>
<div class="fullWidth">
<div class="halfWidth">
<label class="labels">Local Temperature</label>
<nlcustrecord_local_temperature>
</nlcustrecord_local_temperature>
</div>
<div class="halfWidth">
<label class="labels">Local Humidity</label>
<nlcustrecord_local_humidity>
</nlcustrecord_local_humidity>
</div>
</div>
<br>
<h3 class="textStyle">Visual Inspection</h3>
<div class="fullWidth">
<div class="halfWidth">
<div hidden="">
<nlcustrecord_frame_inspected>
</nlcustrecord_frame_inspected>
</div>
<div hidden="">
<nlcustrecord_lugs>
</nlcustrecord_lugs>
</div>
<div hidden="">
<nlcustrecord_arc_chute>
</nlcustrecord_arc_chute>
</div>
<div hidden="">
<nlcustrecord_phase_seperators>
</nlcustrecord_phase_seperators>
</div>
<div hidden="">
<nlcustrecord_contacts>
</nlcustrecord_contacts>
</div>
<div hidden="">
<nlcustrecord_accessories>
</nlcustrecord_accessories>
</div>
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th>Good</th>
<th>Poor</th>
<th>N/A</th>
</tr>
<tr>
<td class="labels">Frame</td>
<td align="center"><input class="radio-btn" type="radio" name="frame" id="frame1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="frame" id="frame2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="frame" id="frame3" value="3"></td>
</tr>
<tr>
<td class="labels">Lugs</td>
<td align="center"><input class="radio-btn" type="radio" name="lugs" id="lugs1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="lugs" id="lugs2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="lugs" id="lugs3" value="3"></td>
</tr>
<tr>
<td class="labels">Arc Chute</td>
<td align="center"><input class="radio-btn" type="radio" name="arcchute" id="arcchute1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="arcchute" id="arcchute2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="arcchute" id="arcchute3" value="3"></td>
</tr>
<tr>
<td class="labels">Phase Separators</td>
<td align="center"><input class="radio-btn" type="radio" name="phoneseparators" id="phoneseparators1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="phoneseparators" id="phoneseparators2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="phoneseparators" id="phoneseparators3" value="3"></td>
</tr>
<tr>
<td class="labels">Contacts</td>
<td align="center"><input class="radio-btn" type="radio" name="contacts" id="contacts1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="contacts" id="contacts2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="contacts" id="contacts3" value="3"></td>
</tr>
<tr>
<td class="labels">Accessories</td>
<td align="center"><input class="radio-btn" type="radio" name="accessories" id="accessories1" value="1"></td>
<td align="center"><input class="radio-btn" type="radio" name="accessories" id="accessories2" value="2"></td>
<td align="center"><input class="radio-btn" type="radio" name="accessories" id="accessories3" value="3"></td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<h3 class="textStyle">Accessories Test</h3>
<div class="fullWidth">
<div class="halfWidth">
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th>Voltage</th>
<th>Test Voltage</th>
<th>Result</th>
</tr>
<tr>
<td class="labels" width="20%">Shunt Trip</td>
<td>
<nlcustrecord_shunt_trip_voltage>
</nlcustrecord_shunt_trip_voltage>
</td>
<td>
<nlcustrecord_shunt_trip_test_voltage>
</nlcustrecord_shunt_trip_test_voltage>
</td>
<td>
<nlcustrecord_shunt_trip_result>
</nlcustrecord_shunt_trip_result>
</td>
</tr>
</tbody>
</table>
</div>
<div class="halfWidth">
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th>NO</th>
<th>NC</th>
<th>Result</th>
</tr>
<tr>
<td class="labels">Auxiliary</td>
<td>
<nlcustrecord_auxiliary_no>
</nlcustrecord_auxiliary_no>
</td>
<td>
<nlcustrecord_auxiliary_nc>
</nlcustrecord_auxiliary_nc>
</td>
<td>
<nlcustrecord_auxiliary_result>
</nlcustrecord_auxiliary_result>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div class="fullWidth">
<div class="halfWidth">
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th>Description</th>
<th>Test</th>
<th>Result</th>
</tr>
<tr>
<td class="labels">Other</td>
<td>
<nlcustrecord_other_1_description>
</nlcustrecord_other_1_description>
</td>
<td>
<nlcustrecord_other_1_test>
</nlcustrecord_other_1_test>
</td>
<td>
<nlcustrecord_other_1_result>
</nlcustrecord_other_1_result>
</td>
</tr>
<tr>
<td class="labels">Other</td>
<td>
<nlcustrecord_other_2_description>
</nlcustrecord_other_2_description>
</td>
<td>
<nlcustrecord_other_2_test>
</nlcustrecord_other_2_test>
</td>
<td>
<nlcustrecord_other_2_result>
</nlcustrecord_other_2_result>
</td>
</tr>
<tr>
<td class="labels">Other</td>
<td>
<nlcustrecord_other_3_description>
</nlcustrecord_other_3_description>
</td>
<td>
<nlcustrecord_other_3_test>
</nlcustrecord_other_3_test>
</td>
<td>
<nlcustrecord_other_3_result>
</nlcustrecord_other_3_result>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div class="fullWidth">
<div class="halfWidth">
<h3 class="textStyle">Resistance Test</h3>
<table style="width:100%">
<tbody>
<tr>
<th class="textAlign" colspan="3">Resistance Test</th>
</tr>
<tr>
<td align="center">A</td>
<td align="center">B</td>
<td align="center">C</td>
</tr>
<tr>
<td>
<nlcustrecord_resistance_test>
</nlcustrecord_resistance_test>
</td>
<td>
<nlcustrecord_resistance_test_b>
</nlcustrecord_resistance_test_b>
</td>
<td>
<nlcustrecord_resistance_test_c>
</nlcustrecord_resistance_test_c>
</td>
</tr>
</tbody>
</table>
</div>
<div class="halfWidth">
<h3 class="textStyle">Insulation Test</h3>
<table style="width:100%">
<tbody>
<tr>
<th class="textAlign" colspan="6">Insulation Test</th>
</tr>
<tr>
<td align="center">A-B</td>
<td align="center">A-C</td>
<td align="center">B-C</td>
<td align="center">A-G</td>
<td align="center">B-G</td>
<td align="center">C-G</td>
</tr>
<tr>
<td>
<nlcustrecord_insulation_test_a_b>
</nlcustrecord_insulation_test_a_b>
</td>
<td>
<nlcustrecord_insulation_test_a_c>
</nlcustrecord_insulation_test_a_c>
</td>
<td>
<nlcustrecord_insulation_test_b_c>
</nlcustrecord_insulation_test_b_c>
</td>
<td>
<nlcustrecord_insulation_test_a_g>
</nlcustrecord_insulation_test_a_g>
</td>
<td>
<nlcustrecord_insulation_test_b_g>
</nlcustrecord_insulation_test_b_g>
</td>
<td>
<nlcustrecord_insulation_test_c_g>
</nlcustrecord_insulation_test_c_g>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<h3 class="textStyle">Current Test</h3>
<div class="fullWidth">
<table style="width:100%">
<tbody>
<tr>
<th></th>
<th></th>
<th class="textAlign" colspan="3">Current Result</th>
<th class="textAlign" colspan="3">Trip Time</th>
</tr>
<tr>
<td align="center">Function</td>
<td align="center">Current Setting</td>
<td align="center">A</td>
<td align="center">B</td>
<td align="center">C</td>
<td align="center">A</td>
<td align="center">B</td>
<td align="center">C</td>
</tr>
<tr>
<td>Long Time Trip</td>
<td>
<nlcustrecord_long_time_trip_setting>
</nlcustrecord_long_time_trip_setting>
</td>
<td>
<nlcustrecord_long_time_current_a>
</nlcustrecord_long_time_current_a>
</td>
<td>
<nlcustrecord_long_time_current_b>
</nlcustrecord_long_time_current_b>
</td>
<td>
<nlcustrecord_long_time_current_c>
</nlcustrecord_long_time_current_c>
</td>
<td>
<nlcustrecord_long_time_trip_trip_time_a>
</nlcustrecord_long_time_trip_trip_time_a>
</td>
<td>
<nlcustrecord_long_time_trip_trip_time_b>
</nlcustrecord_long_time_trip_trip_time_b>
</td>
<td>
<nlcustrecord_long_time_trip_trip_time_c>
</nlcustrecord_long_time_trip_trip_time_c>
</td>
</tr>
<tr>
<td>Long Time Delay</td>
<td>
<nlcustrecord_long_time_delay_setting>
</nlcustrecord_long_time_delay_setting>
</td>
<td>
<nlcustrecord_long_time_delay_current_a>
</nlcustrecord_long_time_delay_current_a>
</td>
<td>
<nlcustrecord_long_time_delay_current_b>
</nlcustrecord_long_time_delay_current_b>
</td>
<td>
<nlcustrecord_long_time_delay_current_c>
</nlcustrecord_long_time_delay_current_c>
</td>
<td>
<nlcustrecord_long_time_delay_trip_time_a>
</nlcustrecord_long_time_delay_trip_time_a>
</td>
<td>
<nlcustrecord_long_time_delay_trip_time_b>
</nlcustrecord_long_time_delay_trip_time_b>
</td>
<td>
<nlcustrecord_long_time_delay_trip_time_c>
</nlcustrecord_long_time_delay_trip_time_c>
</td>
</tr>
<tr>
<td>Short Time Trip</td>
<td>
<nlcustrecord_short_time_trip_setting>
</nlcustrecord_short_time_trip_setting>
</td>
<td>
<nlcustrecord_short_time_trip_current_a>
</nlcustrecord_short_time_trip_current_a>
</td>
<td>
<nlcustrecord_short_time_trip_current_b>
</nlcustrecord_short_time_trip_current_b>
</td>
<td>
<nlcustrecord_short_time_trip_current_c>
</nlcustrecord_short_time_trip_current_c>
</td>
<td>
<nlcustrecord_short_time_trip_time_a>
</nlcustrecord_short_time_trip_time_a>
</td>
<td>
<nlcustrecord_short_time_trip_time_b>
</nlcustrecord_short_time_trip_time_b>
</td>
<td>
<nlcustrecord_short_time_trip_time_c>
</nlcustrecord_short_time_trip_time_c>
</td>
</tr>
<tr>
<td>Short Time Delay</td>
<td>
<nlcustrecord_short_time_delay_setting>
</nlcustrecord_short_time_delay_setting>
</td>
<td>
<nlcustrecord_short_time_delay_current_a>
</nlcustrecord_short_time_delay_current_a>
</td>
<td>
<nlcustrecord_short_time_delay_current_b>
</nlcustrecord_short_time_delay_current_b>
</td>
<td>
<nlcustrecord_short_time_delay_current_c>
</nlcustrecord_short_time_delay_current_c>
</td>
<td>
<nlcustrecord_short_time_delay_trip_a>
</nlcustrecord_short_time_delay_trip_a>
</td>
<td>
<nlcustrecord_short_time_delay_trip_b>
</nlcustrecord_short_time_delay_trip_b>
</td>
<td>
<nlcustrecord_short_time_delay_trip_c>
</nlcustrecord_short_time_delay_trip_c>
</td>
</tr>
<tr>
<td>Instantaneous Trip</td>
<td>
<nlcustrecord_instantaneous_trip_setting>
</nlcustrecord_instantaneous_trip_setting>
</td>
<td>
<nlcustrecord_instantaneous_current_a>
</nlcustrecord_instantaneous_current_a>
</td>
<td>
<nlcustrecord_instantaneous_current_b>
</nlcustrecord_instantaneous_current_b>
</td>
<td>
<nlcustrecord_instantaneous_current_c>
</nlcustrecord_instantaneous_current_c>
</td>
<td>
<nlcustrecord_instantaneous_trip_time_a>
</nlcustrecord_instantaneous_trip_time_a>
</td>
<td>
<nlcustrecord_instantaneous_trip_time_b>
</nlcustrecord_instantaneous_trip_time_b>
</td>
<td>
<nlcustrecord_instantaneous_trip_time_c>
</nlcustrecord_instantaneous_trip_time_c>
</td>
</tr>
<tr>
<td>Ground Fault Trip</td>
<td>
<nlcustrecord_ground_fault_trip_setting>
</nlcustrecord_ground_fault_trip_setting>
</td>
<td>
<nlcustrecord_ground_fault_trip_current_a>
</nlcustrecord_ground_fault_trip_current_a>
</td>
<td>
<nlcustrecord_ground_fault_trip_current_b>
</nlcustrecord_ground_fault_trip_current_b>
</td>
<td>
<nlcustrecord_ground_fault_trip_current_c>
</nlcustrecord_ground_fault_trip_current_c>
</td>
<td>
<nlcustrecord_ground_fault_trip_trip_time_a>
</nlcustrecord_ground_fault_trip_trip_time_a>
</td>
<td>
<nlcustrecord_ground_fault_trip_trip_time_b>
</nlcustrecord_ground_fault_trip_trip_time_b>
</td>
<td>
<nlcustrecord_ground_fault_trip_trip_time_c>
</nlcustrecord_ground_fault_trip_trip_time_c>
</td>
</tr>
<tr>
<td>Ground Fault Delay</td>
<td>
<nlcustrecord_ground_fault_delay_setting>
</nlcustrecord_ground_fault_delay_setting>
</td>
<td>
<nlcustrecord_ground_fault_delay_current_a>
</nlcustrecord_ground_fault_delay_current_a>
</td>
<td>
<nlcustrecord_ground_fault_delay_current_b>
</nlcustrecord_ground_fault_delay_current_b>
</td>
<td>
<nlcustrecord_ground_fault_delay_current_c>
</nlcustrecord_ground_fault_delay_current_c>
</td>
<td>
<nlcustrecord_ground_fault_delay_trip_time_>
</nlcustrecord_ground_fault_delay_trip_time_>
</td>
<td>
<nlcustrecord_ground_fault_delay_trip_timeb>
</nlcustrecord_ground_fault_delay_trip_timeb>
</td>
<td>
<nlcustrecord_ground_fault_delay_delay_trip>
</nlcustrecord_ground_fault_delay_delay_trip>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<h3 class="textStyle">Pass/Fail Final Result</h3>
<input type="radio" name="passorfail" id="pass" value="1">PASS<br>
<input type="radio" name="passorfail" id="fail" value="2">FAIL<br>
<div hidden="">
<nlcustrecord_final_result>
</nlcustrecord_final_result>
</div>
<br>
<br>
<button type="submit" text-align="center" style="margin:0 50%;position:relative;left:-50px;" class="button buttonhover">SUBMIT</button>
<script>
var url_string = window.location.href;
var url = new URL(url_string);
var customer = url.searchParams.get("customer");
var tester = url.searchParams.get("tester");
var poNumber = url.searchParams.get("poNumber");
var salesorder = url.searchParams.get("salesorder");
var soId = url.searchParams.get("soId");
console.log('salesorder', salesorder);
$(document).ready(function() {
$("#custrecord_customer").val(customer);
$("#custrecord_tester").val(tester);
$("#custrecord_purchase_order_no").val(poNumber);
$("#hddn_custrecord_sales_order_no_fs").val(salesorder);
$("#custrecord_sales_order_no_display").val(soId);
});
//***************************************************
$('#pass').click(function() {
var value = $('#pass').attr('value');
$('#custrecord_final_result').val(value);
})
$('#fail').click(function() {
var value = $('#fail').attr('value');
$('#custrecord_final_result').val(value);
})
//***************************************************
$('#frame1').click(function() {
var value = $('#frame1').attr('value');
$('#custrecord_frame_inspected').val(value);
})
$('#frame2').click(function() {
var value = $('#frame2').attr('value');
$('#custrecord_frame_inspected').val(value);
})
$('#frame3').click(function() {
var value = $('#frame3').attr('value');
$('#custrecord_frame_inspected').val(value);
})
//***************************************************
$('#lugs1').click(function() {
var value = $('#lugs1').attr('value');
$('#custrecord_lugs').val(value);
})
$('#lugs2').click(function() {
var value = $('#lugs2').attr('value');
$('#custrecord_lugs').val(value);
})
$('#lugs3').click(function() {
var value = $('#lugs3').attr('value');
$('#custrecord_lugs').val(value);
})
//***************************************************
$('#arcchute1').click(function() {
var value = $('#arcchute1').attr('value');
$('#custrecord_arc_chute').val(value);
})
$('#arcchute2').click(function() {
var value = $('#arcchute2').attr('value');
$('#custrecord_arc_chute').val(value);
})
$('#arcchute3').click(function() {
var value = $('#arcchute3').attr('value');
$('#custrecord_arc_chute').val(value);
})
//***************************************************
$('#phoneseparators1').click(function() {
var value = $('#phoneseparators1').attr('value');
$('#custrecord_phase_seperators').val(value);
})
$('#phoneseparators2').click(function() {
var value = $('#phoneseparators1').attr('value');
$('#custrecord_phase_seperators').val(value);
})
$('#phoneseparators3').click(function() {
var value = $('#phoneseparators3').attr('value');
$('#custrecord_phase_seperators').val(value);
})
//***************************************************
$('#contacts1').click(function() {
var value = $('#contacts1').attr('value');
$('#custrecord_contacts').val(value);
})
$('#contacts2').click(function() {
var value = $('#contacts2').attr('value');
$('#custrecord_contacts').val(value);
})
$('#contacts3').click(function() {
var value = $('#contacts3').attr('value');
$('#custrecord_contacts').val(value);
})
//***************************************************
$('#accessories1').click(function() {
var value = $('#accessories1').attr('value');
$('#custrecord_accessories').val(value);
})
$('#accessories2').click(function() {
var value = $('#accessories2').attr('value');
$('#custrecord_accessories').val(value);
})
$('#accessories3').click(function() {
var value = $('#accessories3').attr('value');
$('#custrecord_accessories').val(value);
})
$("form").submit(function(){
document.getElementById("custrecord_customer").disabled=false;
document.getElementById("custrecord_purchase_order_no").disabled=false;
document.getElementById("custrecord_sales_order_no_display").disabled=false;
});
document.getElementById("custrecord_customer").disabled=true;
document.getElementById("custrecord_purchase_order_no").disabled=true;
document.getElementById("custrecord_sales_order_no_display").disabled=true;
//***************************************************
/*var mappedobj = {
'lugs1': 'custrecord_lugs',
'lugs2': 'custrecord_lugs',
'pass': 'custrecord_final_result',
'fail': 'custrecord_final_result'
}
for (var key in mappedobj) {
$('#' + key).click(function() {
var value = $('#' + key).attr('value');
$('#' + mappedobj[key]).val(value);
})
}*/
</script>
</form>
</div>
</body>
</html>
Client
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
/*******************************************************************************
* CLIENTNAME: APC
* APC-7
* Create Test Report
* **************************************************************************
* Date : 18-03-2019
*
* Author: Jobin & Jismi IT Services LLP
* Script Description : To make a button in Sales order and on its click, redirect to the online form.
* Date created : 18-03-2019
*
* REVISION HISTORY
*
******************************************************************************/
define(['N/currentRecord', 'N/url', 'N/runtime', 'N/search'],
function(currentrecord, url, runtime, search) {
/**
* Function to be executed after page is initialized.
*
* @param {Object} scriptContext
* @param {Record} scriptContext.currentRecord - Current form record
* @param {string} scriptContext.mode - The mode in which the record is being accessed (create, copy, or edit)
*
* @since 2015.2
*/
function pageInit(scriptContext) {}
function testreport(scriptContext) {
try {
var record = currentrecord.get();
//console.log('record', record);
var recordId = record.id
//console.log('recordId', recordId);
var customerObject = search.lookupFields({
type: search.Type.SALES_ORDER,
id: recordId,
columns: ['entity', 'otherrefnum', 'tranid','internalid']
});
//console.log('customerObject', customerObject);
var customer = customerObject.entity[0].value;
//console.log('customer', customer);
var poNumber = customerObject.otherrefnum;
//console.log('poNumber', poNumber);
var currentUser = runtime.getCurrentUser()
var tester= currentUser.name;
var currentUserID = currentUser.id;
console.log( customerObject);
console.log( customerObject.tranid);
var salesorder = customerObject.internalid[0].value
//console.log('salesorder', salesorder);
var url = '/app/crm/common/onlineforms/internalonlineform.nl?formid=5&customer=' + customer + '&tester=' + tester + '&poNumber=' + poNumber + '&salesorder=' + salesorder + '&soId=' + customerObject.tranid;
//console.log('url', url);
//window.location = url;
window.open(url);
} catch (er) {
log.debug('er', er)
}
}
return {
pageInit: pageInit,
testreport: testreport
};
});
User Event
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
*/
/*******************************************************************************
* CLIENTNAME: APC
* APC-7
* Create Test Report
* **************************************************************************
* Date : 18-03-2019
*
* Author: Jobin & Jismi IT Services LLP
* Script Description : To make a button in Sales order and on its click, redirect to the online form.
* Date created : 18-03-2019
*
* REVISION HISTORY
*
******************************************************************************/
define(['N/record', 'N/search', 'N/runtime'],
function(record, search, runtime) {
function beforeLoad(context) {
try {
if (context.type == 'view') {
var soRec = context.form;
context.form.clientScriptFileId = 17549;
var testReportButton = soRec.addButton({
id: 'custpage_test_report',
label: 'Create Test Report',
functionName: 'testreport'
});
}
} catch (er) {
log.debug('er', er);
}
};
function beforeSubmit(context) {};
function afterSubmit(context) {};
return {
beforeLoad: beforeLoad,
beforeSubmit: beforeSubmit,
afterSubmit: afterSubmit
};
});