NetSuite Saved Search formula to get a field's value as of a given date - netsuite

I am required to use a saved search to answer the question: how many cancelled Sales Orders did we have on a specified date? I must use a saved search because ultimately it will be something viewed on a dashboard (and this is what the end users are used to). I know that I can and how to complete via SuiteScript; this is explicitly a question related to Saved Searches and/or SuiteAnalytics. The status of our sales orders fluctuates more than a “normal company”, i.e. 1 SO might change status 3 or 4 times before being “done”. My initial thought was to create a saved search and add “System Notes fields…” as results. So I’d have something like the following:
For the given date 7/19/20 the status was “Canceled” since 7/19/20 is greater than 6/12/20 and less than 7/22/20. I would like to get this field’s value on 7/19/20 programmatically and display it as a Saved Search results column but I don’t know how. I think I’m stuck because I don’t know how to tell NetSuite in a saved search to look at the date in the row above or below. Said differently I don’t know how to compare the given date to all the system note dates to find the system note date that is right before (use the old value) or after (use the new value) the given date. In excel I would do the following, how do i do this in a NetSuite Saved Search?

To apply a dynamic date filter:
In the Criteria tab, add a date filter:
Filter = System Notes : Date is on today
In the Available Filters tab, add the same date filter:
Filter = System Notes : Date,
Show in Filter Region = Yes

Related

How can I include the main line ship date in line item results for a sales order saved search?

I am trying to create a Saved Search that can be used to break down on time shipments by item type. However, I've noticed that {shipdate} isn't included in the results for the line items on sales orders.
Here is an example search where the "Inventory Item" line does not have ship date.
I've tried using a formula field and variations of {*.shipdate} and {mainline.shipdate}, but they only produce errors; {mainline.shipdate} produces "Field not found" and {*.shipdate} produces "Invalid Expression." I do not have the same problem with {actualshipdate} as this date is displayed on line item results when included.
How do I access this main line dimension on line item results?
That is odd that your NetSuite isn't returning the mainline ship date on every line. It does for me, so perhaps there is a setting somewhere.
Apart from finding a setting, the simplest way to return the Ship Date on every line is with an analytic function:
MIN/*_*/({shipdate}) OVER (PARTITION BY {internalid})
Nathan's answer made me want to take another look at this, as I was also surprised that NetSuite was not returning the Ship Date field with each line. I found that having Demand Planning enabled affects how NetSuite displays the Ship Date.
From SuiteAnswers:
If the Demand Planning Feature is enabled, values for the Date Shipped column in the Report will be sourced from the 'Expected Ship Date' column on the line item level of the Sales Order. Thus, using Ship Date on the report will return a null value if Demand Planning Feature is enabled.
So turning demand planning on means line Ship Date = null, demand planning off means line Ship Date = head Ship Date (in saved search).
Probably not really of any practical help, but good to know the underlying reason.
One approach would be to make a custom column (line) field and copy the header ship date field to each line using a workflow or script (could be scheduled or triggered on the before submit event).
Another way to work around it could be to use the new SuiteAnalytics workbook feature, if you don't have other things depending on this to be a saved search.

Fetching date value from a SharePoint-list, to use in date&time specific field in flow

I'm trying to design a Microsoft Flow, which will create a outlook calendar event entry based on information in a SharePoint-online list.
The list will contain a value for a DueDate its a column of type Date, not including time.
I want to be able to create a outlook calendar entry on the date based off the duedate column. The calendar entry form in flow allows via dynamic content to add dates that also include time, however date columns not containing time cannot be added that way.
Is there a workaround to this, some expression that would allow me to fetch values from columns more freely and then possible append a time to it
I have tried converting the column in sharepoint to a Date with Time column and that workaround worked, however its not what I'm looking for. Id like to know how to be able to work around this because I don't necessarily want my column as a date-time column which can cause problems later on.
I have tried this expression:
formatDateTime(concat(item()?['DATE'], '08:00')'yyyy-MM-ddThh:mm:ss')
But I know this is wrong and it doesn't work. I'm simply not sure how to do it.
https://puu.sh/Df5ni/05cb882b23.png
I want the flow to add a calendar entry based off the due date column which i can append my own time to like the start of the day and last til the afternoon.
Actual results are I don't seem to be able to use a date column, just a date-time column for start and end times of the event, date column without time doesnt appear in the dynamic content list.
If there is some way to manually fetch values instead of using the dynamic content that is very powerful and can then possibly be converted to the right format using additional code.
Date column name in my list is date_without_time of type Date (Add time set to NO):
New element:
Function used in Create event (V2) action:
formatDateTime(triggerBody()?['date_without_time'],'yyyy-MM-ddT09:35')
Result:
Calendar:

Using a NetSuite saved search formula to filter from system notes

I am attempting to use a NetSuite saved search to bring back system notes for whenever an assigned person changes for a case. However, I would like to grab the initial assigned person and not the multiple re-assignments after that. Is there a way for me to only select the initial value rather than having all re-assignments come back to me? Is this able to be done from a formula somehow?
to get the oldest assignee of case you can use below criteria so, that results is restricted to just one result per case
1) System Notes : Field is assigned
2) System Notes : Old Value is empty
In the results add the column System Notes : New Value along with other columns of case. This field will pull the oldest assignee of the case
PS : solution assumes that there won't be any empty re-assignments. If there are empty re-assignments you should sort the results by Case unique identifier such as number or internalid and then by System Notes : Date, and the oldest date line would be the result that you are looking for.
Actually you can do that with a search clause where the old value is empty

Error in Calculated Column (using Today) in DataSheet View - Sharepoint 2010

I have calulated column which display's the value based on the difference between today and requested date field.
=Today-[Requested Date]
This is working fine in Sharepoint Standard View. But the same is not working with the datasheet view . The calculated column is showing as below
=#NAME?-[Requested Date].
Due to this i am not able to save the data. Can anyone please let me know how to solve this ?
Which SharePoint version are you using?
I tried the same scenario using SharePoint 2013 and was able to add the values in both standard and datasheet views. I am assuming you might have used the same steps.
Create 2 new columns named RequestedDate(DateTime) and
Today(Single line of text).
Add a new column of type calculated field with formula
=Today-[Requested Date].
Now delete the Today column.
Try entering the data in both the views.
First I have used today() function to calculate difference between 2 days except working days. The list is not automatically updating. If we change the Start_Date, then it calculates and gives the value. Can you suggest me why this happens?
You have mentioned in your post that there is some tricks in using today() function. I have created separate Today_Date column in my list. And Used the same column name in finding difference between 2 days. Here also the same problem exists.
The formula I used is,
=IF(AND((WEEKDAY([Today Date],2))<(WEEKDAY([Release Date],2)),((WEEKDAY([Release Date],2))-(WEEKDAY([Today Date],2)))>1),(((DATEDIF([Release Date],[Today Date],"D")+1))-(FLOOR((DATEDIF([Release Date],[Today Date],"D")+1)/7,1)*2)-2),(((DATEDIF([Release Date],[Today Date],"D")+1))-(FLOOR((DATEDIF([Release Date],[Today Date],"D")+1)/7,1)*2)))
Please tell me how to make the difference between 2 date values update automatically every time I open the list.
Then I tried the trick which you have mentioned above. But it works while I enter the data. When I open the list for the next day or some other day's after the Calculated column is not taking the current day's value, do the data remains same. what should I need to do in case it needs to take current date's value and calculate the formula?

SharePoint List Column Today's Date

All,
Does anyone know how to make a column in a SharePoint list that will always display today's date when rendered? I've seen tricks that require the list/item to be modified each day however, that's not what I'm looking for. I just want a column that whenever the list is viewed it displays the current date.
Thanks for any feedback.
I wanted to say that you use calculated columnns, but unfortunately according to this link the TODAY function is supported as a default value, but not supported in a calculated column.
So, outside of a default value, the only way to do this may be through a more involved effort. I see two options:
Use SharePoint Designer and the Data Form Web Part to show a view into a list with an additional column that has today's date.
The right way to do this is likely a computed field as it does not involve storing any additional information, but simply displays additional information. I didn't find a good link that only discussed computed fields, but this link does go into a bit of depth.

Resources