This topic contains 6 replies, has 0 voices, and was last updated by ssilveri77 7 years, 7 months ago.
-
AuthorPosts
-
March 28, 2017 at 3:42 pm #1006
ialanIs there a way to disable a field on a sublist using SuiteScript 2.0 script.
I could not find a mapping API for nlapiDisableLineItemField(type, fldnam, val).
This is a cached copy. Click here to see the original post. -
March 28, 2017 at 6:34 pm #1007
darrenhillconsultingOh the hours I’ve burnt trying to do this! Lemme know how you make out!
-
March 29, 2017 at 7:59 am #1008
JacksonPThe only time I’ve disabled a field in a sublist is when I was creating the field myself, here is the code… maybe you guys can use it.
Code:
sublist.addField({
id: ‘title_’,
type: ‘text’,
label: ‘Title’
}).updateDisplayType({
displayType: ‘DISABLED’
}); -
March 29, 2017 at 8:24 am #1009
darrenhillconsultingSee my latest post … Client Script hack that could save your life!
-
March 30, 2017 at 2:47 pm #1010
ssilveri77Do you mean disable the column or just a column in a row. Below only works in a client script. This is a standard field in fulfillment item sublist
function pageInit(context) {
var record = context.currentRecord;
var itemCount = record.getLineCount(‘item’);
var stStat = 0;
// log.debug(‘itemCount’,itemCount);
for (i = 0; i < itemCount; i++) {
stStat = record.getSublistValue({ sublistId: 'item',
fieldId : 'custcol_sv_item_status',
line : i });
if (stStat == 6) {
var itemField = record.getSublistField({ sublistId: 'item',
fieldId: 'itemreceive',
line: i });
itemField.isDisabled = true;
}
}
}
-
March 30, 2017 at 2:56 pm #1011
darrenhillconsultingSo, on a new record (pick one, any one) …. try a disable a sublist field.
For example, on a NEW Project Task, try and disable the ‘serviceitem’ on the ‘assignee’ sublist.
Through my endless hours of doing this, I observed that … if the sublist is empty, SS2.0 API’s associated to this task (disabling) all fail. There were other corner cases where it failed as well.
The point being, how can I trust these calls? Don’t get me wrong, I love and will continue to do all development in SS2.0, but there are gaps.
-
March 30, 2017 at 3:20 pm #1012
ssilveri77Yes. I only want to use 2.0 as well, gaps? I think its more like the Grand Canyon in some places…. I was doing a lot of null testing in some of the testing I did.
-
AuthorPosts
You must be logged in to reply to this topic.