Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

"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. 

  • 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 by Rosalie

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!

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 by BruceR

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.