September 25, 201510 yr Hello All, I want to save and print my MAterials that are expiring for the next month; Below is the script but it doesn't work. Can you please help me improve and correct it. Enter Find Mode[] Set Field[Materials::Expiry Date,Month(Get(CurrentDate))+1 Perform Find[] Set Variable[$found;Value:Get(FoundCount)] If[$found>0] Set Variable[$Counter;Value:1] Loop Set Variable[$names & GetNthRecord(Materials::Materials Name;$counter) & "¶" Exit Loop If [$counter=$found] Set Variable[$counter;Value:$counter + 1] Show Custom Dialog [Expiring Materials for the next month" Attention!! "ATTENTION!!!! NEXT MONTH EXPIRING Materials\"; \ & $names" Go to Layout [Materials List View" (Materials)] Show All Records Save Record as Excel End Loop End If Thank you so much in advance Rose
September 25, 201510 yr "But it doesn't work" In what way doesn't it work? Please provide more meaningful description. Though one problem seems obvious: you perform a find; but then before exporting you show all records.
September 25, 201510 yr Author Hi BruceR, Thank you for the reply. Its not working the sense that I I tried to put October 08, 2015 to my Expiry Date field When I click my Expired next month button, not showing anything and its not going to my List View Layout.. Edited September 25, 201510 yr by Rosalie
September 25, 201510 yr Is your field "Materials::Expiry Date" a DATE field?If so, you could calculate the next month's range like the following:Date ( Month(Get ( CurrentDate )) + 1 ; 1 ; Year(Get ( CurrentDate )) ) & "…" & Date ( Month(Get ( CurrentDate )) + 2 ; 0 ; Year(Get ( CurrentDate )) )I agree with Bruce. Your LOOP in your script does not make sense. You, in essence, do a FIND on the next months records and then destroy your original found set with the SHOW ALL step.Please post a sample file of your data structure and some decent sample data with a details description of what you are trying to achieve. Good chance someone nice will help you achieve your goal.Hope this helps!
September 25, 201510 yr Further, consider exactly what your find does. It searches a date field for the value 10. That is what month( get(currentdate))+1 returns. Edited September 25, 201510 yr by BruceR
Create an account or sign in to comment