hello, i want that in my database, once the product category is entered, the ID changes and is something like “FO001” or “CO008”, etc. is this possible?
Here are some images of the database and how the products are entered in the app. If you need more data I can provide them.
Instead of using UNIQUEID() as the initial value in your key column, you can write a function to calculate the values you are trying to get. However you will need to make sure it always gets a unique value. This get more complicated the the more items you get. I would recommend keeping the UNIQUEID() value for your key and using another column to get the value you are looking for. That way it is more forgiving. Looking at your data you would need something like:
This isn’t exactly what you have in the picture, and there are potential issues with this approach, such as category names with the same initials. You might want to create a column in the table with your categories that has the ID prefix you are wanting to use.