battk
03/06/2019, 6:19 PMal3xicon
03/06/2019, 6:20 PMerictgrubaugh
03/06/2019, 6:45 PMrec.getSublistField(...).disabled = true;
I believe. No looping s/b necessaryerictgrubaugh
03/06/2019, 6:45 PMal3xicon
03/06/2019, 6:45 PMline
erictgrubaugh
03/06/2019, 6:45 PMal3xicon
03/06/2019, 6:46 PMerictgrubaugh
03/06/2019, 6:46 PMerictgrubaugh
03/06/2019, 6:46 PMal3xicon
03/06/2019, 6:46 PMal3xicon
03/06/2019, 6:46 PMal3xicon
03/06/2019, 6:47 PMfunction pageInit(scriptContext) {
console.log(scriptContext.mode);
if (scriptContext.mode == 'edit') {
var _rec = scriptContext.currentRecord;
var status = _rec.getValue({fieldId:'status'});
if (status == 'Issued Quote') {
var salesgroup_fld = _rec.getField({fieldId:'salesgroup'});
salesgroup_fld.isDisabled = true;
var updatecustomer_fld = _rec.getField({fieldId:'syncsalesteams'});
updatecustomer_fld.isDisabled = true;
// disable quote line fields as well
var includeinforecast_fld = _rec.getSublistField({sublistId:'estimates', fieldId:'includeinforecast', line:0});
if (includeinforecast_fld) {
includeinforecast_fld.isDisabled = true;
}
}
}
}
jkabot
03/06/2019, 6:51 PM<input>
fields are always available.
I think you'll have to loop and disable the field on each line. This is fine in pageInit since this sublist can't change in length.al3xicon
03/06/2019, 6:52 PMal3xicon
03/06/2019, 6:52 PMjkabot
03/06/2019, 6:55 PM<input>
.al3xicon
03/06/2019, 6:56 PMrgoodrow
03/06/2019, 7:26 PMreturn {
post: function (context) {
switch (context.action) {
case 'doStuff': return doStuff(context);
}
}
};
I'd like to clean up to
return {
post: function(context) {
return <parentObject>[context.action](context);
}
};
erictgrubaugh
03/06/2019, 7:27 PMrgoodrow
03/06/2019, 8:45 PMstalbert
03/06/2019, 8:54 PMerictgrubaugh
03/06/2019, 9:10 PMdefine([], function () {
const functionRouter = {
"doAThing": oneFunction,
"doAnotherThing": anotherFunction,
"thatOtherThing": yetAnotherFn
}
function oneFunction(context) { ... }
function anotherFunction(context) { ... }
function yetAnotherFn(context) { ... }
return {
post: function (context) {
try {
(functionRouter[context.action])(context);
} catch (e) {
onError(context);
}
}
});
untested of course, and I never write my entry point functions within the return statement, but that s/b pretty close to what you're tryingTyler
03/06/2019, 9:51 PMstalbert
03/06/2019, 10:36 PMerictgrubaugh
03/06/2019, 11:57 PMerictgrubaugh
03/07/2019, 12:00 AM/SuiteScripts/
lib/
lodash.min.js
moment.min.js
sales-approvals/
sales-approvals-ue.js // a user event
sales-approvals-data.js // a module with search methods for retrieving relevant data
sales-approvals-sl.js // a suitelet
sales-approvals-cl.js // a client script
deduplication/
dedupe-mr.js // a mapreduce script
dedupe-email.js // a module with methods relevant to deduplication emails
erictgrubaugh
03/07/2019, 12:00 AMerictgrubaugh
03/07/2019, 12:00 AMfkrauthan
03/07/2019, 12:20 AMstalbert
03/07/2019, 1:07 AMSS2
folder as a root so as to easily distinguish between any SS1 code that may live under /SuiteScripts
from SuiteScript 2.x code (since SS2 code uses paths in the file cabinet directly - SS1 doesn't)