Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

260
Visualizações
How can I eliminate having to not repeat the same code

I have a script that adds items to a Netsuite record. In this case 22 items needs to be added but the value lines in the below are different for each item. Rather than having to repeat the same lines over and over again is there a better way to do this.

Code below:

             rec.setCurrentSublistValue(
             {
                sublistId: 'item',
                fieldId: 'item',
                value: 1261,
                forceSyncSourcing: true
             } )
             // Add item description
             rec.setCurrentSublistValue(
             {
                sublistId: 'item',
                fieldId: 'description',
                value: 'Charge Description'
             } )
             // Add item quantity
             rec.setCurrentSublistValue(
             {
                sublistId: 'item',
                fieldId: 'quantity',
                value: 1,
                forceSyncSourcing: true
             } )
             // Add Estimated Unit Cost F/X
             rec.setCurrentSublistValue(
             {
                sublistId: 'item',
                fieldId: 'custcol_est_unit_cost_fx',
                value: handlingBuy,
                forceSyncSourcing: true
             } )
             // Add Margin
             rec.setCurrentSublistValue(
             {
                sublistId: 'item',
                fieldId: 'custcol_orig_rate',
                value: handlingSell,
             } )
             // Commmit The Item
             rec.commitLine(
             {
                "sublistId": "item"
             } );
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda