I have an integration to import sales orders. We have a unit price in the import file but only want it used when the price level price for that item is $0. I have a script for the field that looks like this
If DestinationFields("Unit Price")=0 Then
CurrentField = SourceFields("Sales-Order-Import.Unit Price")
ELSE
DestinationFields("Unit Price").SetToDefault
That doesn't work. When the price level price is 0, it still puts 0 on the sales order that is imported instead of using the unit price from the import. I also tried this
If DestinationFields("Unit Price").HasDefault = False Then
CurrentField = SourceFields("Sales-Order-Import.Unit Price")
ELSE
DestinationFields("Unit Price").SetToDefault
This worked if the price level price wasn't 0 but when it was 0 it would use 0. I think because 0 would still be considered a default value.
So, is there anyway to be able to do this?
Thanks
Jennifer
*This post is locked for comments
Hi Kelly
Thanks for the reply. Before you posted I was able to figure out a solution to this.
Thanks
Jennifer
Hi Jennifer,
Does DestinationFields need to be used for this script or is the field available so that you could use SourceFields instead?
Here is an example from the VB Script library that is installed with Integration Manager. The reason I recommend using SourceFields if possible is because DestinationFields doesn't work for all scenarios.
If SourceFields("RMHeader.SalesAmt")>=0 then
CurrentField = "Sales / Invoices"
Else CurrentField = "Credit Memo"
End if
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,963 Most Valuable Professional
nmaenpaa 101,156