superkumario64
06/12/2018, 4:28 PMvar form = ui.createForm({
title : 'Advanced Searching'
});
form.clientScriptFileId = 2993973;
//form.clientScriptModulePath = "SuiteScripts/repo/suitelets/main.js";
var html = form.addField({
id : 'textfield',
type : ui.FieldType.INLINEHTML,
label : 'HTML Search'
});
var fileObj = file.load({
id: 'SuiteScripts/repo/suitelets/form.html'
});
var htmlStr = fileObj.getContents();
html.defaultValue = htmlStr;
I’m attaching a clientScript to the form which looks like:
/**
*@NApiVersion 2.x
*@NScriptType ClientScript
*/
define(['N/log'],
function(log) {
function saveRecord(context) {
//this is just a boilerplate entry point
return true;
}
function aClick(){
console.log(' a click');
}
return {
saveRecord: saveRecord,
aClick: aClick
}
})
is there a way from my HTML to call the aClick function from this html:
<div id="container">
<div id="inputs">
<input type="text" id="search"/>
<button type="button" id="submit" onClick="aClick()">Submit</button>
</div>
<div id="output">
<div id="results">
<h2>Use the form above to search!</h2>
</div>
<div id="loader" class="lds-css ng-scope"><div style="width:100%;height:100%" class="lds-pacman"><div><div></div><div></div><div></div></div><div><div></div><div></div></div></div></div>
</div>
</div>
Right now when I click it says aClick is not defined