Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!