Oyseka Posted February 24, 2013 Posted February 24, 2013 Hi All, I am trying to create a series of records in a related table from a portal but my Loop is failing at the "Go To Next Portal Row" script step as it returns to the layout and selects the first portal row. Could you advise on where the script is failing please. Script: Go to Field [ Job_Card::Job_No ] [ Select/perform ] Enter Find Mode [ ] [ Pause ] #Allows the user to select the Job Card then finds the Active Items in the Installation_Items and sorts them Perform Find [ ] Copy [ Job_Card::Inst_No ] [ Select ] Go to Layout [ “Installation_Items” (Installation_Items) ] Enter Find Mode [ ] Paste [ Installation_Items::Inst_No ] [ Select ] Perform Find [ ] Constrain Found Set [ Specified Find Requests: Find Records; Criteria: Installation_Items::Active_Flag: “=1” ] [ Restore ] Sort Records [ Specified Sort Order: Installation_Items::Product_ID; ascending ] [ Restore; No dialog ] Go to Layout [ “Job_Card” (Job_Card) ] #Sets the Variables to take the data to the Service Line Items Set Variable [ $Job_No; Value:Job_Card::Job_No ] Set Variable [ $Inst_No; Value:Job_Card::Inst_No ] Set Variable [ $Svc_Date; Value:Job_Card::Svc_Date ] Set Variable [ $ID; Value:Installation_Items::ID ] Set Variable [ $Product_ID; Value:Installation_Items::Product_ID ] Set Variable [ $Product; Value:Installation_Items::Product ] Set Variable [ $Svc_Qty; Value:Installation_Items::Svc_Qty ] Go to Portal Row [ Select; First ] Go to Layout [ “Service_Items” (Service_Items) ] #Create the first record from the Job Card Items portal Loop New Record/Request Set Field [ Service_Items::Inst_No; $Inst_No ] Set Field [ Service_Items::Job_No; $Job_No ] Set Field [ Service_Items::Date; $Svc_Date ] Set Field [ Service_Items::ID; $ID ] Set Field [ Service_Items::Product_ID; $Product_ID ] Set Field [ Service_Items::Product; $Product ] Set Field [ Service_Items::Svc_Qty; $Svc_Qty ] Enter Find Mode [ ] Set Field [ Service_Items::Job_No; $Job_No ] Set Field [ Service_Items::Product_ID; $Product_ID ] Perform Find [ ] Loop #Creates additional records to match the Service Items Quantity Exit Loop If [ Get ( FoundCount ) = Service_Items::Svc_Qty ] New Record/Request Set Field [ Service_Items::Inst_No; $Inst_No ] Set Field [ Service_Items::Job_No; $Job_No ] Set Field [ Service_Items::Date; $Svc_Date ] Set Field [ Service_Items::ID; $ID ] Set Field [ Service_Items::Product_ID; $Product_ID ] Set Field [ Service_Items::Product; $Product ] Set Field [ Service_Items::Svc_Qty; $Svc_Qty ] Enter Find Mode [ ] Set Field [ Service_Items::Job_No; $Job_No ] Set Field [ Service_Items::Product_ID; $Product_ID ] Perform Find [ ] End Loop #Pauses the script to allow the Service Items to be entered Pause/Resume Script [ Indefinitely ] Go to Layout [ “Job_Card” (Job_Card) ] Go to Portal Row [ Select; Next; Exit after last ] End Loop
Recommended Posts
This topic is 4542 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now