Skip to content

Instantly share code, notes, and snippets.

@stphnwlkr
Last active May 28, 2016 17:32
Show Gist options
  • Save stphnwlkr/3ab1f152c038a69c7ffe2b57c0cfe65f to your computer and use it in GitHub Desktop.
Save stphnwlkr/3ab1f152c038a69c7ffe2b57c0cfe65f to your computer and use it in GitHub Desktop.
public void function genDCJSON(){
/* Get the Data */
var data = queryExecute("Select deviceCode, deviceNomenclature from mybase_devicecodes_tbl",{},{});
/* Set base file path */
var strPath = expandPath('/');
/* Delete existing file */
if(fileExists(strPath&'library\json\dcodes.json')){
cffile(action='delete',file=strPath&'library\json\dcodes.json');
}
/* Generate new file */
var a = serializeJSON(data,'struct');
cffile(action='write', file=strPath&'library\json\dcode.json', output=a);
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment