Changing the default Item Inquiry Transaction Dates to the current month rather than General Ledger Period

SUGGESTED

My users are experiencing an issue where the accounting department is still performing month end closing processes for the previous month after start of the next month so the current General Ledger period is still last month and does not match the current calendar month. This causes the default view in Item Inquiry's transactions tab to show the previous months transactions by default when it should be showing the current month. This mismatch between the GL period and the calendar month breaks the functionality of these defaults and my users have to go into the binoculars and change the date for every single item which is obviously time consuming. 

Is there any way to change the default dates to use the calendar month as selected by the "Select Accounting Date" rather than the current GL period so that this issue doesn't occur?

Parents
  • 0
    SUGGESTED

    If on version 2015+, use the following in a UI Post Load event script attached to the dMain panel of the Item Maintenance library (IM_Item.M4L).

    dCurrentDate = Date
    dStartDate = DateSerial(Year(dCurrentDate), Month(dCurrentDate), 1)
    sStartDate = CStr(Year(dStartDate)) & Right("00" & CStr(Month(dStartDate)), 2) & "01"
    dEndDate = DateSerial(Year(dCurrentDate), Month(dCurrentDate) + 1, 0)
    sEndDate = CStr(Year(dEndDate)) & Right("00" & CStr(Month(dEndDate)), 2) & Right("00" & CStr(Day(DateSerial(Year(dEndDate), Month(dEndDate) + 1, 0))), 2)
    oUIObj.SetVar "cDefaultTransWhere$", "UCS(TransactionDate$)>=""" & sStartDate & """ AND UCS(TransactionDate$)<=""" & sEndDate & """"
    oUIObj.SetVar "cTransSearchWhere$", "UCS(TransactionDate$)>=""" & sStartDate & """ AND UCS(TransactionDate$)<=""" & sEndDate & """"
    oUIObj.SetVar "cFormattedTransStartDate$", CStr(dStartDate)
    oUIObj.SetVar "cFormattedTransEndDate$", CStr(dEndDate)

    If you want to see all transactions, use the following instead. However, be warned that a lot of history may slow down the panel when flipping through records or flipping to the panel.

    oUIObj.SetVar "cDefaultTransWhere$", "0=0"

    Use Custom Office > Customizer Selection to apply the script. Either search for "Item Maintenance" or locate it under the "Inventory Management" folder.

    Give your script a name. I used IM_ItmInqMaint_DefaultMonthTrans

    You'll be prompted to create a new script record if it doesn't exist, click yes.

    Paste the code in the Script field.

    You can also optionally change the path to a relative path so you don't have to worry about the path during upgrades. I changed C:\Sage\Sage 100 Advanced 2018\MAS90\CM\Script\IM_ItmInqMaint_DefaultMonthTrans.vbs to ..\CM\Script\IM_ItmInqMaint_DefaultMonthTrans.vbs

    Click Accept.

    Click Close.

    Click Compile.

    Click Close.

    Click Close.

    Also, for completeness, here is code you can use to default to all warehouses. This needs to be attached to the pTrans panel of the Item Maintenance library (IM_Item.M4L).

    sCB_SwitchWhse = "" : oUIObj.GetValue "CB_SwitchWhse", sCB_SwitchWhse
    If sCB_SwitchWhse <> "1"  Then oUIObj.InvokeChange "CB_SwitchWhse", "1"

Reply
  • 0
    SUGGESTED

    If on version 2015+, use the following in a UI Post Load event script attached to the dMain panel of the Item Maintenance library (IM_Item.M4L).

    dCurrentDate = Date
    dStartDate = DateSerial(Year(dCurrentDate), Month(dCurrentDate), 1)
    sStartDate = CStr(Year(dStartDate)) & Right("00" & CStr(Month(dStartDate)), 2) & "01"
    dEndDate = DateSerial(Year(dCurrentDate), Month(dCurrentDate) + 1, 0)
    sEndDate = CStr(Year(dEndDate)) & Right("00" & CStr(Month(dEndDate)), 2) & Right("00" & CStr(Day(DateSerial(Year(dEndDate), Month(dEndDate) + 1, 0))), 2)
    oUIObj.SetVar "cDefaultTransWhere$", "UCS(TransactionDate$)>=""" & sStartDate & """ AND UCS(TransactionDate$)<=""" & sEndDate & """"
    oUIObj.SetVar "cTransSearchWhere$", "UCS(TransactionDate$)>=""" & sStartDate & """ AND UCS(TransactionDate$)<=""" & sEndDate & """"
    oUIObj.SetVar "cFormattedTransStartDate$", CStr(dStartDate)
    oUIObj.SetVar "cFormattedTransEndDate$", CStr(dEndDate)

    If you want to see all transactions, use the following instead. However, be warned that a lot of history may slow down the panel when flipping through records or flipping to the panel.

    oUIObj.SetVar "cDefaultTransWhere$", "0=0"

    Use Custom Office > Customizer Selection to apply the script. Either search for "Item Maintenance" or locate it under the "Inventory Management" folder.

    Give your script a name. I used IM_ItmInqMaint_DefaultMonthTrans

    You'll be prompted to create a new script record if it doesn't exist, click yes.

    Paste the code in the Script field.

    You can also optionally change the path to a relative path so you don't have to worry about the path during upgrades. I changed C:\Sage\Sage 100 Advanced 2018\MAS90\CM\Script\IM_ItmInqMaint_DefaultMonthTrans.vbs to ..\CM\Script\IM_ItmInqMaint_DefaultMonthTrans.vbs

    Click Accept.

    Click Close.

    Click Compile.

    Click Close.

    Click Close.

    Also, for completeness, here is code you can use to default to all warehouses. This needs to be attached to the pTrans panel of the Item Maintenance library (IM_Item.M4L).

    sCB_SwitchWhse = "" : oUIObj.GetValue "CB_SwitchWhse", sCB_SwitchWhse
    If sCB_SwitchWhse <> "1"  Then oUIObj.InvokeChange "CB_SwitchWhse", "1"

Children