My previous solution example was based upon pressing a button in the form's header and detecting which line(s) had been selected within the detail section.
My client decided to add the button to the detail section (so it would appear on each line) and came up with this method of identifying which line's button was clicked:
if (id != "push2") return true
{
Invoice = lawForm.getDataValue("APD-INVOICE",formState.currentRow)
Vendor = lawForm.getDataValue("APD-VENDOR",formState.currentRow)
DisplayImageWeb()
}
The only downside to this method is that the button appears on each line of the form whether or not there is data associated to that line and the user could press the button on a line with no data.
Design Studio Select Line Solution
Do you need to determine the line you're working on based upon the user selecting it in the Line FC? Here's a simple method I used with AP95.2 to pass variables to ImageNow to display an invoice. I had to repeat this for each line of the form.
This is using the field ID's.
if (lawForm.getElementValue("_f36r0") =="X") // Line 1
{
Vendor = lawForm.getElementValue("_f39r0")
Invoice = lawForm.getElementValue("_f41r0")
DisplayImageWeb()
}
if (lawForm.getElementValue("_f36r1") =="X") // Line 2
{
Vendor = lawForm.getElementValue("_f39r1")
Invoice = lawForm.getElementValue("_f41r1")
DisplayImageWeb()
}
This is using the field ID's.
if (lawForm.getElementValue("_f36r0") =="X") // Line 1
{
Vendor = lawForm.getElementValue("_f39r0")
Invoice = lawForm.getElementValue("_f41r0")
DisplayImageWeb()
}
if (lawForm.getElementValue("_f36r1") =="X") // Line 2
{
Vendor = lawForm.getElementValue("_f39r1")
Invoice = lawForm.getElementValue("_f41r1")
DisplayImageWeb()
}
Subscribe to:
Posts (Atom)