Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Holger S. on April 04, 2019, 09:43:20 am



Title: null values in xml.serializer.variabletodom()
Post by: Holger S. on April 04, 2019, 09:43:20 am
How can I use xml.serializer.variabletodom(rec, n) in 3.10 if rec contains fields with null values
rec is defined with like (rec like artikel.*)


Title: Re: null values in xml.serializer.variabletodom()
Post by: Sisavanh S. on April 04, 2019, 10:20:37 am
Hi,

Do you have a sample we can test ?
I presume you are looking for the XMLNILLABLE attribute ?
For more details, see:
https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_gws_XML_attribute_XMLNillable.html

Best regards,
Sisa.


Title: Re: null values in xml.serializer.variabletodom()
Post by: Holger S. on April 04, 2019, 03:54:32 pm
I see. But that means we have to adapt thousands of source code lines
to replace i.e
define cust record like customer.*
by
define cust record
   cust_id integer primary key,
   cust_name varchar(50) not null,
   cust_address varchar(100) ATTRIBUTES(XMLNillable),
   cust_zipcode char(10)ATTRIBUTES(XMLNillable),
   cust_state char(2) ATTRIBUTES(XMLNillable),
   cust_comment varchar(255) ATTRIBUTES(XMLNillable)
end record
In genero 2.50 it worked with like table.*


Title: Re: null values in xml.serializer.variabletodom()
Post by: Holger S. on April 04, 2019, 05:16:14 pm
Is there any chance to get ATTRIBUTES(XMLNillable)
as default if the compiler sees LIKE <table>.* definitions?


Title: Re: null values in xml.serializer.variabletodom()
Post by: Sisavanh S. on April 04, 2019, 06:22:53 pm
Hi,

Have you tried XMLNILLABLE on the root element only ?
And no XMLNILLABLE for the other embedded  variables ?

For example:
DEFINE cust RECORD ATTRIBUTES(XMLNillable)
   cust_id integer,
   cust_name varchar(50),
   cust_address varchar(100),
   cust_zipcode char(10),
   cust_state char(2),
   cust_comment varchar(255)
END RECORD

If you still have an issue, please contact your local support center.

Best regards,
Sisa.


Title: Re: null values in xml.serializer.variabletodom()
Post by: Reuben B. on April 04, 2019, 10:41:00 pm
Holger,

Did you see the following entry in the 3.10 Upgrade Guide http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_Migrate_to_310_web_services.html

I suspect that you need to follow that and replace

Code
  1. DEFINE cust RECORD LIKE customer.*

with

Code
  1. DEFINE cust RECORD ATTRIBUTE(XMLElementNillable) LIKE customer.*

http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_gws_XML_attribute_XMLElementNillable.html

Reuben




Title: Re: null values in xml.serializer.variabletodom()
Post by: Holger S. on April 05, 2019, 09:40:12 am
Hi Reuben,
I get an error compiling code with Record LIKE definition

  DEFINE pakstat RECORD ATTRIBUTE(XMLElementNillable) LIKE akstatus.*
| Attribute 'XMLElementNillable' is only allowed on a record definition.
| See error number -9007.

fglcomp 3.10.17 rev-889c7091