Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Integration Manager - Use price level price for sales order except when $0

(0) ShareShare
ReportReport
Posted on by

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

  • Re: Integration Manager - Use price level price for sales order except when $0

    Hi Kelly

    Thanks for the reply.  Before you posted I was able to figure out a solution to this.

    Thanks

    Jennifer

  • Re: Integration Manager - Use price level price for sales order except when $0

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans