Sunday, 17 June 2018

Einstein Bots | How to Setup Einstein Bot | Summer 18



Recently we did one online session on "Einstein Bots". If you are looking for recording you can check here. To use Einstein Bots you need to enable Live Agent. If you have not done it yet, read this Post for Live Agent.


Let see how to configure the same.

Step 1) Enable the Einstein Bot.
Click on Setup->Service -> Service Cloud Einstein -> Einstein Bot Then Enable it.



Step 2) Accept Term and Condition .


Step 3) Enable Live Agent Option.
Click on "Deployment Channels"


click on edit button and enable the bot for Live Agent.


Step 4) Create a new Bot.
Click on "New" button from My Bots section.



And then follow below step :-



Step 5) Lets create Dialogs.

Click on Dialog Menu from the Einstein Bots Builder.



Then Click on + button to create "New Dialogs".


All Set . Now Create a question


Click on Question icon and enter your question like below screen.


Then add new Slot.


Add some more question :)


NOTE:- Add some Choice this time. Click on "Add Choice" button.


Lets Create some rule to Response to end user. Click on Rule button from below screen.


Add Condition and action

NOTE:- I created one more Dialog "Pizza Restaurants". You can create the one more rule for Chinese as well.

Save your changes after click on save button


Step 6) Now set Dialogs in welcome bots.
Click on "Welcome" option from Einstein Bots Builder.


Step 7) Save and Activate.



Now you can test your Einstein Bot from Live Agent.





If you want to see the recording of out Apex Hour click here. Thanks Shruti for a great Demo in Salesforce Apex Hours.


Please check below post if you want to call apex class in bots

Einstein Bots with Apex Class | How to Call Apex Class From Einstein Bots




Capture.JPG  @amit_sfdc    #SalesforceApexHours    @ApexHours

Thanks
Amit Chaudhary

Friday, 1 June 2018

Trigger.OperationType | System.TriggerOperation Enum | Salesforce Summer ’18 Release Notes

System.TriggerOperation Enum
This enum has the following values, which correspond to trigger events.
  • AFTER_DELETE
  • AFTER_INSERT
  • AFTER_UNDELETE
  • AFTER_UPDATE
  • BEFORE_DELETE
  • BEFORE_INSERT
  • BEFORE_UPDATE

Recently i created a post on Swtich Statement. Let see how we can use Swtich Statement and Enum in Trigger:-

trigger AccountTrigger1 on Account ( before Insert ,Before Update , After Insert, After Update) {
       switch on Trigger.OperationType  {
            when BEFORE_INSERT
            {
                System.debug('BEFORE_INSERT------>' + Trigger.OperationType );
                System.debug(Trigger.OperationType +'-Before Insert-->'+Trigger.isInsert+'--->'+Trigger.isBefore);
            }
            when AFTER_INSERT
            {
                System.debug('AFTER_INSERT ------->' +Trigger.OperationType );
                System.debug(Trigger.OperationType +'-After Insert-->'+Trigger.isInsert+'--->'+Trigger.isAfter);
            }
            when BEFORE_UPDATE, AFTER_UPDATE
            {
                System.debug('BEFORE_UPDATE or AFTER_UPDATE----->' +Trigger.OperationType );
            }
        }
}


Thanks,
Amit Chaudhary