• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

Need a script to change a Drop Down Value

I have 2 Databases, one is SQL, and the other is FMP. They are linked together, and I'm in the final stages of tweaking it for the end users.

They wanted to know if there was a way to change a Drop Down indicator in Photo Status to show Loaded/Up On Web, (This is one of the choices they have) when ever there is data sitting in the SQL database field.

So for instance if my SQL database has Picturescategory|123456.jpg, the photo status field on the FMP DB would automatically show Loaded up on web.

I assume script can do this, but not sure.

Any help is appreciated and more Q's to come I'm sure.

Thanks

Chip
0
OSXFreak
Asked:
OSXFreak
  • 7
  • 4
  • 2
  • +1
1 Solution
 
North2AlaskaCommented:
Will the field be empty if its not on the SQL Database?  How is the drop down being populated now?
0
 
OSXFreakAuthor Commented:
Currently the field is empty.. BUT I set it up as a control style of Drop Down List. In that list is 5 values they can choose.

ONE of them being Loaded / Up on Web
0
 
North2AlaskaCommented:
Are these values hard coded or from the value of a field?
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
OSXFreakAuthor Commented:
They are hard coded from the Value Lists under value list name of Photo Status would is custom values

Does that help?

In other words, if you go to the Inspector and select Data then under the control style it shows values from Photo Status, if you click on the pencil it shows Manage Value Lists or Content Project. This is one of 4 lists :)

Hope that helps if not let me know and I'll see if I can do this another way :)

Chip
0
 
North2AlaskaCommented:
OK, I think I have it now.  If the list is typed in by you, "Loaded/Up On Web" is one of the values and you have assigned this list to the field, then when you display the field is will already be selected.

Now, how do you populate that value in the field?  If the field is part of the SQL database, then do it there.  

If it is not part of the SQL database, then create a calculated field that checks to see if the Picturescategory has a value and based on the result set the value.  The challenge here would be, because it is a calculation the user would not be able to change it.
0
 
OSXFreakAuthor Commented:
Hmmmm my fear is that if it's a Calculated field they will not be able to select the other options for other items in that same field..

Thinking we might just have to work around it..

So next Q. If in the list view, and I do a filter on PhotoItems for any data in it.. Is there a way to select ALL the related records in Photo Status and do a paste of "Loaded/Up On Web" in it???
0
 
North2AlaskaCommented:
Would you kindly provide more detail on the flow of data?  I think what you are trying to do is move images from the local to the server?  And then indicate which ones are already loaded?  Is this correct?
0
 
OSXFreakAuthor Commented:
Kind of..

OK so I have 2 Fields..
Field 1 has text from SQL The text is either PicturesCategory\NoPic.jpg or PicturesCategory\123456.jpg (the numbers represent the part number)

Field 2 (Photo Status) is a list created in FMP. This is connected to the FMP database.

The photo status has control style of Drop Down List and Values from Photo Status. The Values in that Photo status are..

Need Image from cono
Photo Taken / Needs Proofing
Photo Taken / Proof Rejected
Done / Proofread, Load to Web
Loaded / Up on Web

So basically I want to to do this.. IF Field 1 = PicturesCategory\123456.jpg then Field 2 (Photo Status) = Loaded / Up on Web else Blank so the end user can select a option or value manually. :)

Yeah easy for me to say. I'll attach photo's of the info. I'd send the data, but not sure you could use it since it's tied to my SQL database locally :(

Thanks

Chip


cbinfo.JPG
cblistmenu.JPG
listvalue.JPG
0
 
lesouefCommented:
thinking of an auto-entered field from calc instead of a full calc field; this allows further change by the user. just my 2 cts.
0
 
mac_guruCommented:
On your Photo Status set it to a text field and under options, use Auto-Enter with Calculated Value, and do a if/then/else statement to fill out the field.

e.g. If ( Field1="PicturesCategory\NoPic.jpg" ; "" ; "Loaded/Up on Web" )

That means if Field1 = "PicturesCategory\NoPic.jpg" give it a blank value otherwise set the pulll down to "Loaded/Up on Web"
0
 
OSXFreakAuthor Commented:
Mac I put that in my system.. but does not seem to be working...The SQL database that has the info is called idnmaster1::itemphoto the fields either have PicturesCategory\NoPic.jpg or PicturesCategory\######.jpg
I think your on the right track, but not sure if I have it set right, I'm attaching the screen shots of the code I used.
I did not set the global thing does that need to be done as well for the Photo Status field?

Chip
0
 
OSXFreakAuthor Commented:
Mac I put that in my system.. but does not seem to be working...The SQL database that has the info is called idnmaster1::itemphoto the fields either have PicturesCategory\NoPic.jpg or PicturesCategory\######.jpg
I think your on the right track, but not sure if I have it set right, I'm attaching the screen shots of the code I used.
I did not set the global thing does that need to be done as well for the Photo Status field?

Chip
ifcode.JPG
0
 
mac_guruCommented:
Chip,

No, don't need to set it as a global, globals holds a single value throughout the database.

I don't see anything wrong with your field.

See the attached example if that works for you.
chip.fp7
0
 
OSXFreakAuthor Commented:
Never got it to work, so will think of other solution, but thanks anyhow.. I'm sure it's just ME :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 7
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now