Skip to main content
1-Visitor
February 7, 2017
Question

IM: how can i get the max. fieldsize (not the length of the value) in a trigger script?

  • February 7, 2017
  • 1 reply
  • 3877 views

Hi all,

we want to copy some field values from one short text field to another short text field by a trigger. Unfortunately it is actually possible that the string in the source field is longer than the max. length of the destination field. In such a case the user gets an error message, and the transaction will be aborted.

I didn't find any function to get the field size in the trigger documentation. Is there any way to get this information available to a trigger script? 

Thanks, Jens

1 reply

17-Peridot
May 6, 2017

Hello Jens,

there is this Class LocalTriggerManager.ScriptFieldBean

But, I can t find any len or length information, only maxvalue, but this is not what you need.

Looks like the current Bean version is not exposing the length

You may go with a propery file instead where you store the field name and lenght separately, that the trigger can read it from there.

Volker

JensN.1-VisitorAuthor
1-Visitor
May 8, 2017

Hello Volker,

maxValue would be OK for me, but it seems to work only with fields of type INT or FLOAT.

The regarding information seems to be available, at least you can set a max. Textlength via Admin-GUI or CLI, so Integrity can work with it. But unfortunately it isn't available via Trigger-API...

kind regards, Jens

17-Peridot
May 8, 2017

Hello Jens,

Just another idea: what about calling the Integrity API directly from the trigger (not through the beans)?

Then, your result set is different and I hope then the field lenght will be returned.

Have you tried this?

Volker