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"
Related
I am required to create a Java Script but unable to figure on how to proceed as I don't have that much of coding idea in OIM, can someone assist(below I have mentioned the scenario)
Scenario:
In OIM User Attribute Page, there is a User Field: 'Job Code' now we have experienced that there are some issues we are facing.
From the trusted source we are getting the correct data but as soon as it reaches OIM for few users we are getting random incorrect value. Value should be numbers (123456) which is present in the Database too and valid but for few we are receiving values like E?401#q something like this.
We are required to place a check to find users who are having these invalid Job Code entry.
Once detected, we need to trigger a email to the concerned team based on the User Type (Employee or Contractor) for employee it should trigger an email to a respective team and for Contractor we have to trigger to a different team to take action.
So, I believe we have to place two conditions here, can someone assist.
If you believe it only happens during trusted source reconciliation, then you can create Post-Process Handler on User Create/Modify operation to check the value which was posted into the DB as a result of recon event.
From this handler you can do all the things you need to do: mailing, fixing, etc.
For notification purposes I'd recommend to use built-in NotificationService, though it might be bit daunting, if you have little experience in OIM development. As an alternative you can do java mailing.
If you are not sure about the moment, when this "spoiling" happens, you can create a scheduled task, to be executed periodically, which will check JobCode values, to report invalid ones.
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.
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
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.
How do I create an activity feed rule that writes an auto post on the Record Wall of a case when an email is automatically assigned (made Regarding) to that case because of its tracking token?
Our users are having trouble realising that there is something new to look at in the case and this would go a long way to preventing them from missing an important event.
EDIT:
These solutions have already been considered
They don't want follow up tasks.
The email is already displayed in a grid on the case
They don't want more Queues to check.
They don't want more emails to deal with.
This user is recalcitrant to say the least...they only want a note to appear on the record wall of the case.
To accomplish this with little/no coding, you could:
1) create a task or other activity that would show up on the activity feed. This is easily accomplished via workflow.
2) display the email/other activities in a grid on the case.
3) also set up queues to handle this.
4) send an email to the owner of the case when an activity gets appended to it.
There are a lot of options to resolve the issue of notifying users that their case has additional info.
EDIT:
Your comments are accurate and well received. Can't you do something as simple as create a workflow that will create a post when an email is created and/or when set regarding field changes. Then you can check within the workflow that the set regarding is for a case or else cancel the workflow. Within the post record, set the type to auto and the regarding to the same regarding as the email. (I was unable to get the record wall part working in my local VM, so I assumed that any post record regarding the case should show up in the case, but I couldn't test that).