documentCapture.getRemainingFreeUsage.promise() Syntax Guide

SuiteScript 2.1 syntax for calling documentCapture.getRemainingFreeUsage.promise() and handling its result with then().

·2 min read·View Oracle Docs

This syntax reference shows how to call documentCapture.getRemainingFreeUsage.promise() and attach a then() callback. Oracle identifies the sample as syntax only, not a functional implementation. Complete N/documentCapture samples are available for PDF text extraction and synchronous or asynchronous document-content extraction in SuiteScript 2.1.

How do you call documentCapture.getRemainingFreeUsage.promise()?

Use the member with no arguments, then attach a callback through then(). The supplied syntax passes the resolved value to a callback parameter named result.

suitescript
1// Add additional code
2...
3
4documentCapture.getRemainingFreeUsage.promise().then(function(result) {
5 // Work with the result
6});
7
8...
9// Add additional code

The code before and after the call is represented by comments and ellipses. The callback body is also intentionally left as a placeholder: // Work with the result.

What does the provided sample establish?

The sample establishes the call shape for the promise member:

  • Call documentCapture.getRemainingFreeUsage.promise().
  • Attach then(function(result) { ... }) to the returned promise.
  • Place code that works with result inside that callback.

It does not provide a complete script or show what should happen before the call, after the callback, or inside the callback. It also does not define the contents or format of result. Treat the snippet as member syntax rather than a copy-and-run implementation.

Where can you find complete N/documentCapture examples?

Oracle directs developers to N/documentCapture Module Script Samples for a complete script example. That sample collection pertains to SuiteScript 2.1 and includes examples for:

  • Extracting text from a PDF file.
  • Extracting feature content from a document synchronously.
  • Extracting content from a document asynchronously.

Use those examples when you need a complete N/documentCapture script context rather than the isolated member syntax shown here.

Who This Affects

  • SuiteScript 2.1 developers: Developers adding the promise-based member call to an N/documentCapture script.
  • Developers reviewing sample code: Anyone who needs to distinguish the member’s syntax from a complete, functional script example.

Key Takeaways

  • documentCapture.getRemainingFreeUsage.promise() is shown with a then() callback.
  • The callback receives a parameter named result in the supplied syntax.
  • Oracle labels this code as syntax only, not a functional example.
  • Complete N/documentCapture examples are available in the linked SuiteScript 2.1 sample collection.
  • For separate syntax references, see llm.getRemainingUsage() Syntax in SuiteScript 2026.2, N/http Module Syntax for SuiteScript Redirects, and NetSuite Record Syntax for SuiteScript 2.x Operations.

Frequently Asked Questions (4)

How do you call documentCapture.getRemainingFreeUsage.promise() and handle its result?
Call documentCapture.getRemainingFreeUsage.promise() with no arguments, then attach a callback using .then(function(result) { ... }). Place the code that works with the resolved value inside that then() callback.
Is the provided code a complete, runnable example I can copy and run?
No. Oracle labels the snippet as syntax only and not a functional implementation; it does not show what should happen before or after the call or define the contents or format of result. Treat the snippet as member syntax rather than a copy-and-run script.
Where can I find complete N/documentCapture script examples for SuiteScript 2.1?
Oracle directs developers to the N/documentCapture Module Script Samples at https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_0703022052.html. That sample collection includes examples for extracting text from a PDF, extracting document content synchronously, and extracting document content asynchronously.
Who is affected by this syntax reference?
SuiteScript 2.1 developers who are adding the promise-based member call to an N/documentCapture script. Also developers reviewing sample code who need to distinguish the member’s syntax from a complete, functional script example.
Source: Syntax Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in AI

View all AI articles →