Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

249
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda