what formula do i use if i want a saved search to ...
# ask-stanley-ai
b
what formula do i use if i want a saved search to show any changes made to the department, class, and programs field on a vendor bill after the bill has been approved
c
AI generated answer (using internal Slack threads):
To create a saved search that shows any changes made to the department, class, and programs field on a vendor bill after the bill has been approved, you can use the system notes feature in NetSuite. Here is a step-by-step guide: 1. Navigate to the saved search creation page and select 'Transaction' as the record type. 2. In the 'Criteria' tab, add the following filters: - Type: is Vendor Bill - System Notes: Field: is any of Department, Class, Programs - System Notes: Date: is after {systemnotes.date} when the bill was approved 3. In the 'Results' tab, add the fields you want to display. You might want to include the following: - Name (or Internal ID) - Department - Class - Programs - System Notes: Field - System Notes: Old Value - System Notes: New Value - System Notes: Date The formula to use in the 'System Notes: Date' criteria would be similar to the one used in the second thread:
Copy code
sql
CASE      
WHEN {systemnotes.newvalue} IS NOT NULL AND          
TO_DATE(TO_CHAR({systemnotes.date}, 'DD/MM/YYYY HH:MI AM'), 'DD/MM/YYYY HH:MI AM') >          
TO_DATE(MIN (CASE WHEN {systemnotes.oldvalue} = 'Pending Approval' AND {systemnotes.newvalue} = 'Approved for Posting' THEN TO_CHAR({systemnotes.date}, 'DD/MM/YYYY HH:MI AM') END) OVER(PARTITION BY {internalid} ORDER BY {line} DESC), 'DD/MM/YYYY HH:MI AM')     
THEN 1     
ELSE NULL 
END
This formula checks if the date from the system notes
{systemnotes.date}
is later than the date on which a record changed from 'Pending Approval' to 'Approved for Posting'. If this condition is true, the formula returns 1; otherwise, it returns NULL. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834655881
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.824218869
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82421881
Please provide your feedback on this answer.