Skip to main content

Posts

Showing posts from January, 2022

APEX Blueprint, YMMV (part 2)

H How you done things might be obvious to you now, but not you in the future. Not to mention your colleagues. So if you want to avoid being asked the WTF question, think about how to make your code clean and readable. If you didn't read part 1 about Obvious things + Database rules (tips) , please do that first. APEX Workspace Consider using single workspace with multiple schemas on the same instance (it promotes sharing objects between apps) workspace files access related schemas with grants possibility to publish/subscribe to Master app (theme, authentication, LOVs...) Put apps into groups, use app numbers to your advantage create gaps (for related and translated apps) keep similar/related apps close together Set workspace color according to the environment type (from APEX 21.2) you will need workspace admin for that Application setup Go through all options in Shared components and try to understand the

APEX Blueprint, YMMV (part 1)

I In APEX it is easy to create a mess. Little knowledge, a lot of damage. There are usually multiple paths to the same goal and it takes some time to catch good practices and know where to use what approach. Publishing any sort of guidelines is brave or foolish, but here are my recommendations. I wish this document will help you to achieve inner peace and ease frustration of your colleagues when they will have to change your code. I don't expect you to agree with everything. Take it or leave it. If it doesn't suit you, find guidelines from someone else or create your own. I decided to split it into two parts to keep them reasonable long and digestible: Obvious things + Database rules (tips) APEX rules (tips) Welcome to the part one. Obvious things (but sometimes hard to do) Motto: If you are writing it twice, you are doing it wrong. Keep whatever you can in database, not in APEX easier maintenance, support, debugging (changes) easier governance/control (diff) reusa

Customization of the APEX modal page, Redwood

C Customizing modal page can be tricky, specially if you are doing it for the first time. My main concerns are the header (style) and the width of the window. Default representation (the header is a bit dull and hard to customize): Target state (keep just the gray border to move the window around): Adjusting width Let's go through steps needed to achieve this. To adjust default width is easy, you just need to set it in Dialog properties on the modal page. I overlooked it and tried to adjust it via Javascript first. Silly. Adjusting header Adjusting the original header is a bit difficult. I tried modifing the Modal Dialog template, but the header is just not there. It is most likely part of the Standard page template. Anyway, there is nice moving functionality attached to it and so is the Escape key event to close the dialog. So you really don't want to fully get rid of it. So let's just hide the the header and the button. The trick is that you hav

Sharing pages across multiple APEX apps

D Did you ever wanted to share some pages across multiple applications? I certainly did. I have a Dashboard page with some other pages I would like to share in several apps in the same APEX workspace. Copying these from one app to another is time consuming. Pages, supporting objects, data... And keeping all of these pages and objects synced is a nightmare. Fortunately you can easily setup your APEX apps/workspace so it will allow you seamless transitions from one app to another without the need of re-authentication. You can even run different (or same) apps in multiple tabs in the same browser. To do that you have to run following code as administrator. There is one issue with multiple sessions - if you logoff in one app, it will sign you out from all of them. BEGIN APEX_INSTANCE_ADMIN.SET_PARAMETER ( p_parameter => 'CLONE_SESSION_ENABLED', p_value => 'Y' ); COMMIT; END; / To setup session sharing go to Shared Components - Au