Author: Derek Leung 

Product version: 2024.X (tested on 2024.3)



Need


We have a Product Application managing entity say "Product Family".  We want another Customer Application to display the "Product Family" like an LOV in a Form/Collection without the need to pre-synchronize the "Product Family" from the Product Data Location to the Customer Data Location.  We want to pull the values on-the-fly when the LOV is shown on the Form.

 

Summarized Solution

If the Customer Data Location can access the Product Data Location in database level via SQL, we can leverage Database Function and also Attribute Property to achieve this.


Detailed Solution

Assumption: The Product Data Location can be accessed from the Customer Data Location via SQL. In this secnario, it's two different schemas in the same database (PostgreSQL).

In your Customer Application, define your attribute's Component Type on Form / Collection level as "Menu", and then use a database function to populate the List of Values.


image


The database function could be something like this:
 

CREATE OR REPLACE FUNCTION semarchy_customer_b2c_mdm.dummylov()
 RETURNS text
 LANGUAGE plpgsql
AS $function$
BEGIN
    RETURN (
      SELECT STRING_AGG(name, ';') AS names
      FROM semarchy_product_retail_mdm.gd_family
    );
END;
$function$
;

  


Then the LOV will be pulled on-the-fly from the Product Data Location.

image