Netsuite timetrack Duration field into a Workflow - netsuite

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.

Related

NetSuite User Event or Workflow on Work Order Close

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

How can I trigger a NetSuite workflow on a Form Event (Client side event)

I want to trigger a NetSuite workflow when the user sets the value of a field, but I don't want to have them submit first. The Workflow state builder looks like it has useful options but I can't get it to work.
There's some useful looking blog posts around but a lot of them seem out of date.
Update - more info
My primary issue is this one: Restrict what customers an employee can see (NetSuite)
The hack I'm currently looking at is populating a custom Transaction Column Field that I've added to a custom Time Recording form. The idea is to load this field on the UI with only valid projects (not customers as well), and this I have been able to do.
The problem is I still (as far as I can tell) still need to populate the "Customer" field, which is mandatory; I'm also assuming that if I don't do that then any time that is recorded won't go against the project. I had thought that if the user selects the project they want then I can populate the customer field with that value. I hate this as an approach but I can't see how else to do it. I do have coding experience (including JavaScript) but haven't made the leap into SuiteScript yet.
You won't be able to do this in a Workflow, as they are currently limited to only work with body level fields and cannot modify Transaction Column Fields (aka sublists).
You should be able to achieve this with a Client Side Script though.
Source (Netsuite login required).
Sublist changes will be available for transactions in the 2018.1 release sometime in Feb/Mar.

CRM 2011 Workflow not triggered before mandatory fields are checked

I am looking to create a workflow that will populate any mandatory fields that do not contain data when a company is deactivated. The mandatory fields are either not populated because of legacy data or because the mandatory fields have changed since the record was created.
The issue I get is that the mandatory field check takes place before the workflow is triggered.
My workflow looks like follows:
If Status = Inactive
If Company Name does not contain data
Then update to ‘Test’
I have come up with a possible solution:
• Create a new button in the ribbon that runs the workflow on-demand and apply permissions to this button.
If possible though I would like to do this through a workflow that is triggered on clicking of the ‘Deactivate’ button. Any ideas are welcome.
In your situation the record will not be saved until the mandatory fields are filled, and a workflow cannot be triggered if a record is not saved first.
An approach to solve this situation is to write a JavaScript attached to the OnSave event, but you need a rule to be able to identify the legacy records, so this JavaScript (that will fill the mandatory fields for you) will not run for normal records.
This approach is not tested, but with some tweaks should work.

Custom memo field isn't copied to Reply or Forward in Lotus Notes 6.5

I work in a development/support team which has a shared Lotus Notes mailbox. We need to be able to associate an issue ID with each email. We started by adding this ID to the subject line (eg. "Something doesn't work [ID12345]"). For performance reasons, our IT dept don't allow indexing of shared mailboxes, so it takes a long time to search for a particular ID.
I decided to add a new ID field, which can be shown as a sortable column in views and folders. I put this field to the visible header (just below 'Subject') in the ($All) view and the ($Inbox) folder, and copied the ($Inbox) design to all the other folders in the database. That much was easy.
My problem is that when we reply or forward, this custom field is not carried over to the new memo, so we have to manually add it again before sending. And of course when the user responds, the field is again missing and must be manually added. I have searched the docs and the internet and haven't found any information on this. Either I have to declare this field as something which persists across replies and forwards, or I have to add a line somewhere which explicitly copies the field contents to the new memo.
fsw,
We do exactly this with our complaint system however our database is indexed although this should not be an issue to you. We created a view that is sorted by ID by extracting just the ID from the subject line, order it by ID and then by date descending. Base it on the $ALL folder view so you get both incoming and sent emails.
We then altered the memo form to include an embedded view single category of the new view that sits above the body which shows all other documents linked to the ticket.
This should avoid having to delve to far into the very complex mail template any further. One thing is to make sure you have a copy of the changes you made and a bit of doco re deploying as you can guarantee that one day your template will be completely overwritten in an upgrade and all your good work will be gone.
As the additional field would have to incorporated into all Memo forms in mail templates in your corporation and as these fields do not easily travel via SMTP, you should stick with the ID in the subject.
What you could do is to parse the subject (#Mid, #Right, ...) in the column formula in the view and only display the ID there (like you did with the additional field).
The other option I envision if having a field is required is to have an agent that processes the incoming message(reply) to have it parse out the issue ID from the subject and write it to the field. You could also do that with queryopen or postopen if running an agent is not possible

How to set up an workflow in SharePoint to only work when a specific field is changed and not everytime the item is edited?

The issue is that everytime an item is edited/changed all the users who are set up to receive updates are notified. I need the workflow to run only when a specific field is changed disregarding the others. For example if my item contains these values (Customer Name; Acc#; Contact Person; Address;) - I need the workflow to work only when the Acc# is changed and only if it is changed, no metter how many times the other fields are changed.
Thanks,
A quick way to do it is to have the workflow store the value each time the it starts, then tell it to wait until the field != the stored value. This may not work in all cases, but it could be enough for your purposes.
You should create an event handler to run on your content type or library. You can then check the before and after properties of the fields you mention. Then use the event handler to initiate the workflow if required.

Resources