My boss would like to suppress the "Do you want to rename" pop up on a custom table. This is a standalone table but it has 4 fields as part of the primary key. Whenever any of the fields are changed the message pops up.
I've tried putting the RENAME function in the OnValidate for the fields but I'm still prompted for the rename when I change one of the primary key fields.
Thanks.
0
Comments
If the table key is NOT frequently changed, it's better to have that confirm message in my opinion, because maybe it is an unwanted change (that is, the user usually does not change the primary key, but creates another record, and block the old, if you have a field to block records like customers and items...).
What is your business need to change that key? i mean: why the message have to be suppressed?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
We're looking at changing the primary key but at this point it was put in place so duplicate records weren't entered.
Suppressing the pop-up is only being looked at to increase the speed of data entry. They always want to rename the record so it's kind of a useless pop-up as far as the end user is concerned.
Maybe someone else have some ideas to solve your user's problems...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
You could make variables for the primary key fields, and use them as SourceExpr.
Then you would have to program everything (OnAfterValidate). Find the record, insert if not existing etc.
The trick here is to NOT do a rename, but to delete and insert.
In fact I think the issue is Delayed insert on that form. Is it enabled?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Delayed Insert is set to no.
that way the user can populate all PK and then the record get inserted and thus no rename is required until they actually change the PK.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Object Manager
It simply deletes and inserts a record.
If you do want to rename the record you could rename the xRec in the OnModiyTrigger:
Object Manager
Second: NEVER do this type of code on the form.
RIS Plus, LLC
MVP - Business Apps
Thanks reijermolenaar! Great solution for form 7002 when you need to change many records' starting dates and don't want to see that silly message every time.
When u set this, it will ask only once for the entire line.
I suggest to do like this rather going for adding code in onModify Trigger.
Delete and insert will anyhow end-up with performance issue. And if multiple users are working simultaneously then you face the table locking issue.
Regards,
Raveendran.BS