![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Jason A script like this will set the values of 1 or more fields in the first related record to a series of new related records up to the numeric value set in #Request (global number field in which to manually input number of requests required): If [IsEmpty (#Requests) ] Beep Show Message [ "Please enter the number of requests in #Request" ] Else Set Field [ GlobalField1, Relationship::Field1 ] Set Field [ GlobalField2, Relationship::Field2 ] Loop Go to Portal Row [ Last, Select entire contents ] Set Field [ Relationship::Field1, GlobalField1 ] Set Field [ Relationship::Field2, GlobalField2 ] Exit Loop If [ Status(CurrentPortalRow) = #Request ] End Loop End If The relationship must be set to allow the creation of new related records. If you need to be able copy down values from 1 or more fields in the first related record to a number of other related records that have already been created, you will need a Counter (global number field): Set Field [ GlobalField3, Relationship::Field3 ] Set Field [ GlobalField4, Relationship::Field4 ] Set Field [ Counter, 2 ] Go to Portal Row [ Counter ] [ By Field ValueŠ, Select entire contents ] Loop Set Field [ Relationship::Field3, GlobalField3 ] Set Field [ Relationship::Field4, GlobalField4 ] Exit Loop If [ Counter = Count (Relationship::MatchField) ] Set Field [ Counter, Counter + 1 ] Go to Portal Row [ Counter ] [ By Field ValueŠ, Select entire contents ] End Loop Bridget Eley in article f_acnQnUEt6fbLaiXTWJhQ (AT) shawneelink (DOT) net, Linda & Jason at towersq (AT) shawneelink (DOT) net wrote on 3/8/03 3:10 AM: Question..... I am working with a situation that has the client concerned over the amount of time she spends in repeating the same information in portal rows. I have created a script with button to copy and paste the first line, and portal field to new rows that follow below. Across the portals, there are several categories that need repeating so she does not have to manually enter the same information over and over. However, in creating this script, the first field goes down as many times as there are request, but when she goes to the second field for repeating, the lines drop further down and this goes on for each button that is tied to the repeating script. In short, it is driving her and me a bit nuts. What can I do to create a script that will allow each for such copy and paste without all the additional waste of unnecessary rows? I have not tired doing a script tying all the repeating scripts together, but if there is a sure fire way of doing these portal repeating fields nice and clean, I would like to know how. Thanks in advance... Jason |
#3
| |||
| |||
|
|
PS Same principle applies to repeating fields: ... Set Field [ GlobalField1, Relationship::Field1 ] Set Field [ GlobalField1-2, GetRepetition (Relationship::Field1,2) ] Set Field [ GlobalField1-3, GetRepetition (Relationship::Field1,3) ] (and so on) ... Set Field [ Relationship::Field1, GlobalField1 ] Set Field [ Relationship::Field1-2, GetRepetition (GlobalField1,2) ] Set Field [ Relationship::Field1-3, GetRepetition (GlobalField1,3) ] (and so on) ... Bridget Eley in article BB526876.2400%bridgeteley (AT) ihug (DOT) com.au, Bridget Eley at bridgeteley (AT) ihug (DOT) com.au wrote on 3/8/03 7:21 AM: Hi Jason A script like this will set the values of 1 or more fields in the first related record to a series of new related records up to the numeric value set in #Request (global number field in which to manually input number of requests required): If [IsEmpty (#Requests) ] Beep Show Message [ "Please enter the number of requests in #Request" ] Else Set Field [ GlobalField1, Relationship::Field1 ] Set Field [ GlobalField2, Relationship::Field2 ] Loop Go to Portal Row [ Last, Select entire contents ] Set Field [ Relationship::Field1, GlobalField1 ] Set Field [ Relationship::Field2, GlobalField2 ] Exit Loop If [ Status(CurrentPortalRow) = #Request ] End Loop End If The relationship must be set to allow the creation of new related records. If you need to be able copy down values from 1 or more fields in the first related record to a number of other related records that have already been created, you will need a Counter (global number field): Set Field [ GlobalField3, Relationship::Field3 ] Set Field [ GlobalField4, Relationship::Field4 ] Set Field [ Counter, 2 ] Go to Portal Row [ Counter ] [ By Field ValueŠ, Select entire contents ] Loop Set Field [ Relationship::Field3, GlobalField3 ] Set Field [ Relationship::Field4, GlobalField4 ] Exit Loop If [ Counter = Count (Relationship::MatchField) ] Set Field [ Counter, Counter + 1 ] Go to Portal Row [ Counter ] [ By Field ValueŠ, Select entire contents ] End Loop Bridget Eley in article f_acnQnUEt6fbLaiXTWJhQ (AT) shawneelink (DOT) net, Linda & Jason at towersq (AT) shawneelink (DOT) net wrote on 3/8/03 3:10 AM: Question..... I am working with a situation that has the client concerned over the amount of time she spends in repeating the same information in portal rows. I have created a script with button to copy and paste the first line, and portal field to new rows that follow below. Across the portals, there are several categories that need repeating so she does not have to manually enter the same information over and over. However, in creating this script, the first field goes down as many times as there are request, but when she goes to the second field for repeating, the lines drop further down and this goes on for each button that is tied to the repeating script. In short, it is driving her and me a bit nuts. What can I do to create a script that will allow each for such copy and paste without all the additional waste of unnecessary rows? I have not tired doing a script tying all the repeating scripts together, but if there is a sure fire way of doing these portal repeating fields nice and clean, I would like to know how. Thanks in advance... Jason |
![]() |
| Thread Tools | |
| Display Modes | |
| |