Jump to content

Some questions


This topic is 6592 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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? :D

Thanks in advance!

Mats

Link to comment
Share on other sites

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...'

Link to comment
Share on other sites

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 :D

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Now it's working! Thanks Søren :D

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 6592 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.