April 4, 200619 yr 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
April 5, 200619 yr 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...'
April 5, 200619 yr Author 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.
April 5, 200619 yr 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
April 5, 200619 yr Author 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?
April 5, 200619 yr Author 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?
April 6, 200619 yr Author 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.
April 6, 200619 yr Yet another autoenter is required again with the checkbox removed. Case(Exact("JA";Status);"Åtgärdad") --sd Edited April 6, 200619 yr by Guest Forgot a "
April 6, 200619 yr Author 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
April 6, 200619 yr Author 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.
Create an account or sign in to comment