Skip to content

Comments

FOUR-25052: 422 when creating Non-PO Invoice Approval from Guided Template#164

Merged
sanjacornelius merged 2 commits into2023-winterfrom
bugfix/FOUR-25052
Feb 18, 2026
Merged

FOUR-25052: 422 when creating Non-PO Invoice Approval from Guided Template#164
sanjacornelius merged 2 commits into2023-winterfrom
bugfix/FOUR-25052

Conversation

@eiresendez
Copy link
Collaborator

@eiresendez eiresendez commented Feb 17, 2026

Issue & Reproduction Steps

The Guided Template script "IDA Helper - Find or Create GL Collection" was failing with 422 Unprocessable Entity when creating GL screens in some tenants.

Root Cause

  • The script had screen_category_id = 1 hardcoded.
  • In some environments/tenants, category id=1 is System (or category IDs differ). Since system screens are hidden by default, the script did not find existing screens and tried to create them again.

That duplicate create hit screen title uniqueness and returned 422.

Reproduction

  1. Use a tenant where screen category IDs differ (or where id=1 maps to System).
  2. Start Guided Template: Non-PO Invoice Approval.
  3. Flow reaches script task "Find or create GL Code Collection".
  4. Observe failure:
  5. POST /api/1.0/screens/ -> 422 Unprocessable Entity.

Solution

  • Updated script logic to remove hard dependency on screen_category_id=1.
  • Added category resolution to select a findable non-system category dynamically.
  • Kept the original lookup style (screens/?filter=...).

Result: script no longer fails when category IDs differ across environments.

How to Test

  1. In a multitenant/local setup, ensure category IDs are not assumed (e.g., id=1 not guaranteed to be non-system).
  2. Run Guided Template Non-PO Invoice Approval.
  3. Confirm script task Find or create GL Code Collection completes.
  4. Confirm no 422 in tenant logs for POST /api/1.0/screens/.
  5. Re-run the same flow to verify no duplicate-create failure.
    6 Validate process continues successfully.

Related Tickets & Packages

@sanjacornelius sanjacornelius merged commit a57282f into 2023-winter Feb 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants