dnowlan Posted July 13, 2002 Posted July 13, 2002 can anyone suggest a way to do the following. I need to be able to create "x' number of related records in a portal where x is the total months between 2 dates. Basically i have a date range from 1/1/2002 to 3/1/2002 which equal 3 months (anyone know how to calc that to reach "3") and then create "3" related records starting with January and ending with March. The end result would be that i select employee A in the portal from a value list, FM would then create 3 records with the same employee name which auto incremented months ending on March. does this make sense? Thanks!!!
Pupiweb Posted July 13, 2002 Posted July 13, 2002 I'd run a looping script like Loop Check (on some criteria you didn't mention) if a new month has to be created If Yes (else exit loop) Sets a global field in the related file with the month to be created Sets a global field in the related file with the ID of the person Runs an external script creating the record and setting month and person ID from the globals End Loop
ZuperZZ Posted July 15, 2002 Posted July 15, 2002 Hi, Here is how you can get that "3": Create a calculation field: total = Month(date2)- Month(date1)+1 *OJO: Your dates will always be whole months? otherwise this will not work properly. Once you have that: 1. Create a script that triggers a external script in the related file (store the number of months in a Global field ) 2. The script in the related file will create a record in a Loop command.: Count = 0 Loop New record request() Count = Count + 1 *** ANYTHING *** Exit loop if (Count = File1::Gbl_Total) End Loop Maybe is not the best way to do it, but I
Recommended Posts
This topic is 8168 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