Fixes issue 30070: NPE when navigating from Payment In/Out Lines tab
authorAlvaro Ferraz <alvaro.ferraz@openbravo.com>
Tue, 02 Jun 2015 11:59:51 +0200
changeset 26861 72a46a4bb692
parent 26860 0b60872f78f5
child 26862 cf75c68bd2e0
Fixes issue 30070: NPE when navigating from Payment In/Out Lines tab

ReferencedLink was checking reference record when navigating from Order Payment Schedule or Invoice Payment Schedule fields from Payment In Lines or Payment Out Lines tab; in order to know where the record had to navigate to.
When the value of this field was empty, a Null Pointer Exception was raised. Now, in this case, a "Record empty" exception will be raised.
Also, those fields will be now not displayed if their value is empty.
Duplicated Order Payment Schedule and Invoice Payment Schedule fields have been removed also in those tabs, what was causing an error in int-full-oracle-compile-all job.
src-db/database/sourcedata/AD_FIELD.xml
src/org/openbravo/erpCommon/utility/ReferencedLink.java
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed May 20 16:30:14 2015 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Tue Jun 02 11:59:51 2015 +0200
@@ -181458,34 +181458,6 @@
 <!--09EBD591E2334479AB46E0822F34A930-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--09EBD591E2334479AB46E0822F34A930--></AD_FIELD>
 
-<!--0AA97BC575E040EF8314AFE584112FD0--><AD_FIELD>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <AD_FIELD_ID><![CDATA[0AA97BC575E040EF8314AFE584112FD0]]></AD_FIELD_ID>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <NAME><![CDATA[Order Payment Schedule]]></NAME>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <AD_TAB_ID><![CDATA[34DA12C2E9E3424E9A853563BEFDE81F]]></AD_TAB_ID>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <AD_COLUMN_ID><![CDATA[7FF2BE0C560241FDE040007F010060C1]]></AD_COLUMN_ID>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <PROPERTY><![CDATA[orderPaymentSchedule]]></PROPERTY>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <IGNOREINWAD><![CDATA[Y]]></IGNOREINWAD>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <SEQNO><![CDATA[50]]></SEQNO>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <GRID_SEQNO><![CDATA[270]]></GRID_SEQNO>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--0AA97BC575E040EF8314AFE584112FD0-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
-<!--0AA97BC575E040EF8314AFE584112FD0--></AD_FIELD>
-
 <!--0AF3D682A04A4974A0645192BC014F37--><AD_FIELD>
 <!--0AF3D682A04A4974A0645192BC014F37-->  <AD_FIELD_ID><![CDATA[0AF3D682A04A4974A0645192BC014F37]]></AD_FIELD_ID>
 <!--0AF3D682A04A4974A0645192BC014F37-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -191727,7 +191699,8 @@
 <!--25D13EE69A8847B08B30F2FB50E522A4-->  <AD_TAB_ID><![CDATA[809C66481863428C8D714F2018644CC6]]></AD_TAB_ID>
 <!--25D13EE69A8847B08B30F2FB50E522A4-->  <AD_COLUMN_ID><![CDATA[7FF2BE0C560341FDE040007F010060C1]]></AD_COLUMN_ID>
 <!--25D13EE69A8847B08B30F2FB50E522A4-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--25D13EE69A8847B08B30F2FB50E522A4-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--25D13EE69A8847B08B30F2FB50E522A4-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--25D13EE69A8847B08B30F2FB50E522A4-->  <DISPLAYLOGIC><![CDATA[@FIN_Payment_Schedule_Invoice@!'']]></DISPLAYLOGIC>
 <!--25D13EE69A8847B08B30F2FB50E522A4-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
 <!--25D13EE69A8847B08B30F2FB50E522A4-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--25D13EE69A8847B08B30F2FB50E522A4-->  <SEQNO><![CDATA[40]]></SEQNO>
@@ -206574,34 +206547,6 @@
 <!--4D5E3039BF884EF4BB3DE4951AF9C602-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--4D5E3039BF884EF4BB3DE4951AF9C602--></AD_FIELD>
 
-<!--4D7210CF7CDC46278CCD3E6C34590D52--><AD_FIELD>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <AD_FIELD_ID><![CDATA[4D7210CF7CDC46278CCD3E6C34590D52]]></AD_FIELD_ID>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <NAME><![CDATA[Invoice Payment Schedule]]></NAME>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <AD_TAB_ID><![CDATA[34DA12C2E9E3424E9A853563BEFDE81F]]></AD_TAB_ID>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <AD_COLUMN_ID><![CDATA[7FF2BE0C560341FDE040007F010060C1]]></AD_COLUMN_ID>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <PROPERTY><![CDATA[invoicePaymentSchedule]]></PROPERTY>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <SEQNO><![CDATA[60]]></SEQNO>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <GRID_SEQNO><![CDATA[370]]></GRID_SEQNO>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--4D7210CF7CDC46278CCD3E6C34590D52-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
-<!--4D7210CF7CDC46278CCD3E6C34590D52--></AD_FIELD>
-
 <!--4D99FA18C5684C45A3CDAB5381AB721B--><AD_FIELD>
 <!--4D99FA18C5684C45A3CDAB5381AB721B-->  <AD_FIELD_ID><![CDATA[4D99FA18C5684C45A3CDAB5381AB721B]]></AD_FIELD_ID>
 <!--4D99FA18C5684C45A3CDAB5381AB721B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -208044,7 +207989,8 @@
 <!--520042E69DD34530A5A02148D2F14D05-->  <AD_TAB_ID><![CDATA[809C66481863428C8D714F2018644CC6]]></AD_TAB_ID>
 <!--520042E69DD34530A5A02148D2F14D05-->  <AD_COLUMN_ID><![CDATA[7FF2BE0C560241FDE040007F010060C1]]></AD_COLUMN_ID>
 <!--520042E69DD34530A5A02148D2F14D05-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--520042E69DD34530A5A02148D2F14D05-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--520042E69DD34530A5A02148D2F14D05-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--520042E69DD34530A5A02148D2F14D05-->  <DISPLAYLOGIC><![CDATA[@FIN_Payment_Schedule_Order@!'']]></DISPLAYLOGIC>
 <!--520042E69DD34530A5A02148D2F14D05-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
 <!--520042E69DD34530A5A02148D2F14D05-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--520042E69DD34530A5A02148D2F14D05-->  <SEQNO><![CDATA[30]]></SEQNO>
@@ -253154,34 +253100,6 @@
 <!--9670FA4B7131465FA2A6FA6E93D77BDF-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--9670FA4B7131465FA2A6FA6E93D77BDF--></AD_FIELD>
 
-<!--967489DF64CB47BF96F571C3EA28A236--><AD_FIELD>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <AD_FIELD_ID><![CDATA[967489DF64CB47BF96F571C3EA28A236]]></AD_FIELD_ID>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <NAME><![CDATA[Order Payment Schedule]]></NAME>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <AD_TAB_ID><![CDATA[809C66481863428C8D714F2018644CC6]]></AD_TAB_ID>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <AD_COLUMN_ID><![CDATA[7FF2BE0C560241FDE040007F010060C1]]></AD_COLUMN_ID>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <PROPERTY><![CDATA[orderPaymentSchedule]]></PROPERTY>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <SEQNO><![CDATA[50]]></SEQNO>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <GRID_SEQNO><![CDATA[270]]></GRID_SEQNO>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--967489DF64CB47BF96F571C3EA28A236-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
-<!--967489DF64CB47BF96F571C3EA28A236--></AD_FIELD>
-
 <!--96765FC7606648C6841BA794FC08F690--><AD_FIELD>
 <!--96765FC7606648C6841BA794FC08F690-->  <AD_FIELD_ID><![CDATA[96765FC7606648C6841BA794FC08F690]]></AD_FIELD_ID>
 <!--96765FC7606648C6841BA794FC08F690-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -261028,7 +260946,8 @@
 <!--ABED0A65D75A499C9D21BB8E9FE7AEF4-->  <AD_TAB_ID><![CDATA[34DA12C2E9E3424E9A853563BEFDE81F]]></AD_TAB_ID>
 <!--ABED0A65D75A499C9D21BB8E9FE7AEF4-->  <AD_COLUMN_ID><![CDATA[7FF2BE0C560241FDE040007F010060C1]]></AD_COLUMN_ID>
 <!--ABED0A65D75A499C9D21BB8E9FE7AEF4-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--ABED0A65D75A499C9D21BB8E9FE7AEF4-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--ABED0A65D75A499C9D21BB8E9FE7AEF4-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--ABED0A65D75A499C9D21BB8E9FE7AEF4-->  <DISPLAYLOGIC><![CDATA[@FIN_Payment_Schedule_Order@!'']]></DISPLAYLOGIC>
 <!--ABED0A65D75A499C9D21BB8E9FE7AEF4-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
 <!--ABED0A65D75A499C9D21BB8E9FE7AEF4-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--ABED0A65D75A499C9D21BB8E9FE7AEF4-->  <SEQNO><![CDATA[30]]></SEQNO>
@@ -286140,7 +286059,8 @@
 <!--CF026FDA7C614852B4A3A74A1B3EFA48-->  <AD_TAB_ID><![CDATA[34DA12C2E9E3424E9A853563BEFDE81F]]></AD_TAB_ID>
 <!--CF026FDA7C614852B4A3A74A1B3EFA48-->  <AD_COLUMN_ID><![CDATA[7FF2BE0C560341FDE040007F010060C1]]></AD_COLUMN_ID>
 <!--CF026FDA7C614852B4A3A74A1B3EFA48-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--CF026FDA7C614852B4A3A74A1B3EFA48-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--CF026FDA7C614852B4A3A74A1B3EFA48-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--CF026FDA7C614852B4A3A74A1B3EFA48-->  <DISPLAYLOGIC><![CDATA[@FIN_Payment_Schedule_Invoice@!'']]></DISPLAYLOGIC>
 <!--CF026FDA7C614852B4A3A74A1B3EFA48-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
 <!--CF026FDA7C614852B4A3A74A1B3EFA48-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--CF026FDA7C614852B4A3A74A1B3EFA48-->  <SEQNO><![CDATA[40]]></SEQNO>
@@ -301887,34 +301807,6 @@
 <!--F489C0DA5BFE40D28C0C888FBC1EF4A5-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--F489C0DA5BFE40D28C0C888FBC1EF4A5--></AD_FIELD>
 
-<!--F492C58D6C10449E8A98A09B21F6046A--><AD_FIELD>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <AD_FIELD_ID><![CDATA[F492C58D6C10449E8A98A09B21F6046A]]></AD_FIELD_ID>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <NAME><![CDATA[Invoice Payment Schedule]]></NAME>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <AD_TAB_ID><![CDATA[809C66481863428C8D714F2018644CC6]]></AD_TAB_ID>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <AD_COLUMN_ID><![CDATA[7FF2BE0C560341FDE040007F010060C1]]></AD_COLUMN_ID>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <PROPERTY><![CDATA[invoicePaymentSchedule]]></PROPERTY>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <SEQNO><![CDATA[60]]></SEQNO>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <GRID_SEQNO><![CDATA[370]]></GRID_SEQNO>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--F492C58D6C10449E8A98A09B21F6046A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
-<!--F492C58D6C10449E8A98A09B21F6046A--></AD_FIELD>
-
 <!--F4A7AD7B84CB49E08F3B5FF360389061--><AD_FIELD>
 <!--F4A7AD7B84CB49E08F3B5FF360389061-->  <AD_FIELD_ID><![CDATA[F4A7AD7B84CB49E08F3B5FF360389061]]></AD_FIELD_ID>
 <!--F4A7AD7B84CB49E08F3B5FF360389061-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/erpCommon/utility/ReferencedLink.java	Wed May 20 16:30:14 2015 +0200
+++ b/src/org/openbravo/erpCommon/utility/ReferencedLink.java	Tue Jun 02 11:59:51 2015 +0200
@@ -27,6 +27,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.lang.StringUtils;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.model.Entity;
@@ -235,33 +236,38 @@
 
       }
 
-      else if (strTableReferenceId.equals("CE9AFF5F51B846AEAB0B6CBF829092CD")
-          && (strWindowId.equals("E547CE89D4C04429B6340FFA44E70716") || strWindowId
-              .equals("6F8F913FA60F4CBD93DC1D3AA696E76E"))) {
+      else if (StringUtils.equals(strTableReferenceId, "CE9AFF5F51B846AEAB0B6CBF829092CD")
+          && (StringUtils.equals(strWindowId, "E547CE89D4C04429B6340FFA44E70716") || StringUtils
+              .equals(strWindowId, "6F8F913FA60F4CBD93DC1D3AA696E76E"))) {
         // Navigate to FIN_Payment_Schedule from Payment In or Payment Out: select destination
         // window depending on the source window
         try {
           OBContext.setAdminMode();
-          FIN_PaymentSchedule paymentSchedule = OBDal.getInstance().get(FIN_PaymentSchedule.class,
-              strKeyReferenceId);
-          if (paymentSchedule.getOrder() != null) {
-            // Order Payment Schedule
-            strTableReferenceId = "70E57DEA195843729FF303C9A71EBCA3";
-            if (strWindowId.equals("E547CE89D4C04429B6340FFA44E70716")) {
-              // Payment In window -> Sales Order
-              strWindowId = "143";
-            } else if (strWindowId.equals("6F8F913FA60F4CBD93DC1D3AA696E76E")) {
-              // Payment Out window -> Purchase Order
-              strWindowId = "181";
-            }
-          } else if (paymentSchedule.getInvoice() != null) {
-            // Invoice Payment Schedule
-            if (strWindowId.equals("E547CE89D4C04429B6340FFA44E70716")) {
-              // Payment In window -> Sales Invoice
-              strWindowId = "167";
-            } else if (strWindowId.equals("6F8F913FA60F4CBD93DC1D3AA696E76E")) {
-              // Payment Out window -> Purchase Invoice
-              strWindowId = "183";
+          if (StringUtils.isEmpty(strKeyReferenceId)
+              || StringUtils.equals(strKeyReferenceId, "null")) {
+            throw new ServletException("Record empty");
+          } else {
+            FIN_PaymentSchedule paymentSchedule = OBDal.getInstance().get(
+                FIN_PaymentSchedule.class, strKeyReferenceId);
+            if (paymentSchedule.getOrder() != null) {
+              // Order Payment Schedule
+              strTableReferenceId = "70E57DEA195843729FF303C9A71EBCA3";
+              if (strWindowId.equals("E547CE89D4C04429B6340FFA44E70716")) {
+                // Payment In window -> Sales Order
+                strWindowId = "143";
+              } else if (strWindowId.equals("6F8F913FA60F4CBD93DC1D3AA696E76E")) {
+                // Payment Out window -> Purchase Order
+                strWindowId = "181";
+              }
+            } else if (paymentSchedule.getInvoice() != null) {
+              // Invoice Payment Schedule
+              if (strWindowId.equals("E547CE89D4C04429B6340FFA44E70716")) {
+                // Payment In window -> Sales Invoice
+                strWindowId = "167";
+              } else if (strWindowId.equals("6F8F913FA60F4CBD93DC1D3AA696E76E")) {
+                // Payment Out window -> Purchase Invoice
+                strWindowId = "183";
+              }
             }
           }
         } finally {