Community articleUFLWriteForm function
Added by IBM contributorIBM on May 2, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


This function will write a form to the specified file . The version number of the form determines the format of the output file. You can specify whether to compress the output file and whether to observe the transmit and save settings in the form.
If no format is specified, the default is to write the form in the same format in which it was read. If the form in question was created dynamically by your application, UFLWriteForm will, by default, write it as an XFDL form in uncompressed format.


   r_short UFLWriteForm(
      formNodeP theForm,
      r_charP theFilePath,
      formNodeP triggerItem,
      r_u_long flags


Table 1. Function parameters
theForm formNodePThis is the root node of the form that should be written.
theFilePathr_charPThis is the path to the file on the local disk to which the form will be written.
triggerItemformNodePThis is the item that caused the form to be submitted. Set to NULL if the API receives the form in a manner other than transmission.
flagsr_u_longThe following flags are valid:
UFL_TRANSMIT_ALLOW allows the transmit options (that is, transmitdatagroups, transmitgroups, transmititemrefs, transmititems, transmitoptionrefs, transmitpagerefs and transmitoptions) to control which portions of the form are sent. Without this flag, the entire form will be sent regardless of the transmit options in the form.
UFL_SAVE_ALLOW allows the saveformat option to specify what format the form should be saved in. If no format is specified then the form will be saved in the same format that it is read.
Note: Specify 0 if you do not want to enable any of the transmit options.


OK on success or an error code on failure.


The following example uses UFLWriteForm to write the form in memory to a file on the local drive.
   error = UFLWriteForm(form, "output.xfd", NULL, 0); 
      if (error != OK)
         fprintf(stderr, "UFLWriteForm error %hd.\n", error);

Parent topic:
FormNodeP functions