DEV Community

Peter + AI
Peter + AI

Posted on

Simplify Your Uniface Deployments with $ude("getReferenceList") πŸš€

Hey fellow developers! πŸ‘‹ If you've ever worked with a large-scale Uniface application, you know that managing all the different parts for deployment can be a challenge. Making sure you've packed every component, entity, and menu can feel like a treasure hunt. Today, we're looking at a powerful built-in function that makes this process a breeze: $ude("getReferenceList").

Quick note: This post was put together with the help of an AI assistant to break down the official documentation into a more digestible format.

What is $ude("getReferenceList")? πŸ€”

In simple terms, $ude("getReferenceList") is a function in Uniface that automatically discovers all the dependencies for a given application object. Think of it as a smart scanner. You point it at a component, and it creates a complete list of every other resource that component needs to function correctly.

This includes:

  • Components (CPT)
  • Entities (ENT)
  • Global Procs (PRC)
  • Menus (MEN)
  • Panels (PNL)
  • And much more!

The best part is that it's recursive! It doesn't just find direct dependencies; it also finds the dependencies of those dependencies. This ensures you get a complete and accurate picture of everything required for deployment. πŸ“¦

How to Use It: The Syntax

The function signature looks a bit technical at first, but it's pretty straightforward once you break it down.

$ude("getReferenceList", "symboltable;ResourceType", ResourceProfile, {"", OptionList})
Enter fullscreen mode Exit fullscreen mode

Let's look at the main parameters:

  • ResourceType: This tells the function what kind of object you're starting with. Common examples are component, service, or form.
  • ResourceProfile: This is the name of the object you want to analyze, like "MY_MAIN_COMPONENT". Wildcards are supported here too!
  • OptionList: An optional list for providing more context, like specifying a library or language.

A Practical Example πŸ’‘

Let's say you have a component named MY_CPT and you want to find all its runtime dependencies. You would write the following ProcScript code:

$result = $ude("getReferenceList", "symboltable;component", "MY_CPT", "", "")
Enter fullscreen mode Exit fullscreen mode

The function will return a semicolon-separated list in the $result variable. The output might look something like this:

CPT/MY_CPT;
MSG/1763;
CPT/UM2_ORDER;
LIB/UM_LIB;
PNL/UM5_PANEL;
MEN/UM1_STARTBAR;
ENT/NME@NM;
VAR/$$REGISTER@UM_LIB;
ENT/ORDER@UORDERS;
...and so on
Enter fullscreen mode Exit fullscreen mode

As you can see, the output lists every resource by its type code (like CPT for Component or ENT for Entity) and its name. This list is your golden ticket for a successful deployment!

Why Is This So Useful? ✨

The primary use case for $ude("getReferenceList") is to build a reliable deployment process. You can use the generated list to programmatically create a deployment archive (.uar) or distribution set that contains every single required object.

By using this function, you can avoid runtime errors caused by missing resources and make your deployment workflow much more automated and less error-prone. It's a must-have tool for any serious Uniface developer looking to streamline their application lifecycle management.

Happy coding! πŸŽ‰

Top comments (0)