web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Integration Manager Error Compiling Script 'For Field Customer ID' Line 2: - Expected 'End'

(0) ShareShare
ReportReport
Posted on by 122

I am getting an error when trying to run a translation script for customers in Integration Manager. I need the script for a cash receipts map. I cannot use SmartConnect for this because of the way they need to apply the documents.     

Here is the script I am using. I keep getting an error (Error Compiling Script 'For Field Customer ID' Line 2: - Expected 'End') and am not sure what I am missing. Any suggestions?   

If (sCUST = "701") then CurrentField = "701A"

Else (if (sCUST = "704") then CurrentField = "704A"

Else (if (sCUST = "707") then CurrentField = "707A"

Else (if (sCUST = "708") then CurrentField = "DoNotUse"

Else (if (sCUST = "713") then CurrentField = "713A"

Else (if (sCUST = "714") then CurrentField = "714A"

Else CurrentField = ("Vantage Cash Receipts Header.Customer ID")))))

End if

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    26P2ER Profile Picture
    1,775 on at
    RE: Integration Manager Error Compiling Script 'For Field Customer ID' Line 2: - Expected 'End'

    Hello ARand

    How about  the below: -

    CurrentField = SourceFields("SourceName.SourceCol Name")?

  • ARand Profile Picture
    122 on at
    RE: Integration Manager Error Compiling Script 'For Field Customer ID' Line 2: - Expected 'End'

    Thank you for the suggestion it looks like it is working except I do not want to add all of the customers to a list. I only need some translated. How do I have IM look at the source document if the customer is not part of the list? I tried adding the following but it thought the info in quotes is my customer which makes sense so I removed the "" but now I get an expected end error at the end of this line. Any suggestions?

    CurrentField = ("Vantage Cash Receipts Header.Customer ID")

  • Suggested answer
    26P2ER Profile Picture
    1,775 on at
    RE: Integration Manager Error Compiling Script 'For Field Customer ID' Line 2: - Expected 'End'

    Hello Arand:

    Is this all of it?

    I recommend using case logic to handle your requirement. Here is a sample snippet

    that you can tailor to your environment.

    Select Case sCUST

    Case "701", "704", "707", "708","713","714"

    CurrentField = sCUST & "A"

    Case Else

    CurrentField = sCUST

    End Select

    Hope this helps.

    Regards

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans