Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Integration Manager field script "Object Required"

(0) ShareShare
ReportReport
Posted on by 35

I am creating a Journal Entry integration that needs the account number modified slightly based on what the incoming account number is. In a nutshell if the incoming account number has 2 "-" it gets changed to a hardcoded account number, otherwise the account number in the file is used. When I try to run the below script I'm getting this error even those I can use MsgBox to see sAccountNumber is being populated correctly:

DOC 1 ERROR: Error Executing Script 'Entries.Account Number' Line 6: - Object required: 'sAccountNumber'


Dim sAccountNumber
sAccountNumber = CStr(SourceFields("AccountNumber"))

Dim count
count = 0

count = sAccountNumber.ToString.Split("-").Length - 1 'this line is throwing the error********


If count = 2 Then  
    CurrentField.Value = "02-10-1111-2410-00"
Else
    CurrentField.Value = sAccountNumber
End If

Any ideas why that would cause an issue?

*This post is locked for comments

  • Suggested answer
    Redbeard Profile Picture
    Redbeard 12,931 on at
    RE: Integration Manager field script "Object Required"

    Ben,

    The error you are seeing is Object required: 'sAccountNumber'

    So, your VB code isn't able to rationalize sAccountNumber...

    I haven't done this for years, so forgive me if I am not taking advantage of new features in VB, but looking at your code if you declare a variable, you need to define the format for the variable and then set the value.

    Dim sAccountNumber as String

    Dim Count as Integer

    Set sAccountNumber = CStr(SourceFields("AccountNumber"))

    Set count = 0

    Here is a solid post on defining variables and setting values.  I tend to group all my Dim statements at the top of my code, and explicitly define the formats and values.  Try something like:

    www.cpearson.com/.../declaringvariables.aspx

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans