2026-11-27

Sage 100: Script for Extended Item Description in Bill of Materials

Your Sage 100 script to bring the extended item description into BOM detail returns nothing? BM_BillDetail has no ItemCode field — here is the three-hop CI_Item to CI_ExtendedDescription lookup that works.

You want the component item's extended description visible on the Bill of Materials detail line, so you created a UDF on the BOM detail table and wrote a post-validate script to fill it — and the UDF comes up blank every time. The usual first attempt fails for a structural reason: the script asks the bill detail object for a field that is not there, and skips the two lookups that actually lead to the text.

Straight about the evidence: the Sage Community Hub thread that asked this question never posted a finished, confirmed script — it ends with the diagnosis, not a victory lap. But the diagnosis came from two experienced Sage 100 scripters independently, and the complete pattern below is the one documented as the working approach in an earlier Sage Community thread on exactly this requirement (BOM Extended Description). Follow the chain and debug it hop by hop, as the thread prescribes.

The fix

  1. Create the UDF on the BM Bill of Materials Detail table. This is where the retrieved text will live. Size it generously: the extended description text field holds up to 4,096 characters, so either make the UDF a similar size or plan to truncate the text in the script.
  2. Attach the script as a column post-validate on the Component Item Code field of the bill detail. The script must run when a component is chosen, and it must run in the bill detail context — where a script is attached determines what oBusObj points to, which is the first thing to check when a script reads nothing.
  3. Read the component item code from the bill detail — from the component item code field. Do not read "ItemCode$": BM_BillDetail has no field by that name, so that GetValue returns nothing and everything built on it is empty.
  4. Open CI_Item for that component item and read its ExtendedDescriptionKey. The bill detail does not carry the key; the item record does. This is the hop the failed script tried to skip.
  5. Resolve the key through the extended description service object. Use CI_ExtendedDescription_svc, find the record for the key from step 4, and read ExtendedDescriptionText. Handle the items that have no extended description: on Sage 100 2015 and later their key is reported in related extended-description threads as "0000000000" (blank on older data; that specific value was not established in the source thread for this page) — for those, fall back to the item's standard description instead of writing an empty string.
  6. Set the retrieved text into your BOM detail UDF.
  7. Add the UDF to the BOM Lines panel in Customizer, so the description is visible on the component line in Bill Maintenance — visibility in the grid was the requirement that justified scripting this at all.
  8. Debug with message boxes after every hop. Display the component code after step 3, the key after step 4, and the text after step 5. The first empty pop-up is the broken hop. This is not beginner scaffolding — it is the debugging method the thread's experts prescribed, because a three-object chain fails silently at exactly one link.

Options and approaches

Do you need the script at all?

One responder's first question deserves asking on every project: why store the text? If the extended description is only needed on printed output, skip the UDF and the script — link CI_Item and CI_ExtendedDescription into the report and let the report resolve the key at print time. The script-and-UDF approach earns its keep when the description must be visible inside Bill Maintenance itself, on the component line, while the bill is being built or reviewed — which was this client's stated need.

The three-hop chain, in one picture

Bill detail (component item code) → CI_Item (ExtendedDescriptionKey) → CI_ExtendedDescription (ExtendedDescriptionText) → your BOM detail UDF. Every failed attempt at this script collapses the chain — most commonly by treating the item code as if it were the description key, or by looking for the text on the item record, which holds only the key.

What doesn't work

  • oBusObj.GetValue("ItemCode$", ...) against BM_BillDetail — there is no ItemCode field in that table; the call returns nothing. This was the failing line in the original script.
  • Treating the value you do get as the ExtendedDescriptionKey — an item code is not a description key. Used as a key, it finds no record in CI_ExtendedDescription, and the script ends with a blank UDF and no error.
  • Guessing values without instrumentation — the poster retried repeatedly ("I tried it and I still get nothing") without visibility into which hop failed. One run with message boxes would have shown the first GetValue already returning empty.

Affected versions

Worked through on Sage 100 2016 Advanced in the source thread; the same UDF + post-validate pattern with CI_Item and CI_ExtendedDescription_svc is documented for the BOM detail table in earlier Sage 100 / MAS 200-era threads, because the table and object names are unchanged. The empty-key value differs by era: "0000000000" on Sage 100 2015 and later, blank in older data — code for both.

Prevention / best practice

  • Before writing any Sage 100 script, confirm the exact field names on the source table in Data File Display and Maintenance or the object reference. A surprising share of "scripting is hard" is one field name that does not exist.
  • Build every multi-object lookup as separately testable hops, with a message box or log line per hop, and remove the instrumentation only after the chain runs end to end.
  • Remember that oBusObj changes meaning with the script's attachment point. A script that works as a button script in one task can read an entirely different object when moved to a table event.

Related help

Still stuck? Send us a screenshot of the error, we will diagnose it for free.

Digit Masters has supported Sage 100 and Sage 300 since 1997. Send the screenshot through our contact page or to contact@digitmasters.com, or call (800) 965-4262.

Ready to Optimize Your Sage ERP?

Speak with a CPA-led Sage consultant. Free initial consultation — English or Chinese.

Get a Free Consultation