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

193
Visualizações
Custom field not sourced to work order SuiteScript 2.0

Here is my code snippet for creating a work order:

var TO = record.create({
  type: 'workorder',
  isDynamic: true
});

TO.setValue({
  fieldId: 'customform',
  value: '80'
});

TO.setValue({
  fieldId: 'subsidiary',
  value: 1
});

TO.setValue({
  fieldId: 'location',
  value: 1
});

TO.setValue({
  fieldId: 'assemblyitem',
  value: item
});

TO.setValue({
  fieldId: 'quantity',
  value: qtytobuild
});

var newWO = TO.save({
  ignoreMandatoryFields: true
});

The work order is created with the right quantity to build. The component list (item sublist) is correct in terms of items and quantities. So nothing to worry about there. But, I have a custom field on the item record that is sourced to the work order component sublist (to a transaction line field). It works fine if I manually create the work order, but if I do it with my script it is not sourced. I have tried to set isDynamic:false with the same result.

Does anybody have an idea of what could be causing this?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Try setting the enableSourcing option to true on the save (this defaults to false.

var newWO = TO.save({ ignoreMandatoryFields: true, enableSourcing: true });

about 4 years ago · Juan Pablo Isaza Relatório
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