Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

A little problem about Unique key ?

Featured Replies

Hi All

File A , 2 fields , Field A1 = 12 Field A2 = nil so unique key= 12nil

so first time I go from File A to File B ..I create a record in File and set unique key of File B = 12nil

Second time I change Field A1= 12 Field A2 = 123 so uniquekey = 12123

So How can I go From File A to File B which don't create new record in File B but go to the same record of File B (12nil) and change unique key of File B = 12123.

Somebody can help me with this since I tried many ways but no idea how to implement that ...since I know that one unique key to one unique can not change like that?

I really need your help

Thanks All

Start with the following premise: Keys NEVER change, keys are NOT accessible or ever seen by the user and user/system modifiable values are NOT keys.

So create a unique key to link the records and establish a relationship via this field. Then you can use this relationship to modify those other identifiers as they change.

I suggest looking into the following thread for my implementation of a unique key system, which is the primary linking system for the relationships, and can be used when other user-defined linking systems (such as CustomerID, or InvoiceNumber, etc) need to be modified.

CaptKurt's Unique Key System

  • Author

Thanks Capkurt,

you make my day...

That is what i am thinking but could not figure out how to make primary key.

Once again

Thanks

  • Author

But if I duplicate it gives me the same primary ...how can we avoid it?

I want that when it is duplicate it gives different primary ...

Any idea?

Thanks

I control all record creation and duplication through scripting and I do not allow user access to the menu for record creation. So they cannot choose Duplicate Record or press Command-D. They must press a "Duplicate" button on the layout. This then allows me to assign a new PrimaryID to the duplicated record, as well as whatever other functions need to happen upon duplication.

  • Author

When I duplicate I got a new primary key ...do you know how to get a duplicate of related file with the new primary key when I duplicate the original file.

Thanks

To duplicate a set of related records, you'll need to do some scripting.

Basically I do the following:

Store Original PrimaryID (i.e. CustomerID_pkey)

Duplicate Record, Assign New PrimaryID, Store New PrimaryID

Goto Related Records by Original PrimaryID

Loop Through Related Records, Duplicate Record, Set the ForeignKey (i.e. CustomerID_fkey) to the New PrimaryID. Also make sure to Assign a new PrimaryID (i.e. InvoiceID_pkey) to the duplicated record.

Eventually you will have duplicated all related records and set thier ForeignKey to the new PrimaryID.

  • Author

Thanks Capkurt ...

I got your idea ...

Once more ...thanks ...because that problem gives me headache

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.