Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Integration Manager prompt for info

Posted on by Microsoft Employee

I'm using integration manager with some vbscript to import payables transactions

My question is - if a document that is being imported is missing certain info, such as an document number, or also has an incorrect vendor - can the user be prompted with a message box to enter the correct info?

I know next to nothing about vbscript, and have manipulated the examples for other things.

*This post is locked for comments

  • Verified answer
    Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Integration Manager prompt for info

    If that's the case, I would appreciate you going and marking that little Answer button. It helps others with similar issues like yours to find a potential solution to their inquiry.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Integration Manager prompt for info

    You're a wealth of knowledge - I now having it working the way I want it to.  Thanks again.

  • Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Integration Manager prompt for info

    The short answer is yes, you can display the line item - this maybe another field in your source records, as follow:

    invoiceNo = InputBox("Please enter a valid invoice number " & SourceFields("SomeSourceQuery.LineNo"))

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Integration Manager prompt for info

    This worked!  What had me stumped was that my query was returning nulls rather than "" but I figure that out.  I have one last question (in two parts) and I'll leave you alone:

    In my input box asking for InvoiceNum - can I have the line item displayed to the user so they know which document it's prompting for?

    I'll post another article for the next question as it's pretty different.

    Thanks again.

  • Verified answer
    Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Integration Manager prompt for info

    Please keep in mind that IT IS NOT the data source that you need, but rather the name of the query, so I am leaving up to you to replace the moniker below with the right name :-)

    As for your other question, I believe this is what you are looking for:

    invoiceNo = SourceFields("SomeSourceQuery.InvoiceNo")
    
    If Not IsNull(invoiceNo) Then
       CurrentField.Value = invoiceNo
    Else
    
        Do While invoiceNo = ""
            invoiceNo = InputBox("Please enter a valid invoice number")
        Loop
        
    CurrentField.Value = invoiceNo End If
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Integration Manager prompt for info

    First of all, thank you very much for helping me - I'm really getting there.

    I didn't think to use a script for the field itself - I think that's the way to go and I think the answer is your initial script.  How would I write it so that it would use a source field UNLESS the document number is ""?  I'm researching how to reference source fields with VBscript.  The feld name is invoiceno and the data source name is TFW-Systems.  I may get the answer before you respond LOL!

  • Verified answer
    Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Integration Manager prompt for info

    Ok, so in the Before Document, you could do something like this:

    docNumber = SourceFields("SomeSourceQuery.Document Number")
    
    If docNumber = "" Then
      Do While docNumber = "" 
        docNumber = InputBox("Please enter a document number")
      Loop
    End If
    
    SetVariable "DocNum", docNumber


    You will then need to add a script to the field script as follows:

    CurrentField.Value = GetVariable("DocNum")


    As I mentioned in my initial reply, the script I originally wrote was a field script, hence cannot be used in any of the integration event scripts. Also, please note I re-edited the script as I made a couple mistakes.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Integration Manager prompt for info

    This is a good start - thank you Mariano.  I feel like this should exist in the Before Document script section or Document Error - doesn't seem to want to work in either place.  I think the best script would be before document, check the necessary fields for blanks OR a vendor that doesn't exist in GP, and then prompt.  I'll keep working on this and trying to learn VB lol.

  • Verified answer
    Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Integration Manager prompt for info

    You will want to add a field script to the particular field you are interested in, something like this:

    docNumber = SourceFields("SomeSourceQuery.Document Number")
    If docNumber = "" Then Do While docNumber = "" docNumber = InputBox("Please enter the document number") Loop CurrentField.Value = docNumber End If
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Integration Manager prompt for info

    Sadly that scenario won't work in this case.  I'm hoping for a script that can prompt the user to enter the correct info

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans