You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create relationships between tables using the relationship API. For a complete working example, see [examples/advanced/relationships.py](https://github.com/microsoft/PowerPlatform-DataverseClient-Python/blob/main/examples/advanced/relationships.py).
615
615
616
616
```python
617
-
from PowerPlatform.Dataverse.models import (
618
-
CascadeConfiguration,
619
-
Label,
620
-
LocalizedLabel,
617
+
from PowerPlatform.Dataverse.models.relationship import (
621
618
LookupAttributeMetadata,
622
-
ManyToManyRelationshipMetadata,
623
619
OneToManyRelationshipMetadata,
620
+
ManyToManyRelationshipMetadata,
624
621
)
622
+
from PowerPlatform.Dataverse.models.labels import Label, LocalizedLabel
625
623
626
624
# Create a one-to-many relationship: Department (1) -> Employee (N)
627
625
# This adds a "Department" lookup field to the Employee table
@@ -823,7 +821,7 @@ The client raises structured exceptions for different error scenarios:
823
821
824
822
```python
825
823
from PowerPlatform.Dataverse.client import DataverseClient
826
-
from PowerPlatform.Dataverse.core import HttpError, ValidationError
824
+
from PowerPlatform.Dataverse.core.errorsimport HttpError, ValidationError
827
825
828
826
try:
829
827
client.records.retrieve("account", "invalid-id")
@@ -864,7 +862,8 @@ Enable file-based HTTP logging to capture all requests and responses for debuggi
864
862
865
863
```python
866
864
from PowerPlatform.Dataverse.client import DataverseClient
867
-
from PowerPlatform.Dataverse.core import DataverseConfig, LogConfig
865
+
from PowerPlatform.Dataverse.core.config import DataverseConfig
866
+
from PowerPlatform.Dataverse.core.log_config import LogConfig
868
867
869
868
log_cfg = LogConfig(
870
869
log_folder="./my_logs", # Directory for log files (created if missing)
Creates or updates records identified by alternate keys. Single item -> PATCH; multiple items -> `UpsertMultiple` bulk action.
213
213
> **Prerequisite**: The table must have an alternate key configured in Dataverse for the columns used in `alternate_key`. Without it, Dataverse will reject the request with a 400 error.
214
214
```python
215
-
from PowerPlatform.Dataverse.models import UpsertItem
215
+
from PowerPlatform.Dataverse.models.upsertimport UpsertItem
0 commit comments