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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

vba button - added to print screen - fails in SL2011

(0) ShareShare
ReportReport
Posted on by 1,366

1. Just upgraded to SL2011 FP1, 2. Testing customized AP Voucher and Adjustment screen ( 03010) where we added a button to PRINT the AP Edit Report (03810) for this particular batch (the VBA is below), 3. Pressing button to print worked in SL7, FP1.  Now in SL2011 FP1 it results in error(s):

Crystal Report Windows Forms Viewer
The ) is missing.
Details: errorKind
Error in File 03810
....rpt: Error in formula Record Selection:
'({vr_03810_cRI_ID} = 4) AND (vr_03810.batnbr =064816)'
The ) is missing.
Details: errorKind
A resolution for this error was found:  In SL2011, it is necessaey to enclose the TableName.ColumnName in curly braces.  Example: {ARTran.Custid}Source: https://community.dynamics.com/product/sl/f/35/p/74955/137552.aspx

But now we get another error. This time is says:
Crystal Report Windows Forms Viewer
A string is required here.
Details: errorKind
Error in File 03810
....rpt: Error in formula Record Selection:
'({vr_03810_cRI_ID} = 4) AND ({vr_03810.batnbr} =064816)'
A string is required here.
Details: errorKind
This is the EXACT CODE from SL7 version that had worked:
Private Sub Button1_Click()
    BatchNbr = Trim(GetObjectValue("cbatnbr"))
    ParmStr = "ROI.EXE " & PRMSEP
    ParmStr = ParmStr & "03810/RUN" & PRMSEP
    ParmStr = ParmStr & "03810/FORMAT" & PRMSEP
    ParmStr = ParmStr & "vr_03810.batnbr =" & BatchNbr & "/WHERE" & PRMSEP
    ParmStr = ParmStr & "/PSCRN"
    serr1 = Launch(ParmStr, True, True, 0)
End Sub

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ram Peru Profile Picture
    2,830 on at

    Hello RedStorm,

    Try this below code in your customization.This will solve your Error.

    Private Sub Button1_Click()

     

        BatchNbr = Trim(GetObjectValue("cbatnbr"))

        ParmStr = "ROI.EXE " & PRMSEP

        ParmStr = ParmStr & "03810/RUN" & PRMSEP

        ParmStr = ParmStr & "{vr_03810.batnbr} =" & Sparm(BatchNbr) & "/WHERE" & PRMSEP

        ParmStr = ParmStr & "/PSCRN"

        serr1 = Launch(ParmStr, True, True, 0)

    End Sub


    Thanks,

    Perumalsamy R


     

  • RedStorm Profile Picture
    1,366 on at

    Perumalsamy R:  You did it! :-)  Thank you for providing exactly what I needed.  This prints my report just like I needed.  Thank you, thank you, thank you!  Dave (RedStorm)

  • Ram Peru Profile Picture
    2,830 on at

    Hello Dave ( RedStorm )

    you are always welcome.

    Thank you,

    Regards,

    Perumalsamy R

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans