tinhx7

Get Portal Row Number

Discussion created by tinhx7 on Jul 1, 2017
Latest reply on Jul 4, 2017 by Oliver_Reid

Hi,

 

I have a portal with about 10 rows in the invoice.

I'm try to capture the portal row value (technician's name) into my script, but it somehow always capture the first row, and skip the rest of the portal rows.

I'm not sure if "GetNthRecord" is the best method for this job.

 

The technician name data is display from Line Items, but its value is a global field.

 

 

 

 

 

Set Variable [ $oldTech; Value:GetNthRecord ( Line Items::Technician;1 ) ]

Set Variable [ $invoiceID; Value:Invoices::ID ]

 

 

#Remove invoice ID from the the current technician in Turn Rotation

Freeze Window
Go to Layout
[ “Turn Rotation” (Turn Rotation) ]

Enter Find Mode [ ]
Set Field [ Turn Rotation::Date; Get (CurrentDate) ]

Set Field [ Turn Rotation::Technician; $oldTech ]

Set Error Capture [ On ]

Perform Find [ ]

Go to Record/Request/Page

[ Last ]

If [ Turn Rotation::Invoice_1 = $invoiceID ]

Set Field [ Turn Rotation::Invoice_1; "" ]

Else If [ Turn Rotation::Invoice_2 = $invoiceID ]

Set Field [ Turn Rotation::Invoice_2; "" ]

Else If [ Turn Rotation::Invoice_3 = $invoiceID ]

Set Field [ Turn Rotation::Invoice_3; "" ]

Else If [ Turn Rotation::Invoice_4 = $invoiceID ]

Set Field [ Turn Rotation::Invoice_4; "" ]

Else
Set Field
[ Turn Rotation::Invoice_5; "" ]

End If

 

 

#update new technician on Turn Rotation

Freeze Window

Go to Layout [ “Services Invoice” (Invoices) ]

Commit Records/Requests

[ Skip data entry validation; No dialog ]
Perform Script [ “Update Technician v1.1 [Invoices]” ]

Refresh Portal [ Object Name: "technicians.portal" ]

End If
Exit Script
[ ]

 

Outcomes