I have two tables, Timesheets and Days. Each timesheet record contains fields for a total of 14 days. I have created a URL Formula button that will take certain fields, (Job #, Timesheet #, Period End Date, Date, Pay Amount and User Name) and create the individual day records in the Days table from this data.
My desire is to have the formula first check to see if any information is entered for a given day by checking the Pay field to make certain it's not blank. If it's not, the day record will be created and the formula will move on to check and create the subsequent days.
I have included 2 lines of the formula that I came up with below. It works perfectly until it hits the first false statement, at which point I get an improperly terminated API call and no more day records are created. Again, the formula only works if there is Pay information for BOTH of the days. I'd like to check and create all days with pay information and return to the timesheet record when complete.
I could use some help, thanks!
If([PAY 1]<>0,URLRoot()&"db/"&"abcdefg"&"?act=API_AddRecord"&"&_fid_14="&[JOB 1]&"&_fid_11="&[Timesheet#]&"&_fid_9="&[PE]&"&_fid_19="&[DATE 1]&"&_fid_13="&[PAY 1]&"&_fid_10="&UserToName([NAME],"FF")&
If([PAY 2]<>0,"&rdr="&URLEncode(URLRoot()&"db/"&"abcdefg"&"?act=API_AddRecord"&"&_fid_14="&[JOB 2]&"&_fid_11="&[Timesheet#]&"&_fid_9="&[PE]&"&_fid_19="&[DATE 2]&"&_fid_13="&[PAY 2]&"&_fid_10="&UserToName([NAME],"FF")&
"&rdr="&URLRoot()&"db/"&Dbid()&"abcdefg"&[Timesheet#])))