Details
Steps to replicate the behavior:
Im WaWi Mandant:
Beleg mit einer Position anlegen.
Folge Beleg erstellen.
Im Body für die Route /Documents/{destinationDocumentKey}/Predecessors/{sourceDocumentKey}
eine andere Artikelnummer nehmen als vom Ursprungsbeleg.
$LoginToken = ""
$headers = @{ "accept" = "application/json"
"Authorization" = "LoginId $LoginToken"
"Content-Type" = "application/json"
}
$getCurrentUser = Invoke-RestMethod -Uri "https://localhost/slmobileApi/Users/Current" -Method GET -Headers $headers -SkipCertificateCheck
$Mandant1 = $getCurrentUser.TenantDatabaseName
$MandantYear = $getCurrentUser.YearDatabaseName
$Mandant1
$MandantYear
$data = @{
Positions = @(
@{
Identifier = "A718E830-D12F-45C1-8ED1-509A40FDCAC0"
ArticleNumber = "130003"
Quantity = 1.0
}
)
}
$json = $data | ConvertTo-Json -Depth 5
$data2 = @{
Positions = @(
@{
Identifier = "A718E830-D12F-45C1-8ED1-509A40FDCAC0"
ArticleNumber = "120003"
Quantity = 1.0
}
)
}
$json2 = $data2 | ConvertTo-Json -Depth 5
$response1 = Invoke-RestMethod -Uri "https://localhost/slmobileApi//Documents/SWE392/Predecessors/BBE350" -Method PUT -Headers $headers -Body $json -SkipCertificateCheck
$response1
$response2 = Invoke-RestMethod -Uri "https://localhost/slmobileApi//Documents/SWE392/Predecessors/BBE350" -Method PUT -Headers $headers -Body $json2 -SkipCertificateCheck
$response2
