Discussões
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
Atualizar linhas em Pedidos de vendas usando o script Map/Reduce
Dentro SuiteCloud / Personalização
Aplica-se a
Produto: NetSuite 2021.2
Cenário
Linhas de atualização em massa em um Pedido de vendas que contem um valor específico usando o script Map/Reduce.
Solução
O script está pesquisando linhas em Pedido de vendas que contem a letra 'x' em uma coluna personalizada. Segue um exemplo de código de script Map/Reduce com comentários:
/** *@NApiVersion 2.x *@NScriptType MapReduceScript */ define(['N/search', 'N/record'], function (search, record) { function getInputData() { log.debug('START', 'Set Searh'); //Set search for lines with values you want to change. It is recommended to test the search in UI to see results. var inputSearch = search.create({ type: 'transaction', filters: [ ['mainline', 'is', 'F'], 'and', ['type', 'anyof', 'SalesOrd'], 'and', ['custcol4', 'contains', 'x'] ], columns: [ 'lineuniquekey' //This field is used to identify particular line ] }); //Search result is only for first 1000 lines for more you need implement floating logic or run script multiple times. var result = inputSearch.run().getRange({ start: 0, end:
Rotulado:
0
Olá, bem-vind@!
Faça login
Para ver todos os detalhes, faça o login.
Cadastre-se
Não tem uma conta? Clique aqui para começar!