Jump to content

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

Recommended Posts

Posted

I'm trying to create a new contacts database where there would be 1 record per account in the "accounts" table, then additional records in other tables such as Addresses, Phones, and Contacts.

I want to setup an auto-enter calculation that, starting with 001, will number the addresses as they are created from a portal on accounts.

I've tried it several ways but can't seem to find a way where it will get both the first entry AND subsequent entries.

Do I need to script the creation of addresses or should there be a way to do it with the auto-enter calculation?

Posted

If you just need to use the portal row number for display purposes, using @@ as text in the portal row will number the rows (no leading 0's though).

If you need an Auto-Entered number in an actual field, you can do something like:

In Accounts, create a field nextAddressID (calculation, text result)= Right("000" & NumToText(Max(Address::rowNumber)+1),3) //Uncheck Do not evaluate if field is empty

In Address, create a field rowNumber (text, lookup: Account::nextAddressID)

Put the rowNumber field in the Address portal.

I think the account record has to be commited before the numbering will work, and for sure, numbering will get screwed up if portal rows are deleted.

Posted

ya that's a little different than how I was doing it - I think that would work.

I actually ended up giving it some thought and decided that scripting it was probably a much better way to go any way. I'm starting to move away from using "Allow creation of related records" and instead using scripts so I have more control over related record creation. It's working well.

Thanks.

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