Jump to content

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

Recommended Posts

Posted

This is my first posting and I hope someone can help.

I have a database with individual bird species, linked to this table is a list of photographs – obviously there are potentially many pictures of each single species.

The aim is to select the photographs for use in different publications – some books will have multiple photos of a single bird, while other books need to be limited to a single image.

I have linked tables for each book – there are two tables per book – one holding the text, the second the picture selection.

The problem I have is I sometimes want to limit the selection to ONE image for a book. When a user clicks a selection I need to:

(1) flag an image if this is the first time a picture is selected for a species

(2) adopt the new image and delete the current flagged image if one is already flagged for use

or

(3) cancel and keep the existing image that is flagged.

Related_Record_flags.fp7.zip

Posted

I'm really not sure that this is suited exactly to solve your problem...

Try it extensively, expecially printing ( because the unique selection may not work correctly for all purpose )

Posted

Hi,

There seems to be a problem.

I have a sigle image flagged on record 1, move to record 2 and select an image - so far so good.

However upon returning to record 1 the selection has now been cancelled.

It appears this script sets the current record then removes the flags from all other records within the database....(I extend to include a 3rd record and this also happens)

I'm puzzeled

David

Posted

It appears this script sets the current record then removes the flags from all other records within the database

... from all other records within the found set.

Can you post an example with more than one record so to let me adjust that script ?

Posted

Hi Daniel,

the original database has two records within it -

Barn Owl and Short-eared owl.

If you swap between these records you'll find the script un-flags the other....

David

Posted

If you limit to one found record and apply script it works without affecting the other record(s).

So it's almost working.

Posted

I haven't looked at the files posted, but just from your description, I would have a flag field in the Book record that tells me how many pictures are allowed, flag_ImagesMax.

Three tables: BooksPics. Portal to BooksPics on Books. An Add Image button above the portal. Clicking Add Image would look at the flag field. If flag_ImageMax = countOfRelated records, then I'd pop a dialog, "This book has its quota of images. Please delete one if you wish to add another."

If you still can add an image, then just go ahead and make another BooksPic record.

Posted (edited)

Thanks for both your help - now fixed:

this script seems to work

Set Variable [$pr;Value:Get(portalRowNumber)]

Go to Portal Row [select; First]

Loop

set Field [single_Image_flags::Flag_image;0]

Go to Portal Row [select; Next; Exit after last]

End Loop

Go to Portal Row [select; No dialog; $pr]

Set Field [single_Image_flags::Flag_image; Abs (Sign (Single_Image_flags::Flag_image-1))]

Seems to run through without hitting other records

thanks again!

David

Edited by Guest

This topic is 5748 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.