Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Making a field required on a scrolling window

Posted on by Microsoft Employee

Hello

Is it possible to make a field required on a scrolling window, for example the Reason Code on Item Transaction Entry.

If I change Required to true in modifier under 'Scrolling Window:IV_Transaction_Scroll' it does nothing.

I can't add the columns on the grid to a VBA project either, logically I would want to do -

If column 1 (item no) <> '' then column 2 is required

But I don't know how to achieve this.

Thanks

Tania

*This post is locked for comments

  • RE: Making a field required on a scrolling window

    Hi Tania, I know this is an old post. Did you get it to work?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Making a field required on a scrolling window

    Hi Leslie, yes you have understood me correctly. Your knowledge is always very helpful. Having it explained this way makes some logical sense now, but is not something I would have considered myself, was a bit stumped as to why they were giving different results.

    I have quickly written

    Private Sub DTAPostingDescr_BeforeLostFocus(KeepFocus As Boolean, CancelLogic As Boolean)

    If Me.DTACodeID <> "" And Me.DTAPostingDescr = "" Then

    MsgBox "Description Required"

    KeepFocus = True

    End If

    End Sub

    It seems to be working, but I'll need to test it properly when I've got the time.

    Thanks

  • Verified answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: Making a field required on a scrolling window

    Hi,

    I think I'm reading that your Transaction scroll window is fine, but you are having a problem with the Analysis Detail Entry window. The problem with that field is that there isn't another field that, out of the box, is required. If no fields are required, the Dex scipt to check and make sure the required fields have been filled, was probably never run. If that is the case, you will not be able to make this field required using Modifier. There are other tools you can use, just not Modifier.

    Kind regards,

    Leslie

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Making a field required on a scrolling window

    Sorry again, I tried this on another scrolling window. I was sure I had a problem with this one years ago at another company. The 'Analysis Posting Detail' window on Financia module, making the Posting Description field required.

    I have gone to modifier, 'Scrolling Window:SW Codes' 'DTA_Posting_Desc' field Required = True.

    I have set the Analysis Posting Detail window to the modified version.

    This seems to do absolutely nothing.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Making a field required on a scrolling window

    Actually no apologies, you are correct. I'm not sure what was happening in my testing it seemed a bit buggy, I had opened a previously entered transaction and it was letting me save it. But deleting it and creating a new transaction, the new validation does seem to work. Seems I had it right all along. Thanks!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Making a field required on a scrolling window

    Hi Leslie, please see my response to Almas, this does not work. I had already had the scrolling window and the right field modified to true. It does not prevent saving and posting.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Making a field required on a scrolling window

    No this does not work, when you enter the details on the first line and try to tab to a second line it tells you not all required fields have been entered, but it does not prevent you from hitting save and posting the batch without that field entered.

  • Suggested answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: Making a field required on a scrolling window

    Hi Tania,

    Open your window in Modifier. I think you may be talking about the Inventory Transaction entry window You need to open the scrolling window itself.  Double-click on the scrolling window. The window that opens will show you all of the fields in the scrolling window. Click on the Reason Code field and then change the value of the Required property to True. While this will indeed make the field required, it will not provide the visual queue in the header. If you want it to look like a required field, you'll need to hard-code the color of the header label.

    Kind regards,

    Leslie

  • Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Making a field required on a scrolling window

    You just need to open window in modifier, make property required =true for field reason code, go back to gp.mark modified form and thats it.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Making a field required on a scrolling window

    I'm newer myself to Dynamics GP, so take what I say with a grain of salt. You can do this a couple different ways but make sure you have all the fields added to vba. Then you can either warn the user after they leave the reason code grid or you can prompt them on the save.

    If doing this as they leave the reason box make sure you are editing the ItemTransactionDetail(Grid) not the ItemTransactionDetail(Window). Then something like this:

    Private Sub ReasonCode_BeforeLostFocus(focus, cancel)

       If ItemNumber = "" Then

           If ReasonCode = "" Then

               Msg = "Reason code required"

               Cancel = True

               Focus = True

          End If

       End If

    End Sub

    If doing this on the save, make sure to do this in the proper save Sub and cancel the save and exit the save Sub. Also make sure to do as Almas said and set GP to use the modified window.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans