Solved

update alternateid in crossrefference stock item with api

  • 12 December 2023
  • 4 replies
  • 54 views

Userlevel 3
Badge
  • Jr Varsity III
  • 51 replies

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": [

        {

            "VendorOrCustomer": {

                "value": "DR00OPPP"

            },

            "AlternateType": {

                "value": "Customer Part Number"

            },

            "AlternateID": {

                "value": "PP002"

            },

            "UOM": {

                "value": "PIECE"

            },

            "Description": {

                "value": "PP002"

            }

        }

    ]

 

icon

Best answer by Vignesh Ponnusamy 12 December 2023, 21:13

View original

4 replies

Userlevel 3
Badge

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

Userlevel 7
Badge +4

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,

Userlevel 3
Badge

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?

Userlevel 7
Badge +11

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"

            }

        }

    ]

}

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved