Version field enrichment
- anpal
- Topic Author
- Offline
- Junior Member
- Posts: 31
- Thank you received: 1
Can anyone please explain how field enrichment works?
What I know (please correct me if I'm wrong) is that for fields of an Application XXX that are set as checkfile on Application YYY, if I use Version field ENRICHM.CHAR then the field defined in SS (DEFAULT.ENRICH) of Application YYY is shown. If DEFAULT.ENRICH field is not set in Application YYY then field 1 is shown.
My questions are:
1) Can I change the default enrichment without changing the SS field DEFAULT.ENRICH?
2) How do I add enrichment for fields that are not set as checkfile on an application?
i.e. I have a version and for field AAA I want it to be a dropdown. So I use field DROP.DOWN using an Enquiry. when I select the record I want how do I set enrichment, and of which field?
I am using Desktop release R13.
Thanks
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
2) Create a validation routine and attach it to the field.
In the routine assign the desired value to COMI.ENRI.
e.g.:
SUBROUTINE V.SET.ENRI.FOR.XXX
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.XXX
IF COMI = "" THEN
ETEXT = "no value selected"
CALL STORE.END.ERROR
END
CALL DBR("XXX":FM:xxx.desired.field, COMI, DESCR)
COMI.ENRI = DESCR
RETURN
Please Log in or Create an account to join the conversation.
- anpal
- Topic Author
- Offline
- Junior Member
- Posts: 31
- Thank you received: 1
Relevant to this, I have a Check record routine where I default some fields.
One of the fields is the one taking values from EB.LOOKUP.
Is there a way to have the enrichment in such a case?
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
e.g.
LOOKUP.KEY = "EMPLOYMENT.STATUS*" : COMI
CALL F.READ(FN.EB.LOOKUP,LOOKUP.KEY,R.EB.LOOKUP,F.EB.LOOKUP,'')
COMI.ENRI = R.EB.LOOKUP<EB.LU.DESCRIPTION>
Please Log in or Create an account to join the conversation.
- anpal
- Topic Author
- Offline
- Junior Member
- Posts: 31
- Thank you received: 1
This is exactly what I did, I read from EB.LOOKUP and set the COMI.ENRI.
My question was related to this...let me explain it a bit.
Let's say I have 3 fields that are using the above routine, but one of these fields has a defaulted value (from a check routine).
In this case when the user inputs values in the 2 fields then routine runs and sets the enrichment.
But the third field already has a value so the validation routine will not run to set the enrichment.
So the question is : "How can I set enrichment on this field that already has a value?"
Sorry, I was not clear before.
Thanks
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
IF AF = xxx THEN
IF COMI THEN
R.NEW(xxx) = COMI
END
LOOKUP.KEY = "EMPLOYMENT.STATUS*" : R.NEW(xxx)
....
Please Log in or Create an account to join the conversation.
- anpal
- Topic Author
- Offline
- Junior Member
- Posts: 31
- Thank you received: 1
Thanks
Please Log in or Create an account to join the conversation.
- anpal
- Topic Author
- Offline
- Junior Member
- Posts: 31
- Thank you received: 1
If I choose something from the dropdown the enrichment is shown (because the validation routine is executed). The question is, how can I have enrichment when a field already has value? (see Gender)
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
REFRESH.FIELD.NO Defines the field, value and sub value to be refreshed;
field.multi.sub e.g. 10.2.1
field.multi e.g. 3.1
field e.g. 5
FIELD.ENRI The enrichment that will be set.
This value will always be used if passed.
Where this argument is null, the enrichment will be set
to the CHECKFILE - if there is one.
Please Log in or Create an account to join the conversation.
- anpal
- Topic Author
- Offline
- Junior Member
- Posts: 31
- Thank you received: 1
In my case the enrichment had to be ready at the time of loading.
I found a solution to this. I used common variable T.ENRI.
In the check record, for the fields that I had to default their values, I set T.ENRI with appropriate enrichment and it worked.
Thanks for your support
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
Please Log in or Create an account to join the conversation.
- Glebus Desktop
- Offline
- New Member
- I hate T24
REFRESH.FIELD is doing nothing else than updating the correct T.ENRI ;-)
How this will work in browser?
Please Log in or Create an account to join the conversation.
- anpal
- Topic Author
- Offline
- Junior Member
- Posts: 31
- Thank you received: 1
I'm very positive that if I set manually T.ENRI it works.
At the same line if I use REFRESH.FIELD, the enrichment does not work.
Thanks again for your response.
Please Log in or Create an account to join the conversation.
- Glebus Desktop
- Offline
- New Member
- I hate T24
IF GTSACTIVE THEN
OFS$ENRI<FIELD.NO, VALUE.NO, SUBVALUE.NO> = MESSAGE
END
Please Log in or Create an account to join the conversation.