Jump to content

Problem with "set next serial value"


Recommended Posts

  • Newbies

Hi everyone,

 

I am trying to make a database for my analogue/film photography with FMP19.

 

In my ERD I have a “MediumBatch” (parent) and a related “Exposures” (child) table.

 

A MediumBatch record can be a single 4x5 or 8x10 film sheet (hence 1 single exposure) but also a 6x6 film roll (roughly 10 exposures) or a 35mm film roll (24 or 36 exposures).

 

I have a Get( UUID ) primary key in both the parent and the child table.

 

I also have an auto-enter serial number for the MediumBatch table (I need it in order to match it to my paper database). I also need a serial number for the Exposures table.

 

When I create a new Exposures record in the MediumBatch table via the parent-child relationship the auto-enter serial number should reset starting from 1 if the related MediumBatch record has no Exposures. I use a portal in the MediumBatch table to check for the number of exposures.

 

I assign manually the number of exposures to each MediumBacth record in the field “MediumBatch_Exposures”. I have a “Count (Exposures)” field and I have assigned a script (If Count (Exposures) < MediumBacth_Exposures…) to the button that create a new exposure so that the number of exposures that I can create for each single MediumBatch record is automatically limited by the number of exposures that I have originally assigned to it.

 

I have tried to use the “set next serial value” script but clearly not in the right way.

 

I hope this is not too confusing.

 

Can someone be so kind to explain me (possibly step by step, I am very amateurish with FM) how to solve this? Am I on the right path?

 

Thanks for all the help in advance

Link to post
Share on other sites

That's how an auto-entered serial number works: it numbers all records in a table sequentially, with no regard to their parent (or any other attribute). If you want to number each series of siblings separately, you will need to use some other method. The exact method depends on why you need such numbering. 

See also:
https://fmforums.com/topic/107418-generating-two-part-idsku-numbers/?do=findComment&comment=484485&_rid=72594

https://fmforums.com/topic/107462-do-i-need-to-create-a-relational-data-base-to-auto-generate-a-field-based-on-my-primary-key/?do=findComment&comment=484598&_rid=72594

https://fmforums.com/topic/106041-how-to-generate-different-portal-line-numbers-for-different-parent-record/?do=findComment&comment=479246&_rid=72594

 

 

Edited by comment
Link to post
Share on other sites

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.