Skip to main content

Posts

APEX Deployment Tool - Export database objects

E Exporting database objects is probably the most important thing. Same as for the APEX exports, the more often you do it, the better position you will have. And I store everything in the repo, every single object in database has its own clone in file. I have worked for a company where they stored only changed objects in the repo, imagine that! Every time I am done with a task or at the end of the day I export all changed objects in just few seconds. This is part of multiple ADT articles: Introduction & workflow Setup connections, config, folder structure Recompile invalid objects Searching APEX and searching repo for objects Export APEX & live upload Export database objects (this article) Patching & deployment The fastest way how to get your changes is to export just the objects which changed in past few days. There are more filters available, you can ask for specific object types, names or any combination. cd ~/Documents/YOUR_PROJECT_RE
Recent posts

APEX Deployment Tool - Export APEX

E Exporting APEX should be done often if you are APEX developer. The more often you do it, the better position you will have. I export APEX every morning to see what other team mates changes (and forgot to commit). I also export it after each change. I modify the page, I export it. With this approach you need to export it fast. This is part of multiple ADT articles: Introduction & workflow Setup connections, config, folder structure Recompile invalid objects Searching APEX and searching repo for objects Export APEX & live upload (this article) Export database objects Patching & deployment Export APEX The full export is not always suitable. At least exporting just full export is something not version control friendly. And exporting just the pages is also not a great idea. That is usually done manually by teams who put everything on page, which goes against the Blueprint . You should not have logic (and queries) hardcoded on pages! So t

APEX Deployment Tool - Searching

D Did you ever wondered which database objects are used in your application, in the whole application or just on a specific page? Or to find out where is the specific database object used? Or to find out at which commit was you database object dropped (or created, changed)? This is part of multiple ADT articles: Introduction & workflow Setup connections, config, folder structure Recompile invalid objects Searching APEX and searching repo for objects (this article) Export APEX & live upload Export database objects Patching & deployment Searching APEX The solution for searching APEX is based on parsing the Embedded code report export. So when you have this in your repo (and this is part of the next article on export_apex action), the searching is also faster then searching in APEX, it is also more accurate and the result list is much shorter, because it show just list of objects and pages as a table without all the clutter around. cd ~/D

APEX Deployment Tool - Recompile invalid objects

I Invalid objects are often overlooked. Some teams don't care on DEV, others don't care even on PROD. Why would you care, if all you need to do is to wait for a first user who would crunch through the errors and that would recompile the invalid objects, right? It is not that hard to make sure everything is valid... This is part of multiple ADT articles: Introduction & workflow Setup connections, config, folder structure Recompile invalid objects (this article) Searching APEX and searching repo for objects Export APEX & live upload Export database objects Patching & deployment If you are looking for a PL/SQL solution, checkout the recompile procedure , which is part of the CORE project . ADT comes with improved script which can be part of your CI/CD pipeline. cd ~/Documents/YOUR_PROJECT_REPO/; adt recompile It recompiles invalid objects, but also the valid ones if you need to change PL/SQL flags. You can also limit the objec

APEX Deployment Tool - Setup

T The most complicated part about ADT is the installation. But don't worry, it is not that complicated and everything after that is super easy. This is part of multiple ADT articles: Introduction & workflow Setup connections, config, folder structure (this article) Recompile invalid objects Searching APEX and searching repo for objects Export APEX & live upload Export database objects Patching & deployment Install There is an Install guide in the repo, but in this article I will cover it in more details. You will need Python with some modules, SQLcl, possibly also Instant Client and Git. Here are the steps: clone ADT repo (lets say you clone it here: ~/Documents/ADT/) install any Git client, go for GitHub Desktop if you are new to this install Python 3.11 (and NOT 3.12 or higher) install SQLcl 24.1 install Instant Client 19.16 - required for thick connections (also you might need Java too), you can skip this step

APEX Deployment Tool

I Imagine this: You create a new page in APEX, or change existing one. Create new LOV, create a view for this LOV, create a view for report/grid on page, create a package to handle the logic... Now what? Now you have to get this to version control and you have to deploy it to other environments. So you want it now on test env, but you have to create a patch in a way, which can be run later on prod. With ADT you can do all of this without any effort just in few seconds. The whole idea behind ADT is to move as quickly as possible with minimum hassle for developers, to create something simple to setup, simple to explain, simple to use, so you can quickly start using it. Something which would save you a lot of time every day. This will be split to several articles: Introduction & workflow (this article) Setup connections, config, folder structure Recompile invalid objects Searching APEX and searching repo for objects Export APEX & live upload Export databas

Make radio group looks like tabs

I I like to use tabs. They are neat. They allows you to have multiple regions on page without cluttering page. They can also replace headers, if you have just one region in each tab. But sometimes I would like to have dynamic tabs (not just the names, also the number of tabs), so here is one method how to achieve that: Steps needed: create page item with Type = Radio Group at Settings set number of columns to whatever you need and Page Action to "Redirect and Set Value" (or create DA if you don't want the page refresh) at List of Values properties specify your source for the tabs at Appearance and Template Options pick "Display as Pill Button" at Item Group Display at Appearance add "TABS" as CSS Classes add CSS styles (below) to style these buttons as tabs And here is the CSS for Redwood: /* STYLE RADIO BUTTONS AS TABS */ .TABS .t-Form-labelContainer { display : none; } .TABS .apex-item-grid-row { di

APEX & custom warning messages

D Did you ever wanted to customize user messages? To make them intuitive? Green as success, red as error, yellow as warning? Oh yes, lets add a third message type. Not everything can fit into success or error. To achieve this, I am passing a JSON object as a message and catching this message on page before showing it to users. This allows me to pass the message type or even a unique color, icon and other things (like a DA name to fire after the message). You can modify it however you need. To simplify this and make it more readable, I have created 3 JavaScript functions: show_success show_warning show_error const show_success = function(msg) { apex.message.showPageSuccess(JSON.stringify(get_message(msg, 'SUCCESS'))); }; // const show_warning = function(msg) { apex.message.clearErrors(); apex.message.showErrors([{ type: apex.message.TYPE.ERROR, // sadly no warning supported location: ['page'], message

APEX Alpe Adria 2024

T Third time the charm. I love this conference, love the atmosphere, love the people. This year I have really enjoyed the networking and made few new friends. Sadly, Peter's minions were not present again, and this time nor was Peter. The APEX team was a bit more secretive than usual, but it here are some statements: APEX 24.1 will be a bit late (no news) It might and it might not bring us the 5 features promised on last Kscope (you could actually made and deliver a baby during this waiting) Oracle has build 41 thousands of bespoke internal APEX applications Cloud starting prices for APEX service were dramatically reduced And I have done it. I finally stepped up and presented something on a conference for the first time, in front of a real audience with 70+ people. And that something was a bit controversial topic. Huge thanks to the people supporting me, also huge thanks to all guys who made this conference happen. I have enjoyed it more than ever befor

Insert JavaScript and CSS code to APEX from PL/SQL

O One of my colleagues (lets name him Max) prepared a surprise for me. I had no idea where is the JavaScript code being placed on page. Turned out, there is an API for injecting JavaScript code from PL/SQL and you can do the same with CSS. That is not just an excellent hiding place, but it can be used if you need to attach these on page dynamically. Checkout the APEX_JAVASCRIPT api, especially the ADD_ONLOAD_CODE procedure. For example you can set the JavaScript variable from the PL/SQL. BEGIN APEX_JAVASCRIPT.ADD_ONLOAD_CODE ( p_code => 'variable_name = new_value;' ); END; / Better version would be to escape the value using ADD_VALUE (which is an equivalent of APEX_EXEC.ENQUOTE_LITERAL but for JavaScript) or APEX_JAVASCRIPT.ESCAPE function: BEGIN APEX_JAVASCRIPT.ADD_ONLOAD_CODE ( p_code => 'variable_name = ' || APEX_JAVASCRIPT.ADD_VALUE('new_value', p_add_comma => FALSE) || ';' ); END; /