mvang04 Posted June 16, 2004 Posted June 16, 2004 Using a Script Dialog Box, I made the dialog box to accept two inputs: a Beginning Date and an Ending Date. I tried to use the Get(ScriptParameter) function to obtain the two inputs from the dialog box. Then I used a Perform Find to search the criteria of the two inputs from the Dialog Box. However, it is not working. I don't know what else to do and I currently can't not find any additional information on how to implement this. Can anyone help?
RalphL Posted June 16, 2004 Posted June 16, 2004 Each of the inputs to the dialog box are fields, use the data from these fields. I hope that these are global fields. This has nothing to do with the script parameter. The script parameter is passed between script or it is sey by a button.
mvang04 Posted June 16, 2004 Author Posted June 16, 2004 OKay, well...if I use the Date field as a global field, all my dates are the same all across. I need them to be different how would I do that?
mvang04 Posted June 16, 2004 Author Posted June 16, 2004 Okay, what I have now is: A dialog box that will ask for two inputs 1)a Beginning Date 2) an Ending Date. When I click a button called "Reports" I set it so it calls the script. The scrpit inlcudes the dialog box, and what I want it to do is to take the two inputs and only show data from the given user inputs (the beginning date and ending date) and it should show on a report form in preview mode. What I happens is that data shows on the report form in preview mode. The inputs are not even being reconized and evaluated to only show data between those two user given dates. Any suggestions is most appreciated.
-Queue- Posted June 16, 2004 Posted June 16, 2004 You have to first perform a find using the dates entered, or whatever records are in the currently found set will be used. Once a user enters the dates, Enter Find Mode [ ] Insert Calculated Result [datefield, GetAsText(beginningdate) & "..." & GetAsText(endingdate)] Perform Find [ ] You may need to put datefield on the current layout. This is necessary for Insert Calculated Result in versions prior to 7; I'm not sure whether it's required for 7.
mvang04 Posted June 16, 2004 Author Posted June 16, 2004 Thank you RalphL and Queue for your help. I am still having probems however, and I do have a date field in all my layouts. I don't know what else to do?
RalphL Posted June 16, 2004 Posted June 16, 2004 You should have 2 global date fields, Beginningdate and Endingddate. Your script should show the custom dialog. The user enters the 2 dates. and clicks on OK. At this point use Queue's 3 steps. Then enter the Preview mode. Your script will need some refining but get this working first.
mvang04 Posted June 17, 2004 Author Posted June 17, 2004 Okay, I made two global fields in the same table as the date field, a Bdate for Beginning Date and Edate for Ending Date. I use both those fields when I specify which field to use for the two inputs on the Dialog Box. For my Insert CalculationResult I used Datefield; GetAsText(Bdate) & "..." & GetAsText(Edate). I thought it should work as well. I declared Bdate and Edate both as dates and conatiners to be added on creation. It still doesn't work. I don't know what I am doing wrong. I have gone over many steps - I substituted GetAsText to GetAsDates also but it still doesn't work? Why?!
Vaughan Posted June 17, 2004 Posted June 17, 2004 In FMP 6 the Custom Dialog step only inserts the data into the associated fields if button 1 is OK. Weird, but it has caught me out before. It may be the same in FMP 7 I have not checked.
mvang04 Posted June 17, 2004 Author Posted June 17, 2004 Thank you so much everyone for your responses and help. At least now i think i'm on the right track.
mvang04 Posted June 17, 2004 Author Posted June 17, 2004 This is how I have my script set up: Show Custom Dialog["Information Needed"; "Please Enter a Beginning and Ending Date"; Data Entry::BDate; Data Entry Edate] If[Get(LastMessageChoice) = 1] Enter Find Mode[] Insert Calculated Result[Data Entry::Date; GetAsDate(Data Entry::Bdate)&"..."&GetAsDate(Data Entry::Edate)] Perform Find[] End If If[Get(LastMessageChoice) = 0] Exit Script Go To Layout[Form2(Student Identification)] End If Go To Layout[Form2Copy(StudentIdentification)] Enter Preview Mode[Pause] Sort Records[Restore; No Dialog] Enter Browse Mode[] Go To Layout[original layout] From this, can anyone see what I am doing wrong?
-Queue- Posted June 17, 2004 Posted June 17, 2004 You need GetAsText, not GetAsDate. The fields are already dates and you want to convert them to text so that FileMaker doesn't treat them as numbers. Aside from that, I don't know if the Custom Dialog is correct, since I've never used it.
RalphL Posted June 18, 2004 Posted June 18, 2004 The script step "Show Custom Dialog["Information Needed"; "Please Enter a Beginning and Ending Date"; Data Entry::BDate; Data Entry Edate" doesn't show any buttons. The script step "If[Get(LastMessageChoice) = 0]" is incorrect. The choices are 1, 2 & 3 depending on the number of buttons. There is no zero button. Check the FilerMaker Help for mor details.
MoonShadow Posted June 18, 2004 Posted June 18, 2004 declared Bdate and Edate both as dates and conatiners to be added on creation Huh? Containers? Entered on creation? Makes no sense to me. They should be global text. And if you would say more than "it doesn't work" it would sure help. Pretend you are beta testing and need to provide the developer with the SPECIFIC error. What doesn't work? Anyway, I suggest you back up, re-read this thread and just take what everyone is suggesting and check it again. Be systematic in your approach and your process and find out what *isn't working.*
RalphL Posted June 18, 2004 Posted June 18, 2004 I would use global dates for Bdate and Edate. Convert to text in the script. This way you have some built in error check by FMP.
MoonShadow Posted June 18, 2004 Posted June 18, 2004 Hi Ralph, yes, I admit I wasn't following this thread but I noticed it appeared to be 'hung up' so I glanced through it looking for inconsistencies. When I noticed 'container' I thought I would mention it ... Using Custom Dialog in this way works very well, so if it isn't working, there is obviously something wrong. mvang04 needs to find the problem - we can't do that for him unless he posts his file or tells us exactly what doesn't work. Hang in there mvan04 ... everyone will help you figure it out ... I also noticed ... you should sort before you Preview.
mvang04 Posted June 24, 2004 Author Posted June 24, 2004 I am just an intern at the organization where I am trying to implement the FileMaker Pro software. I am currently the only one who knows as much as I do about the software( and it's not too much) but being that I had to learn it from scratch and on my own making forms and such, I think I'm doing pretty good so far...until they requested a dialog box =) I am still having probs and I don't know how I can execute or send my report/form to the web for others to see but Thanks so much everyone for helping me out! =)
mvang04 Posted June 24, 2004 Author Posted June 24, 2004 I have changed everything that everyone had suggested on this forum...=) What works: My dialog box appears after I click a button - which is suppose to run the script, I can enter the Beginning and Ending Date into the input field in the dialog box. When I click my CANCEL button, my instructions works - it exits the scripts and returns to orginal form. *My OK button - when clicked - I imediately go into preview mode, and it shows the exact info from the browse mode as if I just switched modes w/out the dialog - because my "result form" is an exact relpica of the form I am working from. Anyways, it goes into preview mode, pauses and continues into browse mode when I click CONTINUE. Two problems I can think of is : my INSERTCALCULATEDRESULT is not working or I should make a whole new layout so it doesn't look exactly like the form I am working from. Another thing I did was I made a self-joining relation with my Bdate (Beginning Date) to my Date field. Therefore, making an occurance of my Data Entry table. I created multiple criteria relationship- in the Edit relationship dialog box, I put " Bdate <= Date AND Edate >= Date " - Should I have done this? And if I should, should I be using the occurance table instead of the orginal Data Entry table? Thanks- mvang04
mvang04 Posted June 25, 2004 Author Posted June 25, 2004 Okay, I have an error of when I click OK in the dialog box and the INSERT CALCULATED RESULT does work - but it insert the Bdate and the Edate together in the date field which gives me an error because the field is specified as a date field it has to be in a certain format. How do I get the results of my calculation to only show A Date per field versus something like the calcualtion I used, which it shows "5/15/2004...5/30/2004" Thanks- mvang04
Recommended Posts
This topic is 7459 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