This topic contains 3 replies, has 0 voices, and was last updated by egrubaugh 8 years, 4 months ago.

  • Author
    Posts
  • #6345

    cpolanish

    Hi all, I’m having an issue where I added a sublist in a Suitelet that is of type “list”, but only the checkbox field is editable (see attached image). Even via SuiteScript I can only read values, not set values.

    Here’s is the code for the sublist:

    Code:
    // Add Item List
    var itemlist = form.addSubList(‘item’, ‘list’, ‘Items’, ‘itemtab’);
    itemlist.addField(‘lineid’, ‘integer’, ‘Line Id’).setDisplayType(‘hidden’);
    itemlist.addField(‘modify’, ‘checkbox’, ‘Modify’);
    itemlist.addField(‘item’, ‘text’, ‘Sku’);
    itemlist.addField(‘itemname’, ‘text’, ‘Item’);
    itemlist.addField(‘description’, ‘text’, ‘Description’);
    itemlist.addField(‘quantity’, ‘integer’, ‘Quantity’);
    itemlist.addField(‘rate’, ‘currency’, ‘Price’);
    itemlist.addField(‘amount’, ‘currency’, ‘Ext.’);
    itemlist.addField(‘requestdate’, ‘date’, ‘Request Date’);

    itemlist.addMarkAllButtons();
    itemlist.addButton(‘updatelines’, ‘Update Lines’, ‘updateLines’);
    itemlist.setLineItemValues(getItemList(orderId));
    Anybody have any ideas? It seems from looking at the SuiteAnswers articles that it should work, but I can’t seem to get it. I cannot use an inlineeditor sublist as we don’t want people adding or removing lines, only editing what is available to them.

    Thanks!

    ~Chris
    This is a cached copy. Click here to see the original post.

  • #6346

    michoel

    You should be able to do this with setDisplayType(‘entry’)

    Code:
    // Add Item List
    var itemlist = form.addSubList(‘item’, ‘list’, ‘Items’, ‘itemtab’);
    itemlist.addField(‘lineid’, ‘integer’, ‘Line Id’).setDisplayType(‘hidden’);
    itemlist.addField(‘modify’, ‘checkbox’, ‘Modify’);
    itemlist.addField(‘item’, ‘text’, ‘Sku’);
    itemlist.addField(‘itemname’, ‘text’, ‘Item’);
    itemlist.addField(‘description’, ‘text’, ‘Description’);
    itemlist.addField(‘quantity’, ‘integer’, ‘Quantity’).setDisplayType(‘entry’);
    itemlist.addField(‘rate’, ‘currency’, ‘Price’).setDisplayType(‘entry’);
    itemlist.addField(‘amount’, ‘currency’, ‘Ext.’);
    itemlist.addField(‘requestdate’, ‘date’, ‘Request Date’).setDisplayType(‘entry’);

    itemlist.addMarkAllButtons();
    itemlist.addButton(‘updatelines’, ‘Update Lines’, ‘updateLines’);
    itemlist.setLineItemValues(getItemList(orderId));

  • #6347

    cpolanish

    setDisplayType(‘entry’) seems to do the trick! I guess I don’t do enough sublist work because I was unaware of the “entry” setting. Thanks!

  • #6348

    egrubaugh

    Originally posted by michoel

    View Post

    You should be able to do this with setDisplayType(‘entry’)

    Very interesting! I was not aware of this type either. Now reading the documentation for nlobjField.setDisplayType, there it is plain as day. Note to self: RTFM

You must be logged in to reply to this topic.