disabled_rosalie

Zero Found Count Dialogue

Discussion created by disabled_rosalie on Nov 4, 2015
Latest reply on Nov 4, 2015 by disabled_rosalie

Hello All,

 

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

 

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]

 

End Loop

 

If [Get (FoundCount) =0


Show Custom Dialog ["Materials Expiring Next Month"] "Sorry, You don't have any Materials Expiring Next Month"

 

Else

 

Show Custom Dialog [Expiring Materials for the next month" Attention!! "ATTENTION!!!! NEXT MONTH EXPIRING Materials\"; \ & $names"

 

End If

 

If [Get (LastMessageChoice)=2

 

Go to Layout [original layout]

 

Exit Script

 

End If

 

Perform Script ["Prep to export']

 

Enf If

 

 

Thank you so much.

Outcomes