Send email if planned date is passed in dynamics CRM - dynamics-crm-2011

I need to write a workflow for a library system. In which the workflow required to wait after 5 days when planned check in date is passed and then send an email. I tried the following but seems it'll not work.
If Planned check-in date Equals 5 DaysBook:Check Out
then send email
Any suggestion where I am doing wrong?

you would need to use the wait condition rather than the if condition support here.

Related

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.

Google Assistant - How to re-prompt if the input is invalid?

I am using Google Assistant with Node.js where I ask the user for check-in date and check-out date.
If the check-out date is later than the check-in date then I want to add a re-prompt so that the user can tell a valid date. Is there a way to force a re-prompt from the code?
The code snippet is below:
app.intent('myIntent', conv => {
// validation
const checkInDateString = conv.parameters[CHECK_IN_ARGUMENT];
const checkOutDateString = conv.parameters[CHECK_OUT_ARGUMENT];
var checkInDate = new Date(checkInDateString);
var checkOutDate = new Date(checkOutDateString);
console.log("Check-in date is: " + checkInDate.getTime());
console.log("Check-out date is: " + checkOutDate.getTime());
if (checkInDate.getTime() > checkOutDate.getTime())
{
conv.close('Pick a check-out date that is later than the check-in date!');
console.error('The check-in date must be before the check-out date!');
}
else
{
// save to db.
}
});
I don't want to close the conversation, but rather to do a re-prompt for the last question.
This is the first attempt after the check-out date failed.
and this is the second attempt:
For adding a re-prompt after checking the date, you need to handle the parameters/slots in the NodeJS code by enabling "Enable webhook call for slot filling" at the bottom of the "add intent".
With this, for every parameter required, the webhook NodeJS code will be called and you can check the validity of the parameters.
The important point will be the re-prompt. When you want to re-prompt for correct parameter, you need to set the context programmatically. The issue will be that while collecting slots, dynamic context is generated by the Dialogflow for individual parameters.
You need to identify the context associated with your date parameter and if re-prompt, set that context with lifespan 2 so as to collect the parameter again.
A better way would be to have a separate individual intent for all the parameters that you want to validate. This way you will not have to identify the dynamic context and you can play with your own context while re-prompting.
Update - using second approach
Identify the slots that require validation.
Remove them from the current intent.
Create separate intents for each slot that require validation.
Enable webhook for these intents (not for the slot as you are collecting only one).
In the webhook, if the validation fails, set the output context same as the input so as to trigger the same intent.
Respond back with re-prompt response.
You want to use conv.ask() instead of conv.close(). Using ask() will send the message in the same way but will expect the user to respond. As the name might suggest, close() does close the microphone and end the conversation.
Additionally here for simplicity, consider using contexts, as those accomplish some persistence of state.
In your example, the action can fail correctly (as it should), but also save the check-in date so the next call can run correctly with both dates. The "7th March 2018" request can also trigger the same action, but read the check-in date already saved and function correctly.

Show message within 30 days of a Termination date NetSuite workflow

I am attempting to create a workflow where Before User Edits, the user will get a message if the Termination date is within 30 days from today. Since the Show Message action only performs on the client side, I was reading that I have to use Javascript functions instead of SQL functions. However, I can't for the life of me figure this out. This is a screenshot of what I am using to test:
Formula Condition
If there is anything else you would like to know please let me know. Thanks!
Can you try by setting trigger on "Before Field Edit"

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

Recurring Event or Automatically push Entry date forward in ExpressionEngine

I've got an events channel set up on a client site where everything is working just fine. However they now have a single event that runs every Sunday. Due to using the start_on parameter to only show events from the current month onwards this recurring event is now displaying a blank page.
Is there a simple way to have the entries publish date automatically updated to the current month or somehow display recurring events correctly. Client is unwilling to spend money on a new module such as Solspace Calendar.
You could set up a cron job on the server to run a PHP script which would modify the entry date on your recurring entry.
Yeah I see your dilemma, Sean - separating the event from its month and year (year in particular) to have one even display multiple times... What about using MX Clone to simply allow them to create multiple instances of the same entry (granted, they'd have to adjust the date for each one too, but that can be done en masse from the mass edit screen if you're using one of the native date fields and not a custom date field)?
Could you make the entry sticky? Not sure whether that would override the start_on parameter or not.

Resources