Skip to main content

Hai, i have issue .
The initial alternate was "PP001" and I wanted to change it to PP002, but what happened was not updating but adding a new line.
so how do you want to update not add a new line in crossreference with the API?
please help me, thank you

url : 
{{base_url}}/ExtendEndpoint/22.200.001/StockItem?$expand=CrossReferences&$filter=InventoryID eq 'FG34132'
body :

{

    "CrossReferences": e

        {

            "VendorOrCustomer": {

                "value": "DR00OPPP"

            },

            "AlternateType": {

                "value": "Customer Part Number"

            },

            "AlternateID": {

                "value": "PP002"

            },

            "UOM": {

                "value": "PIECE"

            },

            "Description": {

                "value": "PP002"

            }

        }

    ]

 

Hi @abdi 

Please try like the below to insert/update the cross-reference 


Method: PUT

URL: Instanceurl/entity/Default/22.200.001/Stockitem

Request:

{

    "InventoryID": {

        "value": "AACOMPUT01"

    },

    "CrossReferences":  

        {

            "AlternateID": {

                "value": "1111567"

            },

            "AlternateType": {

                "value": "Vendor Part Number"

            },

            "Description": {

                "value": "TEST"

            },

            "UOM": {

                "value": "EA"

            },

            "VendorOrCustomer": {

                "value": "ELEEASTCOM"

            }

        }

    ]

}


hi @jinin 

I've done that before, the result is the same, namely adding, not updating, I've also tried adding the ID from the cross-reference, and the results are not as expected

or is there an API to delete cross-references?


Hi @abdi,

To delete a Cross-Reference, you can use its ID and the delete field.

Below is an example you can try,

{
"InventoryID": {
"value": "WIDGET04"
},
"CrossReferences": [
{
"id": "4f362430-bee5-4511-9989-34ed24720ee6",
"delete":true
}
]
}

It is will be a two-step process, do a GET to find the ID to the CrossReference and PUT request to delete the CrossReference. Good Luck,


Hi @Vignesh Ponnusamy
wow it works, thank you for helping my life.
An alternative to not being able to update the alternate ID in cross-reference is by deleting the old data and then adding the newest data


Reply