Button to Export a Record into XML

B

Bombay

I have a form setup and I want to have a button you click on that will export
the current record displayed to a XML file. Only the current record, and not
the entire table.

How would I go about this?
 
D

Douglas J. Steele

Create a query that's limited to the single record (make it a parameter
query that gets the ID of the current record from your form), and export the
query, not the table.
 
B

Bombay

Id like to keep this in the forms, because this is something that will need
to be done on a daily basis. Running a query every day for each Item will be
a hassle. Trying to make this as easy and painless as possible.

Thanks
 
D

Douglas J. Steele

As I said, create a query that uses the ID from the form as a parameter.
There's no "running a query" involved: you simply refer to the query in the
export statement rather than the table.
 
B

Bombay

Sorry If I am a little confused.

So you're suggesting I:

1.Create a button that runs a query based on the field displayed?

I want to keep this in the form section, and it to be a button on the form.
 
D

Douglas J. Steele

NO RUNNING OF A QUERY IS REQUIRED!

Presumably you've got code associated with the button that exports the table
to XML. All you have to do is replace the name of the table with the name of
the query you've created.
 
B

Bombay

Thank you for your help, i was able to get that to work.

Now my issue is formatting when it is exported into the XML file.

Several Items have the same PO Number. I wish for the PO Number to show up
only once along with data such as who ordered it, shipping method. The only
info I wish to repeat is the item info. Example of the output file.

- <po_pohdrf00_x0020_Query>
<AUX_PO_NO>BARB0002</AUX_PO_NO>
<PO_HDR_DAT>2007-05-23T00:00:00</PO_HDR_DAT>
<PO_HDR_ORD_BY>BARBARA</PO_HDR_ORD_BY>
<PO_HDR_SHIP_VIA>TRUCK</PO_HDR_SHIP_VIA>
<PO_HDR_SPEC_TERMS>SPECIAL TERMS</PO_HDR_SPEC_TERMS>
<PO_LIN_ITEM_NO>C1860A</PO_LIN_ITEM_NO>
<PO_LIN_ITEM_DESC_1>HEWLETT-PACKARD PLOTTER</PO_LIN_ITEM_DESC_1>
<PO_LIN_ITEM_DESC_2>PAPER C1860A 24" x 150'</PO_LIN_ITEM_DESC_2>
<PO_LIN_QTY_ORD>21</PO_LIN_QTY_ORD>
<PO_LIN_OUR_UNIT>EACH</PO_LIN_OUR_UNIT>
</po_pohdrf00_x0020_Query>
- <po_pohdrf00_x0020_Query>
<AUX_PO_NO>BARB0002</AUX_PO_NO>
<PO_HDR_DAT>2007-05-23T00:00:00</PO_HDR_DAT>
<PO_HDR_ORD_BY>BARBARA</PO_HDR_ORD_BY>
<PO_HDR_SHIP_VIA>TRUCK</PO_HDR_SHIP_VIA>
<PO_HDR_SPEC_TERMS>SPECIAL TERMS</PO_HDR_SPEC_TERMS>
<PO_LIN_ITEM_NO>C4715A</PO_LIN_ITEM_NO>
<PO_LIN_ITEM_DESC_1>HEWLETT-PACKARD DESIGNJET</PO_LIN_ITEM_DESC_1>
<PO_LIN_ITEM_DESC_2>450C "D" SIZE C4715A</PO_LIN_ITEM_DESC_2>
<PO_LIN_QTY_ORD>5</PO_LIN_QTY_ORD>
<PO_LIN_OUR_UNIT>EACH</PO_LIN_OUR_UNIT>


This is how I wish for it to look like.

- <po_pohdrf00_x0020_Query>
<AUX_PO_NO>BARB0002</AUX_PO_NO>
<PO_HDR_DAT>2007-05-23T00:00:00</PO_HDR_DAT>
<PO_HDR_ORD_BY>BARBARA</PO_HDR_ORD_BY>
<PO_HDR_SHIP_VIA>TRUCK</PO_HDR_SHIP_VIA>
<PO_HDR_SPEC_TERMS>SPECIAL TERMS</PO_HDR_SPEC_TERMS>
<PO_LIN_ITEM_NO>C1860A</PO_LIN_ITEM_NO>
<PO_LIN_ITEM_DESC_1>HEWLETT-PACKARD PLOTTER</PO_LIN_ITEM_DESC_1>
<PO_LIN_ITEM_DESC_2>PAPER C1860A 24" x 150'</PO_LIN_ITEM_DESC_2>
<PO_LIN_QTY_ORD>21</PO_LIN_QTY_ORD>
<PO_LIN_OUR_UNIT>EACH</PO_LIN_OUR_UNIT>
<PO_LIN_ITEM_NO>C4715A</PO_LIN_ITEM_NO>
<PO_LIN_ITEM_DESC_1>HEWLETT-PACKARD DESIGNJET</PO_LIN_ITEM_DESC_1>
<PO_LIN_ITEM_DESC_2>450C "D" SIZE C4715A</PO_LIN_ITEM_DESC_2>
<PO_LIN_QTY_ORD>5</PO_LIN_QTY_ORD>
<PO_LIN_OUR_UNIT>EACH</PO_LIN_OUR_UNIT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top