Entries from September 2008
I just finished helping a customer who wanted to add X number of days to a date entered in a text field
The following was the use case. A form has 2 TextFields Start_Date and End_date
User enters a certain date in the Start_Date text field for example 09/24/08 (MM/DD/YY)
The End_Date should add 90 days to the Start_date and populate the End_Date
The following script would do that
var current = Date2Num(Start_Date.rawValue, “MM/DD/YY”)
var future = current+90
var newDate = Num2Date(future,”MM/DD/YY”)
form1.#subform[0].End_Date.rawValue = newDate
Validating End Date is later than Start Date
var diff = Date2Num(EndingDate.rawValue, “YYYY-MM-DD”) – Date2Num(StartingDate.rawValue, “YYYY-MM-DD”)
if (diff > 0) then
xfa.host.messageBox(“The End date is later than start date”)
else
xfa.host.messageBox(“PLEASE CHECK….The End date is before the start date”)
endif
I have added the pdf here.Please click here to check it out
Date Manipulations
Categories: Uncategorized
Tagged: Adding Dates, Date, Date Difference, FormCalc
September 22, 2008 · 1 Comment
Very often there is a need to make sure the user has added an attachment to the task(Attachment added to the attachment tab).There is no out of the box way to find out if the task has attachments and prevent the user from submitting the form if there is no attachment
I have written a simple process which given a taskID would return the number of attachments associated with the task
You would then call this process from your form as a web service.The input parameter for the web service is going to be the value of the field AWS_TASKID which is part of the processfields.The return value of the webservice is stored in a hidden field.We then check to see if the value of the hidden field is “0″ which means there are no attachments associated with the task. All this logic is put in the click event of the AWS_SUBMIT button which is again part of the process fields.
I have put together a simple process which would explain to you the finer points. Click the following link to access the collateral for this process. The collateral are added as file attachments.Click the paper clip icon
Click here
let me know if you have any questions
thanks
girish
Categories: Uncategorized
Tagged: Checking attachments, submittingfrom workspace
A common use case is the ability to insert a image into a xdp and render the xdp into a PDF.To do this you will need to create a XSD with an image element. Then you will create a XDP using the XSD. Bind the fields of the xsd to the fields on the form.
Then you will have to merge the xml data into the xdp and render the xdp into a pdf.
I have attached a simple process which reads a xml file,extracts the image field out of the xml data, populates another xml variable with the image data and renders xdp with the data
I have included the XSD,XML file which has the image as base64 encoded string,XDP file.Click on the file attachments icon of the PDF
Click here to get the PDF
This process was built using 8.2 version. In 8.2 there are two new functions which allow you to encode a document object into a base64 string or get a document object out of a base 64 string. These are document functions
Categories: Uncategorized
Tagged: Image, xdp, XSD With Image