Hi Mica,
1) Issue
- In Store Commerce (D365 Commerce), entering a gift card number longer than 30 characters triggers an error: "Gift card numbers may not exceed 30 characters."
- The limitation occurs in the POS UI during gift card entry (as shown in the screenshot)
- A custom payment connector is already implemented, but the POS blocks longer values before reaching the connector
- Requirement is to allow gift card numbers longer than 30 characters
2) Reason
- The limitation is enforced in the POS client (Store Commerce App), not in the payment connector
- From the screenshot stack trace, the error originates from:
- CommerceError
- AddIssueGiftCardDialog.updateCardNumber
- This confirms, that the validation is implemented in POS UI logic (TypeScript / POS SDK layer), what is typically hardcoded in:
- Gift card dialog controls
- POS input validation utilities
Additionally:
- The length limit is aligned with:
- Backend entities (channel DB / HQ tables)
- Gift card number fields are often defined with:
- max length = 30 characters
Therefore:
- Even if UI is extended, backend constraints may still reject longer values
- This is a cross-layer constraint:
- POS UI
- CRT (Commerce Runtime)
- Channel DB schema
- HQ data model
3) Resolution
Standard capability:
- There is no configuration parameter to increase gift card number length
- The 30-character limit is part of standard Commerce design
- Customization approach (required):
Step 1: POS extension (mandatory)
- Extend or override:
- AddIssueGiftCardDialog or relevant input control
- Remove/adjust validation:
- Increase allowed length beyond 30
- Implement via POS extension package (TypeScript)
Step 2: CRT (Commerce Runtime)
- Validate whether:
- Gift card APIs accept longer values
- If not:
- Extend CRT to support longer strings in request/response handling
Step 3: Channel DB + HQ (critical)
- Check database schema:
- Gift card number field length (e.g., nvarchar(30))
- If limited → must extend:
- Channel DB table schema
- Data entities
- HQ tables if applicable
Step 4: End-to-end validation
- Verify flow:
- POS → CRT → Channel DB → HQ → payment connector
- Ensure no truncation occurs at any stage
Important considerations:
- This is high-impact customization:
- Affects data model + UI + integration and requires:
- Full regression testing
- Upgrade impact assessment
Alternative recommendation:
- Instead of increasing length:
- Implement mapping layer in payment connector:
- Convert long external gift card number → shorter internal token (≤30 chars)
- Maintain mapping externally
- This avoids: Deep platform customization
Conclusion
- The 30-character limit is hardcoded and systemic, not configurable
- To extend it, changes are required across:
- POS UI
- CRT
- Data model
- Best practice: use mapping/tokenization approach unless full customization is justified
For a more detailed answer, please provide more information.
Rg,
Alexander
*Due to the complex and different possibilities of deploying Dynamics 365 I highly recommend not to setup the application without some expert/partner or support. (For more information contact me under anassl@inno-solutions.info or visit www.inno-solutions.de)
*The Information comes directly from the manufacturer or provider and are validated (not guaranteed) up to date of creation of the posting.
References:
- Microsoft Licensing Guide
- Microsoft Doc`s/Learn