Auto Submit catalog item based on a date field on a table

Community Alums
Not applicable

Hi All,

 

I have a requirement to auto-submit a catalog item based on 'End Date' field on Software Entitlement (alm_license) form. Whenever any record on the table has 'End date' less than 90 days I need to submit a catalog item to support team ( I'm aware that catalog item can be submitted using cart API) but I'm not sure how to set the trigger condition for my scenario. I may need to check the 'End date' values on the table every day on all the records and then submit the catalog.

Could someone help how to check and compare 'End date' with the current date and set the trigger condition please.

 

Thanks,

RJ

7 REPLIES 7

I believe RJ8 wanted end_date to be 90 days from now so I think this

licenseGr.addQuery('end_date', '<=', gs.daysAgo(90));

should be

licenseGr.addQuery('end_date', '<=', gs.daysAgo(-90));

 

Community Alums
Not applicable

Thank you @DUGGI , @DrewW 

It worked when I used 

licenseGr.addQuery('end_date', '<=', gs.daysAgo(-90));

 

Thank you @Community Alums , Could you mark the solution?

 

@DrewW Thank you;