July 13, 200223 yr 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!!!
July 13, 200223 yr 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
July 15, 200223 yr 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
Create an account or sign in to comment