2

Stackoverflow people!

This will be my first question here but I have probably viewed your questions or answers within this subject a few times already.

Our issue is how hard it is with all the custom pricing we have to change a group of people to a higher or lower price as the rest of their pricing doesn't match. And since we want to hit either all customers or a large group of X customers we'd have to Export all their pricing just to change 1 pricing group to a different level.

So I am trying to think of a way to create a suitelet that would be able to just change one X pricing groups price level on from a Search of customers.

NOTE: I have tried just exporting that pricing group and then importing only the new pricing level but when the Import sees that they already have X pricing group it always stops there with the error that this pricing group exists already and doesn't update the pricing level.

I have been toying around with a few different ways to change one group pricing level for a group of people.

I have thought about creating a sublist

function createForm(request, response) {

    //create form
    var form = nlapiCreateForm('Change Group Pricing');

    // Set form buttons
    form.addSubmitButton('Submit');

    //create sublist
    var sublist = form.addSubList('custpage_mysublist', 'list', 'Sublist');

    // run existing saved search X
    var searchResults = nlapiSearchRecord('customer', 'customsearchID');
    var columns = searchResults[0].getAllColumns();

    // Add the search column names to the sublist field
    for (var i = 0; i < columns.length; i++)
    {
        sublist.addField(columns[i].getName(), 'text', columns[i].getLabel()); 
        nlapiLogExecution('DEBUG', 'Column Label', columns[i].getLabel());
    }
    //add editable field
    sublist.addField('custpage_mysublistfield', 'text', 'test sublist field').setDisplayType('entry');
    sublist.addField('custpage_mysublistcb', 'checkbox', 'checkbox');
    //set values to fields
    sublist.setLineItemValue('custpage_mysublistfield', '1', 'sublist field 1');
    sublist.setLineItemValue('custpage_mysublistfield2', '1', 'sublist field 2'); 
    //send response
    response.writePage(form);
}

I have thought about doing a script that takes a search and turns it into a CSV and then importing that CSV with another script.

0 Answers0