I’m working on the addition of Landed Cost Driver rows to a Purchase Order via the API on P21 version 21.1.4524. Adding a row works; my problem is selecting the correct driver when two drivers share the same code.
What works
Adding a new row to the Landed Cost tab succeeds. Using m_add via POST /v2/tools on datawindow tabpage_landed_cost, I get a new empty row (TotalRows increments, the new empty _internalrowindex row is present on GET /v2/data). Setting a unique driver code into landed_cost_driver_cd via PUT /v2/change resolves fine and the row populates.
The problem
When the driver code is not unique, it fails. In our company (1234) the code DUTY 1.4+50 maps to two drivers:
- DUTIES, multiplier 0.019, Landed Cost Driver Uid 112
- TARIFFS, multiplier 0.5, Landed Cost Driver Uid 133
An error has occurred accessing landed cost driver %s information. Potential reasons: 1) not valid for the specified company 2) does not exist 3) has been deleted.
In the desktop GUI, the same action does NOT fail — typing the code and pressing Enter opens a “Find Landed Cost Driver” popup that lists both rows (including the Uid column) and lets the user pick one.
What I’ve tried / ruled out
- No Find tool exists. I enumerated tools via
GET /v2/toolsat window, datawindow, and field level (fieldName=landed_cost_driver_cd, row=2). The field-level tools are only:m_insert, m_add, m_delete, m_recalculatelandedcost, m_showdriversextendedinfo, m_edit, m_translate, m_dcp(DynaChange), plus MyMenu/Tasks/Help. There is nom_find/m_search/m_zoomto open the lookup popup. PUT /v2/changedoes not auto-open the popup (withResponseWindowHandlingEnabled: true) — it just returns Failure, neverStatus: 3/windowopened. So I never get aresponseWindowIdfor the Find window.- UID into the code field fails —
landed_cost_driver_cd = "112"errors with “accessing landed cost driver 112”, i.e. the field only accepts the code, not the UID. - Transaction API (
PurchaseOrderservice) — the landed cost line elementTABPAGE_LANDED_COST.tabpage_landed_costonly exposeslanded_cost_driver_cd, landed_cost_driver_desc, application_point_cd, payable_to, multiplier, calculation_method, dollar_amount, landed_cost_amt, currency_id, tax_driver_flag. There’s no category / driver_type / UID field on the PO line to disambiguate, so a duplicate code can’t be resolved here either.
My questions
- Is there any way via the Interactive API to programmatically open the “Find Landed Cost Driver” popup (i.e. simulate the Enter/AcceptText that the GUI does), so I can read it, select the correct row by Uid, and click OK?
- If not, is there a field on the PO landed cost line (visible or hidden) that accepts the driver UID directly, so the lookup is bypassed?
- Is the only reliable approach to ensure unique landed cost driver codes, or is there a supported pattern (DynaChange popup suppression, stored procedure, etc.) for selecting among same-coded drivers via API?
Any guidance appreciated. Happy to share full request/response payloads.