Developer forum

Forum » Integration » Set custom field before product info request is sent

Set custom field before product info request is sent

Martin Moen
Reply

I would like to temporarily set a product field whenever a request is sent to ERP to get product information.
I do not want the field to be saved, it is a dynamic value which depends on the customer and context.

I tried something like this, but I feel it is not 100% correct...


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

I would subscribe to OnAfter instead and then modify the XML directly, instead of modifying the product.

 
Martin Moen
Reply

No, but the ERP system need to know that specific custom field value in order to return data based on that value.
So it has to be done before it is sent. I really just want to modify the XML being sent to ERP.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

That's what I meant. You can use OnAfterGenerateProductInfoXml to manipulate the XML after it's generated but before it's sent to the ERP.

 
Martin Moen
Reply

Ahh, I thought "After" was after it had been sent to ERP :P
Will look into that option then.

 

You must be logged in to post in the forum