Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3346 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted (edited)

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
Posted

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!

Posted (edited)

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

This topic is 3346 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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