jscript example from work

Welcome to Siddharth, Mae, Bao-An, Ryan, Sitra, Hoyong, and Janet, who meet Mondays and Wednesdays, (but no class on January 21st ) in January of 2019 at Collin College, the courtyard campus to learn how to READ JavaScript code -- plus we learn some programming. JavaScript forms the basic Language of the web; it's the glue between the HTML and CSS actions that form the Transformation in a browser or API call.
Post Reply
maechoi
Posts: 6
Joined: Wed Jan 09, 2019 6:39 pm

jscript example from work

Post by maechoi » Mon Jan 14, 2019 5:20 pm

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";



User avatar
james
Posts: 147
Joined: Mon Apr 16, 2018 1:03 pm

Re: jscript example from work

Post by james » Wed Jan 16, 2019 3:41 pm

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.



Post Reply