Error 3022 Cannot add a duplicate value because of a key constrain - ms-access-2010

I am trying to insert a value into a table and i am getting an error 3022(It says that there might be a problem with a relation, a key or index). I have not created the table myself but i found out the specific column that triggers the error. I have checked that its not a key, index and there is not a relation to that table that depends on that specific column.
Is there anything i can do to avoid that error?
Thanks in advance.

No offense intended, but I tend to believe the application. There must be an index or a relation that you believe is innocuous but is actually the cause of the error. Therefore, I recommend the following:
In Access, with all tables closed, click the "Database Tools" tab on the ribbon and then click the "Database Documenter" button in the "Analyze" section of the ribbon bar. In the dialog box that appears, place a checkmark beside the table in question and then click the "Options..." button. In the options dialog, make sure that the highest level of detail is selected:
Click "OK" to close the Print Table Definition dialog, then click "OK" again to run the Documenter report.
Study the report carefully. If you don't see the cause of your error then, in the "Data" section of the ribbon, click "PDF or XPS". Save the report as PDF, upload the PDF to a site like wikisend.com, and then post the link here so we can retrieve the report.
Oh, and update your question to tell us exactly how you are trying to insert the data, and in what field(s). If you are using an INSERT query, post the actual SQL code you are trying to use.

Related

Text truncated in Azure Monitor Workbook Table Columns

Im trying to write queries on Azure Workbook so that I can run queries on our logs, which would allow me to drill down and view exactly what the exception message is. While doing so, when I execute a KQL query, on the workbooks, the column values are truncated as shown in picture. I want to be able to see the full error stack in order to troubleshoot the issue. Now I can get the operation_Id from here and then run it in Log Analytics to view full details, but I would like to view everything I need on this single page within Azure WorkBook. Clicking on the column doesn't expand it.
You cannot expand a particular column when you execute a kql query on the workbooks.
If you change the visualization to Text you will be able to see the complete stack error message as show in the below image
There are many ways to do something like this in workbooks, but the grid we use doesn't have the ability to expand a single cell like the logs view does.
As another answer states, you could use the "text" visualization to visualize just one cell (0,0) as a text block, but that only works for once cell queries.
or, in the grid settings you can set the column renderer to be a link for those columns, and have that link open the "cell details" view. that will open up a side pane that shows all the content of the cell in a popup view
or you could pick the "generic details" option which will open a side popup showing the values of all the columns in that row)
or, you can go into advanced settings, and enable the option to export parameters when a row is selected. you can then set it to export specific columns as specific named parameters, and use those parameters downstream to see values in something like a markdown text item in the workbook, or in a subsequent query.
there are examples of things like that documented here: https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Documentation/Interactivity.md

DB Browser for Sqlite New Record GUI

Sometimes when I click the "new record" button in DB Browser for Sqlite, a new row is added with cells which I can click into and fill. Other times it creates a pop up window where I can enter my data, as in the picture below. There seems to be no pattern to which one of these happens. I want to enter data into the cells because it is much more convenient. Does anyone know how to force this entry mode please?
The dialog opens when there is a constraint that you have to fulfilled in order to insert the new values. DB Browser tries to open a new row inline adding new default values, and when it cannot accomplish the constraints, opens this dialog for you so you can insert the values taking into account the constraints. You can see the constraints in tooltips shown for each row.
You can see the rationale behind this dialog here: https://github.com/sqlitebrowser/sqlitebrowser/pull/1477

Get Requsition ID based on PO

In FSCM I am looking to modify the Search view on Add/Update PO page (Main Menu--> Purchasing--> Purchase Orders--> Add/Update POs) to display the Requisition ID associated with the PO in the search results page. The only table I have found that has both PO_ID and REQ_ID is PS_PO_LINE_DISTRIB however unless I use a SELECT DISTINCT clause I will get multiple PO_ID rows when there are more than 1 line on a PO.
Within Purchase Order Inquiry you can see the related Requisition ID's related to a PO by clicking on Document Status link inside the Purchase Order inquiry details page.
I started looking at the PeopleCode within the the Purchase Order Inquiry to see how they are linking the PO to a Requisition and it appears to use work tables with related PeopleCode function libraries, but I wasn't able to figure our how they get linked. I am hoping someone else may know the answer to this. Thank you.
I'm on an old version of PeopleSoft (SCM 8.80, Tools 8.51), so your mileage may vary. I'm assuming you're familiar with App Designer. If not, comment below and I'll add some details about what I'm clicking on.
Find the name of the Add/Update PO component.
Open the PURCHASE_ORDER component in App Designer. Now let's find the name of the search record. Note that there is a different record for the Add Search Record, so if you want to change that too, do all of this for that record as well.
Open the PO_SRCH record, and add the REQ_ID field to it. Make sure you mark the field as a key. You should consider saving your modified PO_SRCH under a new name in case you want to be able to revert to vanilla PeopleSoft. If you do, change the Search Record in the component to your new record name.
We can see that PO_SRCH is a view. So let's modify the view to pull in REQ_ID from PO_LINE_DISTRIB. As you mentioned above, there doesn't appear to be another table with both PO_ID and REQ_ID, so you'll have to do a SELECT DISTINCT.
We should do a LEFT OUTER JOIN instead of a standard join because if you do a standard join and you enter a purchase order with no lines and save it, then you'll never be able to retrieve that purchase order in this window. Since REQ_ID is a key field, we can't have a null, so we have to do the CASE.
One odd thing that I ran into here was building the view now gave me an error about selecting fewer columns in the SQL than I had in my record definition. I solved it by modifying the view for SQL Server. I've never had to do that before and I don't know why I had to do it for this specific record. But anyway, I entered the same SQL under the record's "Microsoft SQL Server" definition.
In the properties of PO_SRCH, we can see that it has a related language record. If you're only using one language, you can probably get away without changing this, but I'll do it for completeness. Open PO_SRCHLN. Now add REQ_ID to it (mark it as a key field like you did above), and save it as PO_SRCHLN2 (I'm saving it under a new name so I don't break anything else that may be using PO_SRCHLN).
Edit the SQL the same was as you did above. Note: I didn't have to also change the Microsoft SQL Server definition like I did above. I have no idea why.
Now build PO_SRCHLN2.
Go back to PO_SRCH and change its related language record to PO_SRCHLN2.
Now build PO_SRCH.
Hopefully you didn't get any errors and your search page has the requisition ID in it now. My system doesn't use requisitions so they're all blank in the example below, but the new field is there.

Access 2010 requests parameter value during report assembly

I know this is a common problem with various queries and I have been through this report several hundred times trying to fix it. When I attempt to preview the report titled, "RTK Report", I am prompted by Access for a value for "Inventory2013", the table containing the primary data for the report. This only happens, however, 1.) When I include a subreport titled, "Product Components Subreport" and 2.) Only after I've established the linking field, "ProductID", between the main report and the subreport. Link to sample database HERE.
The problem you are having appears to be cause by the fact you are linking a subform to your detail section with an ambiguous name of "ProductID". I got it to work by doing the following:
In the RecordSource for the main form, I changed the query SQL for column PropertyId to be "SELECT Inventory2013.PRODUCTID AS MainID,"
Since this will break the MASTER and CHILD links, I then modified the MASTER to be "MainID" and the CHILD to be "Product_ID"
After that change, the report runs and does not prompt you.

How to customize an Axapta report "SysReportAuto" ?

I know how to modify a 'physical' report with a defined name, and called from a button. But, in Axapta there are some reports called from the print button in the toolbar.
How can one modify a system report like 'sysreportauto'?
The fields shown in the auto report comes from the AutoReport field group on the table.
You can, as a user, change the auto report, by clicking Edit\New, then choose the fields you would like to see.
You can also specify group totals in Select\Sorting, and grand totals in Select\Print options.

Resources