NetSuite User Event or Workflow on Work Order Close - netsuite

I looked all over and I can't see to find how to connect a script to the "close" event of the Work Order. Basically, I need to send an email to the Sales Rep for the order that is being fulfilled when the Work Order is "closed" what approach would be better? A workflow or a UserEvent, I looked at workflow as the Close button is a non-standard event. When I went to set up the workflow I didn't see Work Order as a record to attach it to. Any help would be great, thanks

I'm not 100% sure on this, but I'm sure if you did an AfterSubmit User Event, you could get the status of the Work Order. If WorkOrder == 'closed' (whatever the right status is), run your code.
Alternatively, you could build a saved search of WorkOrders that are closed. Run a scheduled script every 15 minutes that will send out an email. Upon sending out the email, tick a checkbox on the WorkOrder to remove it from your Saved Search.

JK, you should be able to build a saved search and use the Alerts feature under the Email tab. Check the box to "Send email alerts when records are created/updated" and enter the recipients in the list under that. If you want it to go only to the Sales Rep for that specific customer, as I assume you do, use the list under 'Recipients from Results' sublist. This means you can have the sales rep returned in the search and choose that field, then the alert will be sent to the relevant rep for each record. You may have to tick the 'Send on Update' option as these records returned by the search will be existing records.
In case you're not familiar with the saved search alerts functionality, the way this works is that as soon as a record of the record type that the saved search is based on meets the conditions specified in the saved search criteria, it fires the alert and emails to the list of recipients specified under 'Specific Recipients' and the result returned by the field specified under 'Recipients from Results.'

What I came to find out is that the Work Order Close status is from a Work Order Close form, in that case just the after submit event takes care of this. Thanks for all your help and sorry I took so long to post this answer

Related

Netsuite doesn't trigger user event scripts after Duplicate number screen when saving payment

The problem: When I save the customerpayment in UI it triggers the user event scripts before showing the dialog to change the duplicated transaction number (attached). After I change the number, it doesn't trigger the user events.
How can I catch with my scripts the change of the transaction numbers?
Do you need to be able to manually set (override) the document number for payments? If not the easiest fix would be to go to Setup > Company > Auto-Generated Numbers, select the Document Numbers tab and uncheck the Allow Override option in the relevant row. Then NetSuite will automatically take care of numbering.
changing the Document number may not be triggering you user event script. Can you try editing and saving the record again. If your user event is designed to work on edit, it will get triggered when you edit and save the record.

Site workflow to send reminder email to Created By based on status of the item

I want to create site workflow to send a reminder email to created by(emails) when Item created is more than 30 days and choice field called "Status" is "open". When someone has more than one items with status open in list then that person get one reminder mail only
Thanks in advance
Aside from the issues of maintaining multiple long-running workflows on a site, each item with an open status would need its own workflow so that when it was updated to any other status it could self-terminate.
To resolve prevent duplicate emails, there would need to be an additional list to track which user received a notification email along with the date/time. This list could be queried by a standard rest API call with $select=Id,Modified&$top=1&$orderby=Modified+desc&$filter=<userIdField>%20eq%20<ID> which would provide the most recent record and based on the date determine if an additional email was warranted. If there is no record of an email sent, then a record can be inserted to indicate that "this" workflow instance will send out an email.
It may be important to run this query a second time before the email is delivered to ensure that a race condition did not occur, but if found, the duplicate record with the newer time-stamp will delete its duplicate and self-terminate.

User event Before Submit doesn't work in case of automatic PO creation (NETSUITE)

Is it possible to restrict the purchase order created automatically like when any dropship or special offer item selected in sales order?
I can confirm as of very recent discussions and testing with Netsuite that before submit does not trigger on automatically generated purchase orders.
We have an approvals system in place and were hoping purchase orders could be auto generated and stay pending supervisor approval but this is not possible as the before submit does not trigger.
An enhancement request has been raised by Netsuite for this functionality.
The behaviour of dropship and special order items is dependent on a checkbox. If you clear the checkbox when the order is approved then the automatic POs will not be created.
Checkbox clearing may be done by the user or may be done via a Before Submit user event script on the Sales Order.
If the need to restrict PO creation has something to do with PO vendor characteristics where you may also need to restrict general PO creation then you should extract the vendor check to a library file. that way it could be used in the SO beforeSubmit to clear the createpo flag and the PO beforeSubmit to throw an error.
You could also use the PO After Submit "specialorder" or "dropship" events to check the PO vendor after submit and delete the created PO.
However given your explanation in the comments the SO shouldn't be able to be approved. i.e. why take a drop ship order where the components are not orderable?

Netsuite timetrack Duration field into a Workflow

I would like to trigger an email when a new Time entry is created in Netsuite. Usually this can be easily accomplished through a Saved Search/Email but for Time searches, sending on Create is not available and already the topic of an enhancement request.
I've created a Workflow which will trigger upon Time entry create. In order to use the time entry fields I first created Workflow Fields and then in State 1 populate those workflow fields with the values. Suiteanswers: Use SQL expressions in Send Email action via the Workflow Manager (ID: 21669)
I can map many of the fields like Customer:Project, Service Item from the Time entry into my Workflow. I am stuck on mapping the Netsuite Duration field which according to the Records Browser is of a type "timetrack" ie 1:05.
I have tried it from the available field types, Date, Date/Time, Integer. I'm now trying to populate is into a Text field but am stuck as to how to convert it from the timetrack record type into Text.
Have tried
TO_CHAR({hours})
CAST({hours} AS text)
I just want a field with the Duration that I can use in an email. :)
How could I achieve this affect? Any thoughts appreciated.
Turns out that somewhere along the track I over-complicated what was needed. In the end I just inserted {hours} into my email text box and it worked. I can't explain why it didn't work initially.

How can I send a SharePoint alert only when a particular column is changed?

I need to trigger alert, if value of particular column (say marks<8, send mail to manager) changes.
What should I do?
Some kinds of lists (e.g. tasks) allow to send alerts when someone changes an item that appears in a particular view. Read the article Use SharePoint Filtered Views to Stop Sending Alerts to Yourself to get all the details (appropriate section begins with Well you need to set up a filtered view).
If you list supports this feature, first create a view that shows only the items that satisfy your marks<8 condition and then configure an alert that uses this view.
You can implement an event handler on the list to do this :
http://www.c-sharpcorner.com/UploadFile/Chandresh.P/EventHandler04292009070324AM/EventHandler.aspx

Resources