Marty Zigman

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

Marty Zigman LinkedIn

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc.. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM, and eCommerce business systems. Contact Marty to set up a conversation.

BiographyYouTubeLinkedInX (Twitter)

11 thoughts on “Learn the NetSuite SuiteScript 2.0 Pattern to Add a Tab and a Sublist

  1. Brent says:

    I am doing something very similar, but I can’t figure out how to access the sublist on afterSubmit so I can save any changes or added lines as new records in system. When I try to access the newly created sublist using: context.newRecord.getSublist({sublistId: ‘custpage_sublist_1″}); it throws as error saying I am missing required parameter ‘sublistId’. I have debugged it all, the parameter is most definitely present. Is this a bug in Netsuite or is this just the completely wrong way to save changes and additions to a custom sublist?

  2. Marty Zigman says:

    Brent,

    That’s a good question. I generally would not think that aftersumbit would work that way. Are you instead loading the record again and then working it in memory (never considered a good practice because of the performance hit by the way)? You can’t modify the aftersubmit record but you can the beforesubmit.

    Marty

  3. Paul Haigh says:

    I love this pattern. It separates the coupling between the saved search and the GUI meaning you can update the saved search without having to redeploy.
    I also love that as an organisation you share code like this strategically and see the business benefit in helping others help themselves. There seems to be an underlying ethos of keeping it close to the chest in the Netsuite dev. world.
    Between yourself and Mr Eric T Grubaughs excellent videos you have made my transition into Netsuite development manageable.
    Thankyou

  4. Marty Zigman says:

    Thank you Paul. If we can give you our tools to help you be more productive, let’s have a conversation.

    Marty

  5. Kevin Patterson says:

    What is the easiest way to add a Customer Sublist (but filtered on a unique text field). I think Netsuite only allows the filtering on a List/Record – would this approach work to created the sublist or is there an easier way to do this? Thanks.

  6. Marty Zigman says:

    Kevin,

    The cut-and-paste custom sublist doesn’t key well on text inputs. But this pattern of using a script will allow you to produce that sublist.

    Marty

  7. AkberAlwani says:

    Hello Marty,
    Need your help.
    I setup the Suilet with 3 input fields, and 2 sublist with Tab control.
    1 Client script is setup which get the fieldChange the input parameter and then fill the sublist.
    I spend too much time but data seems not filling up in Sublist, after commitline I get an error that that typeerror

    rec.insertLine({“sublistId”: “custpage_item_assembly”, “line”: counter});
    rec.selectLine({ sublistId: ‘custpage_item_assembly’, line: counter});
    rec.setCurrentSublistValue({sublistId: ‘custpage_item_assembly’, fieldId: ‘sublist1’, value: internalid,ignoreFieldChange: true});
    rec.setCurrentSublistValue({sublistId: ‘custpage_item_assembly’, fieldId: ‘sublist2’, value: itemid,ignoreFieldChange: true});
    rec.setCurrentSublistValue({sublistId: ‘custpage_item_assembly’, fieldId: ‘sublist3’, value: displayname,ignoreFieldChange: true});
    rec.setCurrentSublistValue({sublistId: ‘custpage_item_assembly’, fieldId: ‘sublist4’, value: salesdescription,ignoreFieldChange: true});
    rec.setCurrentSublistValue({sublistId: ‘custpage_item_assembly’, fieldId: ‘sublist5’, value: unitstype,ignoreFieldChange: true});

    rec.commitLine({sublistId: ‘custpage_item_assembly’});
    rec.save(); //try removing this also

    counter is set as 0

  8. Marty Zigman says:

    Thank you Akber for reaching out for a private conversation at: https://www.prolecto.com/services/innovations/

  9. Slava says:

    Hello Marty,
    Unfortunately I found your post after I spent couple of days to found out solution by myself (I was surprised that it was exactly like yours 🙂 ).
    I faced with another issue. I have some fields where I want to keep both value and text (like posting period, currency, customer……). Fortunately, search result returns those field like object {text,value}.
    The question is, if it is possible to add object to text field (or maybe field need to be with other display type) – in UI user will see the text, but when need I could fetch value from the same field (like sublist which was added via UI with saved search).
    I understand that I can create two columns (one visible for text, and second hidden for value), but I was wondering if there is more simple solution for it.

  10. Maria says:

    hi! i always get an unexpected error when trying to insert the tab right next to an existing custom subtab (not created via script). what i’m trying to achieve is to add a subtab with a sublist using suitescript in between custom subtabs (created via suitebuilder) in a project record.

  11. Marty Zigman says:

    Hello Maria,

    We find that script may be the only way to get control over tab placement. Else, we are subject to whims of the point-and-click customization capabilities.

    Marty

Leave a Reply

Your email address will not be published. Required fields are marked *