Skip to Content
0
Dec 27, 2018 at 09:01 AM

Service Layer 'ProjectManagements' // ODBC -2035 [Message 131-183]

210 Views Last edit Dec 27, 2018 at 09:02 AM 3 rev

Hello,

Sorry about my bad english.

Im working with Service Layer on "ProjectsManagements" Table and try to update "PM_StagesCollestion". Following some tutorials on the web like that one.

I tried it on "BusinessPartners" Table and it worked.

But not on ProjectManagers.

POSTed data: (with insomnia, a post-man Like)

{
  "Owner": null,
  "ProjectName": "ProjectNameINSOMNIA",
  "StartDate": "2018-10-19",
  "FinishedPercent": 0.0,
  "DocNum": 16,
  "Series": 59,
  "ProjectType": "pt_External",
  "BusinessPartner": "123",
  "BusinessPartnerName": "GRONOKS",
  "ContactPerson": null,
  "Territory": -2,
  "SalesEmployee": -1,
  "AllowSubprojects": "tNO",
  "ProjectStatus": "pst_Started",
  "DueDate": "2019-11-19",
  "ClosingDate": null,
  "FinancialProject": "100-Y",
  "RiskLevel": "rlt_Low",
  "Industry": null,
  "Reason": null,
  "AttachmentEntry": null,
  "U_OB1ELEVATION": "N",
  "U_OB1VIC": "N",
  "U_OB1PLANM": "N",
  "U_OB1LIEU": null,
  "U_OB1ADRESSE": null,
  "PM_StagesCollection": [
    {
      "LineID": 1,
      "StageID": 1,
      "StageType": 16,
      "StartDate": "2018-12-19",
      "CloseDate": null,
      "Task": null,
      "Description": null,
      "ExpectedCosts": 0.0,
      "InvoicedAmountSales": 0.0,
      "OpenAmountSales": 9000.0,
      "InvoicedAmountPurchase": 0.0,
      "OpenAmountPurchase": 0.0,
      "PercentualCompletness": 0.0,
      "IsFinished": "tYES",
      "StageOwner": null,
      "DependsOnStage1": null,
      "DependsOnStage2": null,
      "DependsOnStage3": null,
      "DependsOnStage4": null,
      "StageDependency1Type": "sdt_Project",
      "StageDependency2Type": "sdt_Project",
      "StageDependency3Type": "sdt_Project",
      "StageDependency4Type": "sdt_Project",
      "DependsOnStageID1": null,
      "DependsOnStageID2": null,
      "DependsOnStageID3": null,
      "DependsOnStageID4": null,
      "AttachmentEntry": null,
      "UniqueID": null,
      "FinishedDate": null,
      "U_OB1_DEMANDE": null,
      "U_OB1DOSSIER": null
    },
    {
      "LineID": 2,
      "StageID": 2,
      "StageType": 16,
      "StartDate": "2018-12-26",
      "CloseDate": null,
      "Task": null,
      "Description": null,
      "ExpectedCosts": 0.0,
      "InvoicedAmountSales": 0.0,
      "OpenAmountSales": 0.0,
      "InvoicedAmountPurchase": 0.0,
      "OpenAmountPurchase": 0.0,
      "PercentualCompletness": 0.0,
      "IsFinished": "tNO",
      "StageOwner": null,
      "DependsOnStage1": null,
      "DependsOnStage2": null,
      "DependsOnStage3": null,
      "DependsOnStage4": null,
      "StageDependency1Type": "sdt_Project",
      "StageDependency2Type": "sdt_Project",
      "StageDependency3Type": "sdt_Project",
      "StageDependency4Type": "sdt_Project",
      "DependsOnStageID1": null,
      "DependsOnStageID2": null,
      "DependsOnStageID3": null,
      "DependsOnStageID4": null,
      "AttachmentEntry": null,
      "UniqueID": null,
      "FinishedDate": null,
      "U_OB1_DEMANDE": null,
      "U_OB1DOSSIER": null
    },
    {
      "LineID": 3,
      "StageID": 3,
      "StageType": 16,
      "StartDate": "2019-01-31",
      "CloseDate": null,
      "Task": null,
      "Description": null,
      "ExpectedCosts": 0.0,
      "InvoicedAmountSales": 0.0,
      "OpenAmountSales": 0.0,
      "InvoicedAmountPurchase": 0.0,
      "OpenAmountPurchase": 0.0,
      "PercentualCompletness": 0.0,
      "IsFinished": "tNO",
      "StageOwner": null,
      "DependsOnStage1": null,
      "DependsOnStage2": null,
      "DependsOnStage3": null,
      "DependsOnStage4": null,
      "StageDependency1Type": "sdt_Project",
      "StageDependency2Type": "sdt_Project",
      "StageDependency3Type": "sdt_Project",
      "StageDependency4Type": "sdt_Project",
      "DependsOnStageID1": null,
      "DependsOnStageID2": null,
      "DependsOnStageID3": null,
      "DependsOnStageID4": null,
      "AttachmentEntry": null,
      "UniqueID": null,
      "FinishedDate": null,
      "U_OB1_DEMANDE": null,
      "U_OB1DOSSIER": null
    },
    {
      "LineID": 4,
      "StageID": 4,
      "StageType": 16,
      "StartDate": "2019-02-19",
      "CloseDate": null,
      "Task": null,
      "Description": null,
      "ExpectedCosts": 0.0,
      "InvoicedAmountSales": 0.0,
      "OpenAmountSales": 0.0,
      "InvoicedAmountPurchase": 0.0,
      "OpenAmountPurchase": 0.0,
      "PercentualCompletness": 0.0,
      "IsFinished": "tNO",
      "StageOwner": null,
      "DependsOnStage1": null,
      "DependsOnStage2": null,
      "DependsOnStage3": null,
      "DependsOnStage4": null,
      "StageDependency1Type": "sdt_Project",
      "StageDependency2Type": "sdt_Project",
      "StageDependency3Type": "sdt_Project",
      "StageDependency4Type": "sdt_Project",
      "DependsOnStageID1": null,
      "DependsOnStageID2": null,
      "DependsOnStageID3": null,
      "DependsOnStageID4": null,
      "AttachmentEntry": null,
      "UniqueID": null,
      "FinishedDate": null,
      "U_OB1_DEMANDE": null,
      "U_OB1DOSSIER": null
    }
  ],
  "PM_OpenIssuesCollection": [],
  "PM_DocumentsCollection": [],
  "PM_ActivitiesCollection": [],
  "PM_WorkOrdersCollection": [],
  "PM_SummaryData": {
    "LineID": 1,
    "SubprojectBudget": 0.0,
    "SumOpenAmountPurchase": 0.0,
    "SumInvoicedAmountPurchase": 0.0,
    "TotalAmountPurchase": 0.0,
    "TotalVariancePurchase": 0.0,
    "VariancePerceptionPurchase": 0.0,
    "AccumSubprojectBudget": 0.0,
    "AccumOpenAmountPurchase": 0.0,
    "AccumInvoicedAmountPurchase": 0.0,
    "AccumTotalPurchase": 0.0,
    "AccumTotalVariancePurchase": 0.0,
    "AccumVariancePerceptionPurchase": 0.0,
    "PotentialSubprojectAmount": 0.0,
    "SumOpenAmountSales": 9000.0,
    "SumInvoicedAmountSales": 0.0,
    "TotalAmountSales": 9000.0,
    "TotalVarianceSales": 9000.0,
    "VariancePerceptionSales": 0.0,
    "AccumPotentialSubprojectAmount": 0.0,
    "AccumOpenAmountSales": 9000.0,
    "AccumInvoicedAmountSales": 0.0,
    "AccumTotalSales": 9000.0,
    "AccumTotalVarianceSales": 9000.0,
    "AccumVariancePerceptionSales": 0.0,
    "ActualItemComponentCost": 0.0,
    "ActualResourceComponentCost": 0.0,
    "ActualAdditionalCost": 0.0,
    "ActualProductCost": 0.0,
    "ActualByProductCost": 0.0,
    "TotalVariance": 0.0,
    "DueDate": "2019-11-19",
    "ActualClosingDate": null,
    "Overdue": 0
  },
  "PM_DocAttachements": [],
  "PM_StageAttachements": []
}

Response 201 Created.

GET with ID //ProjectManagements(35)

Response 200 OK


PATCH (simple) //ProjectManagements(35)

{
  "ProjectName": "ProjectNameINSOMNIA",
  "DueDate": "2019-11-20"
}

Response 400 Bad request

{
  "error": {
    "code": -2035,
    "message": {
      "lang": "en-us",
      "value": "This entry already exists in the following tables (ODBC -2035)  [Message 131-183]"
    }
  }
}

So i though, ProjectManagement was linked with many things so i tried to patch "PM_StagesCollections" because that what i nedd to update.

PATCH (Collection) //ProjectManagements(35)

{
    "ProjectName": "ProjectNameINSOMNIA",  
  "PM_StagesCollection": 
    {
      "LineID": 1,
      "StageID": 1,
      "StageType": 16,
      "StartDate": "2018-12-21"
    }
}

Response 400 Bad Request

{
  "error": {
    "code": -2035,
    "message": {
      "lang": "en-us",
      "value": "This entry already exists in the following tables (ODBC -2035)  [Message 131-183]"
    }
  }
}