Mats Posted April 4, 2006 Posted April 4, 2006 I have not been doing FM for a while and some things won't come back : 1. I have a button and I want todays date inserted in field A and time inserted in field B I know it's done from the script, but how? 2. It is a customer database and I want to have a drop down menu or similar with the options, New, Ongoing and Finished. When I choose one option I want the background color to change color, or if that is not possible a color box or something. 3. As I import the customers from Excel and work them of, some of the Customers is already done and I have a field saying "Yes". If the field "Yes" contains Yes, I want the status automatically being "Finished" as above. 4. Last and just for looks. Can I get the drop down menus and check boxes etc. to use the Mac OS X default look? Thanks in advance! Mats
MetaSys Software Posted April 5, 2006 Posted April 5, 2006 1. Create new script, say 'SetFieldValues' Set Field[TableName::FieldA;get(CurrentDate)] Set Field[TableName::FieldB;get(CurrentTime)] Assign this script to the button. 2. Create field 'Status', type 'text'. In 'Options' >> 'Auto Enter' >> check 'Calculated Value'. set calculation as Case ( Status = "New";TextColor ( Status ; RGB ( 255 ; 0; 0) ) ; Status = "Ongoing";TextColor ( Status ; RGB ( 0 ; 255; 0) ); Status = "Finished";TextColor ( Status ; RGB ( 0 ; 0; 255) ); ) Uncheck 'Do not replace...'
Mats Posted April 5, 2006 Author Posted April 5, 2006 Thank you for the reply. But it's not working?? 1. I think I managed to follow your instructions correctly but the colors don't change. I have uploaded the script steps in pictures on URL HERE I am sorry the Names is in Swedish 2. The Date script don't work either and also this script is on the same URL. There the problem is that only the Date is inserted but not the time.
Søren Dyhr Posted April 5, 2006 Posted April 5, 2006 1) In the second idalog have you forgotten to remove the checking in the box called: "Do not replace existing value of field (if any)" Well, you weren't instructed correctly actually!!! 2) You can't set the same field twice without overruling the first entry the script does. Perhaps you should reformat the field to text and the use one lines script Set Field[Nicator_tel1;Get ( CurrentTimeStamp )] --sd
Mats Posted April 5, 2006 Author Posted April 5, 2006 1) Well now the color is changing but also the text changes to become just a number (60). So "Pågående" changes to "60" Also I wonder if I can't get the background or anything else to change color as that would be much easier to see when scrolling through the records? 2) Sorry but I don't really follow you there? As I understand the new script will not be linked with the button?
Mats Posted April 5, 2006 Author Posted April 5, 2006 And now I know why it changes to "60" I think. Because I have another field Named only "Status" and this field always have the value 60. I don't know why it picks up this value though?
Mats Posted April 6, 2006 Author Posted April 6, 2006 Now it's working! Thanks Søren Now I am on to the field "ÖK_pågår" which may only be blank or have the value "JA" when I import the database from Excel. I want the field "Status" to automatically be set to "Åtgärdad" (Finished) if the value is "JA", otherwise nothing.
Søren Dyhr Posted April 6, 2006 Posted April 6, 2006 (edited) Yet another autoenter is required again with the checkbox removed. Case(Exact("JA";Status);"Åtgärdad") --sd Edited April 6, 2006 by Guest Forgot a "
Mats Posted April 6, 2006 Author Posted April 6, 2006 Sorry, but where should it be inserted in Case ( Arbets_stat = "Ny";TextColor ( Arbets_stat ; RGB ( 255 ; 0; 0) ) ; Arbets_stat = "Pågående";TextColor ( Arbets_stat ; RGB ( 0 ; 255; 0) ); Arbets_stat = "Åtgärdad";TextColor ( Arbets_stat ; RGB ( 0 ; 0; 255) ); ) I tried some ways, but no go :D
Mats Posted April 6, 2006 Author Posted April 6, 2006 I think I did not explain good enough. The field which we made color changes to is called "Arbets_stat" The field which will have non or "JA" value is named "ÖK_pågår" Så if "ÖK_pågår" have "JA" text the field "Arbets_stat" should change to "Åtgärdad" (Finished) Sorry that the text is Swedish.
Recommended Posts
This topic is 6808 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