SAP Knowledge Base Article - Public

3422017 - PM form content page is not updated successfully even through the POST upsert via SF Odata API is successful

Symptom

PM form content page is not updated successfully even through the POST upsert via SF Odata API is successful.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SAP SuccessFactors HXM Suite

  • Performance Form entity

Reproducing the Issue

1. Get one of the comment field or rating field via SF Odata API:

e.g. {{URLTest}}FormHeader?$format=json&$filter=formDataId eq '36046'&$expand=formLastContent/pmReviewContentDetail/customSections/customElement 
Response:
{
    "d": {
        "results": [
            {
                "__metadata": {
                    "uri": "https://apisalesdemo8.successfactors.com/odata/v2/FormHeader(36046L)",
                    "type": "SFOData.FormHeader"
                },
       ...
                                            "customElement": {
                                                "results": [
                                                    {
                                                        "__metadata": {
                                                            "uri": "https://apisalesdemo8.successfactors.com/odata/v2/FormCustomElement(elementKey='Rationale',formContentId=47557L,formDataId=36046L,itemId=-1L,sectionIndex=2)",
                                                            "type": "SFOData.FormCustomElement"
                                                        },
                                                        "valueKey": "wf_sect_2_e_Rationale0",
                                                        "value": "TestTest",

...

2. Open PM form 36046 on SF UI.

3. Change the value of this comment field(wf_sect_2_e_Rationale0) via SF Odata API.
e.g. POST: {{URLTest}}upsert?$format=json 
Payload:

{
    "__metadata": {
        "uri": " FormPMReviewContentDetail(formContentId=47557L,formDataId=36046L)",
        "type": "SFOData.FormPMReviewContentDetail"
    },
    "customSections": {
        "__metadata": {
            "uri": "https://apisalesdemo8.successfactors.com/odata/v2/FormCustomSection(formContentId=47557L,formDataId=36046L,sectionIndex=2)",
            "type": "SFOData.FormCustomSection"
        },
        "customElement": {
            "__metadata": {
                "uri": "https://apisalesdemo8.successfactors.com/odata/v2/FormCustomElement(elementKey='Rationale',formContentId=47557L,formDataId=36046L,itemId=-1L,sectionIndex=2)",
                "type": "SFOData.FormCustomElement"
            },
            "valueKey": "wf_sect_2_e_Rationale0",
            "value": "TestTestTestTest"
        }
    }
}
Response:
{
    "d": [
        {
            "key": "FormPMReviewContentDetail/formContentId=47557,FormPMReviewContentDetail/formDataId=36046",
            "status": "OK",
            "editStatus": null,
            "message": "",
            "index": 0,
            "httpCode": 200,
            "inlineResults": null
        }
    ]
}

4. Refresh PM Form UI Page.
 
Actual Results: the Comments field value is not changed to 'TestTestTestTest' successfully.

Cause

When the UI has the same form open, it triggers the front-end's automatic save mechanism, causing the inability to update simultaneously through the OData API

Resolution

Please close the UI form content page and POST upsert the data again via SF Odata API, the value will be successfully updated.

e.g. 

1. To change the value of a field(wf_sect_2_e_Rationale0) via SF Odata API when closing the form content page.
e.g. POST: {{URLTest}}upsert?$format=json 
Payload:

{
    "__metadata": {
        "uri": " FormPMReviewContentDetail(formContentId=47557L,formDataId=36046L)",
        "type": "SFOData.FormPMReviewContentDetail"
    },
    "customSections": {
        "__metadata": {
            "uri": "https://apisalesdemo8.successfactors.com/odata/v2/FormCustomSection(formContentId=47557L,formDataId=36046L,sectionIndex=2)",
            "type": "SFOData.FormCustomSection"
        },
        "customElement": {
            "__metadata": {
                "uri": "https://apisalesdemo8.successfactors.com/odata/v2/FormCustomElement(elementKey='Rationale',formContentId=47557L,formDataId=36046L,itemId=-1L,sectionIndex=2)",
                "type": "SFOData.FormCustomElement"
            },
            "valueKey": "wf_sect_2_e_Rationale0",
            "value": "TestTestTestTest"
        }
    }
}
Response:
{
    "d": [
        {
            "key": "FormPMReviewContentDetail/formContentId=47557,FormPMReviewContentDetail/formDataId=36046",
            "status": "OK",
            "editStatus": null,
            "message": "",
            "index": 0,
            "httpCode": 200,
            "inlineResults": null
        }
    ]
}

2. Open this form content page in SF UI.
 

Keywords

Odata API, upsert Form Content, valueKey, value, FormPMReviewContentDetail, no data update, upsert success , KBA , LOD-SF-PM-API , Webservices, OData APIs , LOD-SF-PM-ADM , Admin Center, RBP, Permissions and Settings , Problem

Product

SAP SuccessFactors HCM Core all versions

Attachments

Pasted image.png