Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

PDF Form Time Sheet Web Service Questions

Avatar

Level 1

I have an application I am trying to create that is essentially going to flow as shown bellow:


PDF Form ----- > Web Service(.net) ----- > SQL 2008 DB


The question I have about the TimeEntry is my PDF form has multiple rows for time http://imgur.com/o4hny (image of form) But I actually want it to go to same table and field just new rows. I am looking for a way to loop through the table in the form and submit the data to my webservice.  Thanks!


13 Replies

Avatar

Former Community Member

If you create a single string to hold all of the xml from your form in your web service, then you can create a hidden field to hold the data in your form. Now you need to populate the field with teh data that has been collected. To do this use this code:

fieldname.rawValue = xfa.datasets.data.saveXML("pretty")

Now your field is populated with all of the form data a,nd if you bind the input string to that field when you execute the web service the data in that field will be submitted.

Paul

Avatar

Level 1

Paul, so my question would be. When I create the form what do i link the extra fields to? My issue is the form has lets say 5 Rows and 2 columns. Now my web service links to my TimeSheet table but only has 2 fields when I add the connection to the data source. Day and Hours, so for the 4 remaining rows how do i link it? This is a form I created Live Cycle Designer and I plan on enabling extend rights for the end users.

     DAY  |  Hours     

MON     |   8

TUE          8

WED        8

THU          9    

FRI          8

Avatar

Former Community Member

By giving your fields proper names you will be able to know what each data field represents .....the data woudl look something liek this:

<Timesheet>

     <Monday>

          <Hours>8</Hours>

     </Monday>

     <Tuesday>

          ,<Hours>8</Hours>

     </Tuesday>

     ........

Paul

Avatar

Level 1

Paul sorry, I dont think I did a very good job explaining. Below is the xml for the time portion of the form. What I want to do is allow me to have the table on my time sheet show something like

DATE | Hours | Pay Type | etc as the header for my tables (on the pdf form)

and each row I could put a different set of information maybe 5 times  (one for each work day).

My issue is that with this setup it only adds one group of fields for the date, hours, etc and if i try to bind more than one field in my form to the same data it doesnt seem to send anything at all.

        <RecordNumber>398</RecordNumber>

        <UserID>10289</UserID>

        <WorkDate>2006-03-27T00:00:00</WorkDate>

        <AccountNumber></AccountNumber>

        <BeginTime>2006-03-27T08:00:00</BeginTime>

        <EndTime>2006-03-27T09:00:00</EndTime>

        <Units>1.0</Units>

        <PayType>110</PayType>

        <BusinessUnit>20112</BusinessUnit>

        <PostedDate>2006-03-27T07:29:00</PostedDate>

        <CostCode>200</CostCode>

        <ExportStatus>1</ExportStatus>

        <ErrorStatus>N</ErrorStatus>

        <ErrorDesc></ErrorDesc>

        <BlackBerryRecID>1456</BlackBerryRecID>

        <UploadFromBlackBerry>2006-03-29T13:56:44</UploadFromBlackBerry>

        <CostCodeDesc>WO On Site</CostCodeDesc>

        <PayTypeDesc>Non Charge Regular</PayTypeDesc>

        <AcctName></AcctName>

        <SubmittedBy></SubmittedBy>

        <ApprovedBy></ApprovedBy>

        <ApprovedDate>2006-04-04T09:37:57</ApprovedDate>

        <Notes></Notes>

        <JDEStatus>1</JDEStatus>

        <JDEDate>2006-04-04T09:39:00</JDEDate>

        <SalaryWork></SalaryWork>

        <PaperWork></PaperWork>

    </TimeEntry>

Avatar

Former Community Member

Is the TimeEntry subform bound to a node? If so you need to add a [*] after it ...indicating that there is more than one fo those. I am assuming that Time Entry is the name of the repeating row.

Paul

Avatar

Level 1

Where would I put the *?  If you wouldnt mind you can download the form im working with and take a look. What seems strange is the web service fields are now only showing up when i open it with live cycle designer. https://ctrxweb.senecaco.com/WebServiceTest.pdf

Avatar

Former Community Member

That was not the issue. You have only put a field in the first cell so that is all that is being bound. Fill out the rest of the table with the objects that you want to appear there. Right now they are empty cells. So drag and drop a field into the cell and it will resize itself to fit the cell and also it will setup its own binding so that now when you export the data all of the fields in the table will appear.

Make sense?

Paul

Avatar

Level 1

Hmm, not sure i am doing this right. I saved a new version https://ctrxweb.senecaco.com/WebServiceTest2.pdf What is happening is when i bind the the Fields to the data connection if it is a duplicate it automaticaly removes the binding from the other one. So basically on the time table on that form

i go and bind one whole row of the table  Date Worked   | Begin Time | End Time | Pay Type | Cost Code

    then as soon as i go tot he next row of the table and begin binding to the same source the Import / Export Binding goes away.

Here are some screen shots.

https://ctrxweb.senecaco.com/firstrow.jpg https://ctrxweb.senecaco.com/secondrow.jpg


Avatar

Former Community Member

That is what is supposed to happen ....the Import/Export bindings are not the same as the Data Bindings. The Data Bindings are used to bing the field to the Data Dom which is used when a submit operation occurs. That data dom is written to the submitting process. The Import/Export bindings are used when invoking a web service. The web services are generally used to augment the form (supply additional information - like populating a ddlist from an external source). Are you trying to fully populate the form with the return of the web service? Are there multiple records being returned at the same time?

Paul

Avatar

Level 1

Now , I seem to be having a different issue all togther. I started a new form created the web service connection. Then from the data view I drug the top subform called TimeEntry and it added all of the fields to the screen but now when i look at the pdf preview those fields arent visible I even went and made  sure that the form is all the way in front.  https://ctrxweb.senecaco.com/capture.jpg

What I was thinking I could try to get the form correct is just copying and pasting the rows of fields I just made 2 for testing with, Work Date , Begin Time, End Time ,etc.

I am sure this will be something obvious!

Frustrating !

Avatar

Former Community Member

If you unwrap your TimeEntry subform then your fields will show.

In the hierarchy view select the TimeEntry subform, right mouse click and choose the unwrap option. Preview your form and your fields should be there.

Paul

Avatar

Level 1

Wow. ok I think I am getting closer XML is starting to look closer to the way i need it. Is there an better way to see what the xml data you will be submitting looks like? currently i just add an email button and then just save the attachmed xml file.

Avatar

Former Community Member

You can use that app.alert(xfa.datasets.data.saveXML(“pretty”)) command …it will show you what it will look like in a message box

Paul