<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_use_an_Extension_Point</id>
	<title>How to use an Extension Point - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_use_an_Extension_Point"/>
	<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_use_an_Extension_Point&amp;action=history"/>
	<updated>2026-04-06T23:15:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.infinite-erp.co.id/index.php?title=How_to_use_an_Extension_Point&amp;diff=55&amp;oldid=prev</id>
		<title>Wikiadmin: Created page with &quot;== How to use an Extension Point ==  Extension Points are execution points that can be set in any PL/SQL Procedure and that is able to call other PL/SQL Procedures included in...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_use_an_Extension_Point&amp;diff=55&amp;oldid=prev"/>
		<updated>2018-10-14T13:48:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== How to use an Extension Point ==  Extension Points are execution points that can be set in any PL/SQL Procedure and that is able to call other PL/SQL Procedures included in...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== How to use an Extension Point ==&lt;br /&gt;
&lt;br /&gt;
Extension Points are execution points that can be set in any PL/SQL Procedure and that is able to call other PL/SQL Procedures included in any module. This is useful to extend the functionality of existing procedures that contain such an extension point. For example, using the '''C_Invoice_Post - Finish Process''' Extension Point. It is possible for any module to add a PL/SQL procedure to be run whenever an Invoice is processed. This has been used in the Advanced Payables and Receivables module to generate the payment schedule for the processed invoice.&lt;br /&gt;
&lt;br /&gt;
Extension Points are managed in the window '''Application Dictionary || Setup || Extension Points'''. Here can be defined new extension points and new PL/SQL procedures attached to existing Extension Points.&lt;br /&gt;
&lt;br /&gt;
There is a complete list of available extension points and the parameters used in the [[ExtensionPoints | Extension Points]] document.&lt;br /&gt;
&lt;br /&gt;
=== Procedures ===&lt;br /&gt;
&lt;br /&gt;
To attach a PL/SQL procedure to an existing Extension Point you must create a new record in the '''Procedures''' tab and fill in the field '''Procedure''' with the name of the PL/SQL procedure you want to be invoked in the Extension Point selected.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ref-extension-point-procedure.png]]&lt;br /&gt;
&lt;br /&gt;
Finally define the PL/SQL procedure with the same name defined in the field '''Procedure''' and with only one ''character varying'' parameter that will reference the ''AD_EP_INSTANCE'' record that contains all the parameter values used to invoke the PL/SQL procedure. For example all the PL/SQL procedures attached to the Extension Point '''C_Invoice_Post - Finish Process''' are invoked with the following parameters: Record_ID, DocAction, User, Message and Result. The definition of the PL/SQL and how the parameters are read can be seen in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CREATE OR REPLACE FUNCTION aprm_gen_paymentschedule_inv(p_ep_instance character varying)&lt;br /&gt;
  RETURNS void AS&lt;br /&gt;
$BODY$ DECLARE &lt;br /&gt;
&lt;br /&gt;
p_record_id VARCHAR(60);&lt;br /&gt;
p_message VARCHAR(2000);&lt;br /&gt;
p_docAction VARCHAR(60);&lt;br /&gt;
p_user VARCHAR(60);&lt;br /&gt;
p_result NUMERIC;&lt;br /&gt;
&lt;br /&gt;
--TYPE RECORD IS REFCURSOR;&lt;br /&gt;
Cur_Params RECORD;&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
&lt;br /&gt;
  FOR Cur_Params IN (&lt;br /&gt;
    SELECT *&lt;br /&gt;
    FROM ad_ep_instance_para&lt;br /&gt;
    WHERE ad_ep_instance_id = p_ep_instance&lt;br /&gt;
    ) LOOP&lt;br /&gt;
    IF (cur_params.parametername LIKE 'DocAction') THEN&lt;br /&gt;
      p_docaction := Cur_Params.p_string;&lt;br /&gt;
    ELSIF (cur_params.parametername LIKE 'Record_ID') THEN&lt;br /&gt;
      p_record_id := cur_params.p_string;&lt;br /&gt;
    ELSIF (cur_params.parametername LIKE 'User') THEN&lt;br /&gt;
      p_user := cur_params.p_string;&lt;br /&gt;
    ELSIF (cur_params.parametername LIKE 'Message') THEN&lt;br /&gt;
      p_message := cur_params.p_text;&lt;br /&gt;
    ELSIF (cur_params.parametername LIKE 'Result') THEN&lt;br /&gt;
      p_result := cur_params.p_number;&lt;br /&gt;
    END IF;&lt;br /&gt;
  END LOOP;&lt;br /&gt;
&lt;br /&gt;
-- The code goes here&lt;br /&gt;
&lt;br /&gt;
END ; $BODY$&lt;br /&gt;
  LANGUAGE plpgsql VOLATILE&lt;br /&gt;
  COST 100;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is a loop to obtain all the parameters, this loop iterates for all the defined parameters. Here notice that the parameter is identified by ''parametermame'' which matches the defined parameter in the Extension Point and depending on its type the actual value is stored in one of the following columns: ''p_string'', ''p_number'' or ''p_date''.&lt;br /&gt;
&lt;br /&gt;
After the Extension Point attachement has been defined and the PL/SQL procedure has been created it will be executed under the conditions the Extension Point has been defined in the [[ExtensionPoints | Extension Points]] document.&lt;br /&gt;
 &lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Wikiadmin</name></author>
		
	</entry>
</feed>