Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: null values in xml.serializer.variabletodom()  (Read 8468 times)
Holger S.
Posts: 4


« 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.*)
Sisavanh S.
Four Js
Posts: 80


« Reply #1 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.
Holger S.
Posts: 4


« Reply #2 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.*
Holger S.
Posts: 4


« Reply #3 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?
Sisavanh S.
Four Js
Posts: 80


« Reply #4 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.
Reuben B.
Four Js
Posts: 1046


« Reply #5 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



Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Holger S.
Posts: 4


« Reply #6 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
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines