This topic contains 6 replies, has 0 voices, and was last updated by ssilveri77 7 years, 7 months ago.

  • Author
    Posts
  • #1006

    ialan

    Is 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.

  • #1007

    darrenhillconsulting

    Oh the hours I’ve burnt trying to do this! Lemme know how you make out!

  • #1008

    JacksonP

    The 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’
    });

  • #1009

    darrenhillconsulting

    See my latest post … Client Script hack that could save your life!

  • #1010

    ssilveri77

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

    }

    }

    }

  • #1011

    darrenhillconsulting

    So, 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.

  • #1012

    ssilveri77

    Yes. 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.

You must be logged in to reply to this topic.