on 01-07-2014 12:18 PM
Hello,
please help with followting problem.
I need to change a binding of a text field (bedrate) dynamically depending of value of another field (FKART).
I can already change a caption of a field (bedrate) but not a value:
if ( xfa.form.data.#pageSet[0].Seite1.FKART.rawValue == "ZIFS") then
bedrate.caption.value.#text = "Service Tax %";
$ =?????
endif
How can I update binding for field (bedrate) to $.DATA.SUMS.SER_RATE?
Do I need to use "record" or smth else?
Thanks
Evgenij
Hello guys,
as you mentioned above, I changed a print program to link another field.
Thanks a lot for suggestions.
Evgenij
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Evgenij,
Click on the BEDRATE field in DATA sub form of the table. Write the below Javascript code.
if ( this.parent.FKART.rawvalue == "ZIFS" )
{
this.rawvalue = "changed value";
}
You can also do it in Formcalc as shown below.
if ( $.parent.FKART.rawvalue eq "ZIFS" ) then
$.rawvalue = "changed value"
endif
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pavan,
you mentioned - $.rawvalue = "changed value".
But then "changed value" is a fix value, and I need value from interface. I need to bind another field from my interface.
Currently I have under data binding for bedrate - $.DATA.SUMS.BEDRATE.
But if FKART = ZIFS, I want to bind $.DATA.SUMS.SER_RATE to bedrate field and it doesnt work.
The major thing is, what is the exact processing time, you need to change the value.
I mean if you know that before the form is processed it is much easier to do it in the driver-program.
There are more than one advantage out of that.
You can debug it,
it is easy to understand and
another developer will get into the thinking very fast.
In case you have to do it while a table is printed and you have to do it for every position dynamic then the above event won't work.
Here you can see the events:
LiveCycle ES2 * Adobe LiveCycle Designer ES2
I know, it is not the SAP Specific, but the events should be the same.
Regards
Florian
Hello Evgenij,
I totally agree with Florian. For such kind of requirement it is always good to handle the code in the driver program or Form Interface. It even increases performance as compared to scripts.
Now coming to the script section, I mentioned the Initialization event since this processing will occur in buffer before the table has been approved in the layout. For your requirement even the script will work for every position because you are writing the script directly on the field itself(i.e the code will be triggered for each value in every row). I dont know about FormCalc debugging but if you want to explore how to debug Javascript you can refer the below link.
How do I set a value dynamically in SAP Adobe Forms using JavaScript - Stack Overflow
But the conclusion is that, for such a requirement even I would recommend the code change in the Driver program or Form Interface.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.