Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Variable uses an Automation type not supported in VBScript

Posted on by 75,730

Integration Manager GP 9 9.00.0054

Why does this script:

CurrentField.value = Abs(Sourcefields("SWS_AP_Header.VOUCHER_GROSS_AMOUNT"))

Result in this error message?

Variable uses an Automation type not supported in VBScript

All I want to do is the get absolute value of a number.

*This post is locked for comments

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    Re: Variable uses an Automation type not supported in VBScript

    Strangely enough, this worked:

    CurrentField.value = Abs(Replace(Sourcefields("SWS_AP_Header.VOUCHER_GROSS_AMOUNT")," ","")

    Even though the input field is defined as decimal(19,5) in the SQL table, I still had to strip away blanks. In all the years I have written integfrrations I have never had to do this before. Thanks for the tip.

  • mpolino Profile Picture
    mpolino on at
    Re: Variable uses an Automation type not supported in VBScript

    Richard,

    2 thoughts.

    1) Are you sure that SWS_AP_Header.VOUCHER_GROSS_AMOUNT is a number and not a text type in the integration?

    2) Try wrapping it in a variable.

    Dim MyNumber

    MyNumber = Abs(Sourcefields("SWS_AP_Header.VOUCHER_GROSS_AMOUNT"))

    CurrentField.value = MyNumber

    I quit asking Why a long time ago but sometimes this works with odd ball IM Script errors.

    Mark

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans