This topic contains 5 replies, has 0 voices, and was last updated by JacksonP 8 years ago.

  • Author
    Posts
  • #1525

    JacksonP

    Is it possible to add a custom sublist to a form on create? It only seems to work on edit/view mode. I’m trying to display a saved search when a sales rep is creating a new event. I’ve tried going in and editing the form, but it doesn’t seem to like it. Any ideas?

    Is it possible to load a form in a suitelet?
    This is a cached copy. Click here to see the original post.

  • #1526

    david.smith

    Is the search dependent on the record? Some saved search sublists are filtered by the record. I’m assuming in this case it’s not because the record isn’t saved yet.

  • #1527

    JacksonP

    So it’s creating the search based off of the customer, which a sales rep click new event from that already created customer. So it should have all of the information that’s needed… which is the internal id of the customer. The search is just getting all the open tasks / events on the customer

  • #1528

    david.smith

    Ah. You might have to script it to show because technically the customer can be changed so the filter will not work. Haven’t done this before but you could probably load the suitelet as a sublist on the form during create.

  • #1529

    JacksonP

    I’ve never done that before, I didn’t know you could load a suitelet as a sublist. I’m going to go search suiteanswers for a walkthrough. Thanks David! I was rebuilding the entire form in a suitelet. This will save some time.

  • #1530

    JacksonP

    Alright so I found some information about adding tabs and sublist to that tab in a user event script, I didn’t need a suitelet at all… I hope. So this code works fine on create and creates the tab and sublist, now I’m trying to figure out how to attach my actual Custom Sublist that i’ve already created to it. It doesn’t let me edit the ID in the .addSublist because it has to begin with ‘custpage’. Here is my code. (PS: strangely gets pissed off about loading in the serverWidget module, but you can edit the form already, I guess the serverWidget module is already loaded?)

    Code:
    /**
    * @NApiVersion 2.x
    * @NScriptType UserEventScript
    * @NModuleScope Public
    */
    define([‘N/record’],

    function(record) {
    function beforeLoad(scriptContext) {
    var customerRecord = scriptContext.newRecord;

    var form = scriptContext.form;

    form.addTab({
    id: ‘custpage_eventstab’,
    label: ‘Customers Tasks and Events’
    });

    form.addSublist({
    id: ‘custpage_customsublist12’, // my sublist’s id is customsublist12
    type: ‘list’,
    label: ‘Touchpoint Customers Events’,
    tab: ‘custpage_eventstab’
    });

    }
    return {
    beforeLoad: beforeLoad
    };
    });


    JacksonP replied on 11/17/2016, 12:47 PM: If I was creating the Custom Sublist from scratch in script, the only piece I can’t find is how to add the search.

You must be logged in to reply to this topic.