Official Content

If you have a multi-tenant application where the tenant is represented with the Organization entity and you want to automatically generate the filter by OrganizationId in your CRUD options for your back office, you can do the following:

  1. Go to Preferences > Patterns > Fiori for Web. (Note: In order to see the Fiori for Web pattern you have to previously install the GeneXus for SAP Systems in your KB).
     
  2. Open the Pattern Settings, click on the “Transaction Floorplan (Main)”  tab, and select the “List Report” tab.
     
  3. Right-click on “Events & Subs” and add a new EventBlock.
     
  4. For the new EventBlock:
  • Complete the Block Name * property with a name (in this example, GetUserContext).
  • Set the Event/Sub Name property to “Start”.
  • Write in the Code property the code you want to include in the Start event. In this example, a call to the GetUserContext Procedure:                    

        Event Block code created v18u4 fiori Horizon Multitenant

        5. In the “Variables (Not included in Web)” node add the variables needed for the code. In this example, the &UserContextSDT:

image_202369193358_1_png

        6. Right click on “List floorplan - (<TRN_DESCRIPTION>)” and select: Add > Conditions 

image_202369193830_1_png

The “Automatic Conditions” node will be added.

7. To add a new condition, right-click on the “Automatic conditions” node and select:  Add > Condition. Give a name to it (in this case, it is called “FilterByOrganization”).

image_202369194518_1_png

8. Complete the Condition and the Regular Expression property with the attribute name that indicates the tenant (in this example, OrganizationId). This will apply the condition only if OrganizationId is present in the Transaction structure.

image_202369194735_1_png

            These settings are needed in each template available in the Fiori Pattern to generate this kind of CRUD UIs.

image_202369195225_1_png
 

 

 

Last update: November 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant