Page 1 of 1

jscript example from work

Posted: Mon Jan 14, 2019 5:20 pm
by maechoi
4. Field (Coverage Type) – column S in both the local and global file – The global instruction on the EDI setup is based on generating the actual coverage type. The local file has specific script for this field. We are generating the below values based on the product and coverage type. See script below. Need to know how to enter this or if you can update instructions on how to generate these values

if (Event.Value == 'Legal Shield Only' && Event.Record["CoverageTypeCode"] == 'EO')
Event.Value = "11";
else
if (Event.Value == 'Legal Shield Only' && Event.Record["CoverageTypeCode"] != 'EO')
Event.Value = "FN";
else
if (Event.Value == 'BOTH Legal Shield and ID Theft' && Event.Record["CoverageTypeCode"] == 'EO')
Event.Value = "13";
else
if (Event.Value == 'BOTH Legal Shield and ID Theft' && Event.Record["CoverageTypeCode"] != 'EO')
Event.Value = "32";
else
if (Event.Value == 'ID Theft Only' && Event.Record["CoverageTypeCode"] == 'EO')
Event.Value = "12"; // changed from 18 to 12 per email on 03.14.2017 from Jessica Trimmer at GroupResources
else
if (Event.Value == 'ID Theft Only' && Event.Record["CoverageTypeCode"] != 'EO')
Event.Value = "30";

Re: jscript example from work

Posted: Wed Jan 16, 2019 3:41 pm
by james
Wow.... there is a bunch of if ... else statements....

Sometimes the CASE statement (also known as the SWITCH statement) can clear out all those if ... else statements.