Solved

PL SQL Event - compare entered characters

  • 14 December 2021
  • 5 replies
  • 234 views

Userlevel 7
Badge +22
  • Superhero (Customer)
  • 943 replies

Hi all,

is it possible to fetch the value from any text field in IFS with the PL/SQL developer?

Not the value from data base:

 

Because I need an event which prevents to enter more than 35 characters in the address line 2 field.

My idea is: count all entered characters in a field. If > 35 then do not save and error message in IFS.

 

Thank you

icon

Best answer by Tomas Ruderfelt 14 December 2021, 15:33

View original

This topic has been closed for comments

5 replies

Userlevel 7
Badge +19

 

Yes, it should be possible to fetch the data in PLSQL Developer, and to use it in an event.

The issue here is that from the pictures it looks like you are on payment address on Supplier or Customer maybe? (Both ends up in the same table: payment_address_tab)

If so the data in the columns in the underlying table are dynamic, depending of the payment format you use. So if you want to create an event you will probably need to limit your validation to a certain format via the payment method.

You can see here which payment format it is connected to methods here:

When you know which payment format you want to limit it is possible to find the connection between name in client and name in table here:

 

If you have trouble finding it anyway, can you share which payment format you are using in your example?

Userlevel 4
Badge +5

Hi @Link,

You can write a trigger and check the length of the required column before insert. This will check the length and insert to the DB only if the certain condition is full filled.

 

Regards,

Dheynoshan

Userlevel 7
Badge +22

 

Yes, it should be possible to fetch the data in PLSQL Developer, and to use it in an event.

The issue here is that from the pictures it looks like you are on payment address on Supplier or Customer maybe? (Both ends up in the same table: payment_address_tab)

If so the data in the columns in the underlying table are dynamic, depending of the payment format you use. So if you want to create an event you will probably need to limit your validation to a certain format via the payment method.

You can see here which payment format it is connected to methods here:

When you know which payment format you want to limit it is possible to find the connection between name in client and name in table here:

 

If you have trouble finding it anyway, can you share which payment format you are using in your example?


Hi Thomas,

exactly. I am in Payment Address on Supplier:

 

My goal is to limit the number of characters of column “Bank Address Line 2” for payment method ISO20022.

 

 

Thank you a lot for answering.

 

Kind regards

Userlevel 7
Badge +22

Hi @Link,

You can write a trigger and check the length of the required column before insert. This will check the length and insert to the DB only if the certain condition is full filled.

 

Regards,

Dheynoshan


Hi Nadaraja,

but how can I compare the value from a text field?

My current code:

declare
PRAGMA AUTONOMOUS_TRANSACTION;
v_data8      String(120);

begin
select pa.data8
into v_data8
from IFSAPP.PAYMENT_ADDRESS_TAB pa
where pa.identity = '&NEW:IDENTITY'
and pa.company = '&NEW:COMPANY'
and pa.way_id = '&NEW:WAY_ID'
and pa.address_id = '&NEW:ADDRESS_ID';

 If  LENGTH(v_data8) > '35' Then
     Error_SYS.Record_General('Attention', ' Bankaddress Line 2 can only consists of 35 characters');
 End If;
COMMIT;
end;

 

Thank you and kind regards.

Userlevel 7
Badge +22

Hi @Link,

You can write a trigger and check the length of the required column before insert. This will check the length and insert to the DB only if the certain condition is full filled.

 

Regards,

Dheynoshan


Hi Nadaraja,

but how can I compare the value from a text field?

My current code:

declare
PRAGMA AUTONOMOUS_TRANSACTION;
v_data8      String(120);

begin
select pa.data8
into v_data8
from IFSAPP.PAYMENT_ADDRESS_TAB pa
where pa.identity = '&NEW:IDENTITY'
and pa.company = '&NEW:COMPANY'
and pa.way_id = '&NEW:WAY_ID'
and pa.address_id = '&NEW:ADDRESS_ID';

 If  LENGTH(v_data8) > '35' Then
     Error_SYS.Record_General('Attention', ' Bankaddress Line 2 can only consists of 35 characters');
 End If;
COMMIT;
end;

 

Thank you and kind regards.

 

 

See also: