okneb1
12th March 2019, 12:25
Hello all,

I have extension point (LN 10.5) on stand. table A, where I use make.valid hook for changing value on field A.fld1.

We have stand. session stand. AAAAm001 where you can insert record into table A. Whenever user enters something into field A.fld1, make.valid hook gets called where I change value into something else, but the new value isn't refreshed on form until user makes it active again - for example clicks on the field.

For example, steps are (atm can't get 4th one to work):
1. User enters "2000" into field A.fld1
2. User leaves the field A.fld1 with tab or clicking the next field
3. Make valid hook gets called on extension where I change value into "2000-A".
4. Re-display new value in field A.fld without saving or clicking on field again

This is stand. session, no access to code and it is abs. necessary for user to see the changed value without saving first or selecting the field again.
Is this even possible with extension hooks on standard table?

Thank you.

tmannais
12th March 2019, 12:38
try

display.all()

okneb1
12th March 2019, 13:28
try

display.all()

You cannot call display.*** functions in extension points for table. This is table level, it has nothing to do with form.

I also cannot do anything on extension point for session, because you only get hooks for standard fields on print and update sessions, not on modify session.

Problem is basically this: How to implement your own logic for a specific stand. field on stand. modify session (adding new record), using extensions only? You can change the values with make.valid hook. But how do you refresh the values on form with extensibility if you have no hooks for standard fields on them.

For example, you have two fields on stand. modiy session, field A and B, you want to refresh field A when user clicks field B, via standard you would just do display.field on the before.field section for field b. But this is stand. script, you cannot edit it. You only have extensibility point for session, which doesn't have hooks for fields A and B. You have hooks for commands, but I want something to happen after field A and not before or after command C etc etc.

tmannais
13th March 2019, 03:36
Try creating a new Calculated Field in Extension for the session.
In the Calculate Value hook of the Calculated Field you just created, you put your logic in there and make the scope of your logic only occurs when you want because this hook will trigger as if it is before.input of every field passed.

JaapJD
15th March 2019, 12:20
Is there a button behind the field? Then the field will be refreshed after you press tab again.

okneb1
15th March 2019, 14:11
@tmannais, thank you for the suggestion, but I couldn't implement calculated field in such way that it would refresh a value when inserting a new record (ADD).

@JaapJD, there is no button after this field. Session is Items (tcibd0501m000).
I'm trying to implement some sort of auto. item code generation in cases where user is inserting new item with only one character in the item field.
For example,
1. user clicks new item and inserts '3' as new item code
2. as he leaves the field with tab, make.valid hook (extension point for table) gets called where I check the last used number for series 3 in my table, I then change it to first free value, for example -> 3000099.
3. 3000099 is the value in the tcibd001.item but it's not refreshed on the form. User still sees '3'. Only when he selects the field again or saves the item, the 30000099 gets displayed on the form.

Solution is working fine. I would just like the option to show the user new value without the need of first saving the record or selecting the item field again.

JaapJD
15th March 2019, 14:28
Seems to be a bug. I think it is related to the item field, which is a segmented field.

TEKTEK
15th November 2019, 22:45
Hi,

did you solved this issue? If yes, how?

BR

okneb1
25th November 2019, 10:42
Hi tektek,
we didn't solve it :)