Below is the script that I'm working in finding my materials that are expiring next month; I want that If I don't have any materials expiring for next month it will pop up a dialogue saying that I don't Have any expiring materials for the next month.
Can you please help me improve my script below.
Enter Find Mode
Set Field[Materials::Expiry Date,Month(Get(CurrentDate))+1
Set Variable[$names & GetNthRecord(Materials::Materials Name;$counter) & "¶"
Exit Loop If [$counter=$found]
Set Variable[$counter;Value:$counter + 1]
If [Get (FoundCount) =0
Show Custom Dialog ["Materials Expiring Next Month"] "Sorry, You don't have any Materials Expiring Next Month"
Show Custom Dialog [Expiring Materials for the next month" Attention!! "ATTENTION!!!! NEXT MONTH EXPIRING Materials\"; \ & $names"
If [Get (LastMessageChoice)=2
Go to Layout [original layout]
Perform Script ["Prep to export']
Thank you so much.