advpl-advanced

Implement ADVPL/TLPP transactions, TReport outputs, and bulk file processing.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/JoniPraia/plugadvpl --skill advpl-advanced
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: advpl-advanced
Source: https://github.com/JoniPraia/plugadvpl/tree/main/skills/advpl-advanced
Command: npx skills add https://github.com/JoniPraia/plugadvpl --skill advpl-advanced

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you implement advanced ADVPL/TLPP patterns (transactions, structured reports, bulk file I/O, grids, threads, and classic OOP) without falling into common legacy mistakes or reliability traps.

Core Features & Use Cases

  • ACID transactions with lock safety: use Begin Transaction/DisarmTransaction() to make multi-table updates atomic while avoiding UI calls that can deadlock.
  • Structured reporting with TReport: generate PDF/Excel/CSV/TXT/HTML outputs using TReport, TRSection, and TRCell instead of legacy report flows.
  • High-volume text file processing: handle SPED/EDI/SEFAZ-style files efficiently with FT_FUse/FT_FReadLn (family 2) and temporary staging with FWTemporaryTable.
  • Dynamic grids outside MVC: build ad-hoc datasets using MsNewGetDados for importers/select popups.
  • Concurrency & advanced language techniques: run parallel work using MsRunInThread (with strict GetArea/RestArea discipline) and apply reflection primitives like Type/ValType.
  • Classic ADVPL OOP patterns: structure behavior with Class/Method/Self for better modularization in classic codebases.

Quick Start

Use the advpl-advanced skill when you need to create an ACID multi-table update and a structured TReport in the same change, while also reading a large SPED/EDI text file efficiently.

Frequently Asked Questions about advpl-advanced

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement ACID transactions in ADVPL without deadlocks?

ACID transactions in ADVPL require `Begin Transaction` and `DisarmTransaction()` to make multi-table updates atomic. Avoid UI calls inside the transaction block to prevent deadlocks, and ensure proper rollback handling when database writes fail.

What is the best way to generate PDF and Excel reports using TReport?

TReport generates PDF, Excel, CSV, TXT, and HTML outputs using `TReport`, `TRSection`, and `TRCell` structures. This approach replaces legacy report flows by providing structured sections and cells for reliable data formatting across multiple file formats.

How do I process large SPED and EDI text files efficiently in ADVPL?

Efficient bulk text file processing in ADVPL uses `FT_FUse` and `FT_FReadLn` from family 2 to stream large SPED/EDI/SEFAZ files line by line. Optional staging via `FWTemporaryTable` allows reliable data handling during high-volume file imports.

Can I use MsRunInThread safely with database operations in ADVPL?

`MsRunInThread` supports parallel database operations in ADVPL when paired with strict `GetArea` and `RestArea` discipline for thread safety. This ensures each thread maintains isolated workspaces without corrupting shared table state during concurrent execution.

Does ADVPL support OOP patterns for modularizing legacy codebases?

ADVPL supports classic OOP patterns using `Class`, `Method`, and `Self` keywords to structure behavior and improve modularization. Reflection primitives like `Type` and `ValType` provide additional runtime inspection capabilities for advanced codebase refactoring.

Why does my ADVPL transaction rollback fail when calling UI functions?

Transaction rollback fails because UI calls inside `Begin Transaction` blocks can deadlock the process. To ensure reliable `DisarmTransaction()` behavior, keep transactional blocks strictly limited to database updates and separate all user interaction outside the atomic scope.