Forum Discussion
update dataverse table with dataverse primary key results in datatype error
- Jun 12, 2024
hi all - just a quick update if anyone stumbles across this issue:
Dataverse as a managed solution blocks overriding a foreign/ alternative key, you can only update the dataverse primary key. In an unmanaged solution it’s the reverse I think, you can only update the alternative key, not the dataverse primary key.
the dataverse primary key is a GUID which cannot be stored in a text box as per issues above (that will show up as ???? In VBA). Solution : it can be stored in a combo box as a workaround, which as it turns out is compatible with GUID.
I tried this instead (as the Policies table still has an old Access integer based key):
strTmp = "INSERT INTO Endorsements ( policies ) SELECT Policies FROM Policies WHERE policy_ID = " & Me.Policy_ID & ";"
DBEngine(0)(0).Execute strTmp, dbFailOnError
This throws up a 4030 error , "required field does not contain a value".
It most definitely does as I can see it on screen and in the dataverse backend.
Unless someone has an alternative suggestion I suspect Dataverse is blocking SQL overriding a foreign key field in its tables.
- TheJaksJun 12, 2024Copper Contributor
hi all - just a quick update if anyone stumbles across this issue:
Dataverse as a managed solution blocks overriding a foreign/ alternative key, you can only update the dataverse primary key. In an unmanaged solution it’s the reverse I think, you can only update the alternative key, not the dataverse primary key.
the dataverse primary key is a GUID which cannot be stored in a text box as per issues above (that will show up as ???? In VBA). Solution : it can be stored in a combo box as a workaround, which as it turns out is compatible with GUID.