3 weeks ago
Dear Expert Community,
I have an Adobe output form (DEBIT MEMO) in S4Hana public cloud where I have added a field. The field is visible/invisible on the printout as expected, but the hardcoded value of the field remains empty / doesn't display. The caption of the field is correctly displayed (or not) as prompted by the conditions, proving that the active/inactive conditions work correctly. Just the value of the field doesn't get displayed.
The active/inactive condition of this field, as well as the hardcoded value, are controlled by a piece of java code as shown below (in the below, the real Partner number is replaced by XXXXXX):
<script contentType="application/x-javascript">if(this.parent.Partner.rawValue =="XXXXXX") {this.rawValue =="TEST"}; else
{
this.presence = "inactive";
}
</script>
What could be the reason and what could be done?
Best regards,
Katja
Request clarification before answering.
this.rawValue =="TEST". you have to remove one =
== is for comparison, = is for assignment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have a Screenshot from the dataelement in the livecycle designer with all the needed information? If it runs through the if statement in the javascript I don't think there is a problem with the element itself, but who knows. Maybe you can have a look into the link i sent you -> Scripting basics.
Hi Katja, good question.. I made a little Adobe form with just one textfield and the assignement via Javascript.. that works fine for me:
<?xml version="1.0" encoding="UTF-8"?>
<?xfa generator="AdobeLiveCycleDesigner_V11.0.9.20230422.1.42_SAP" APIVersion="3.6.23111.0"?>
<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" timeStamp="2025-04-23T07:31:33Z" uuid="624e300a-56fe-4812-bfb9-020e615f49ec">
<template xmlns:xliff="urn:oasis:names:tc:xliff:document:1.1" xmlns="http://www.xfa.org/schema/xfa-template/3.3/">
<?formServer defaultPDFRenderFormat acrobat10.0dynamic?>
<subform layout="tb" locale="de_DE" name="data" restoreState="auto">
<pageSet>
<pageArea id="Page1" name="Seite1">
<contentArea h="284.3mm" w="197.3mm" x="0.25in" y="0.25in"/>
<medium long="297mm" short="210mm" stock="a4"/>
<?templateDesigner expand 1?></pageArea>
<?templateDesigner expand 1?></pageSet>
<subform h="284.3mm" w="197.3mm">
<field h="9mm" name="Test" w="62mm" x="57.15mm" y="79.375mm">
<ui>
<textEdit>
<border>
<edge stroke="lowered"/>
</border>
<margin/>
</textEdit>
</ui>
<font typeface="Arial"/>
<margin bottomInset="1mm" leftInset="1mm" rightInset="1mm" topInset="1mm"/>
<para vAlign="middle"/>
<caption reserve="18.0838mm">
<para vAlign="middle"/>
<value>
<text xliff:rid="7175D1FB-772F-4459-94CD-FD4DAE9583F4">Textfeld</text>
</value>
</caption>
<bind match="none"/>
<event activity="initialize" name="event__initialize">
<script contentType="application/x-javascript">this.rawValue = "TEST";
</script>
</event>
</field>
<?templateDesigner expand 1?></subform>
<proto/>
Hi,
I'm not that fit in Javascript via Adobe Forms, but it seems suspicious that you have two '=' signs. Maybe you can try = 'TEST' instead of == 'TEST'.
Does your logic even reach the If statement? There are many ways to fetch the parent values. Maybe you have to change that part. There is a way to fetch it via strings.. maybe that works.
Hope that helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
20 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.