function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Benoit VAQUEZ 13Benoit VAQUEZ 13 

creating account with Apex from the Einstein Bot

Hello,

I'm trying to create a Bot that asks for the name of the new account, and when it has it, it creates a new Account with its name and others informations.
I have created the Bot, but I'm now stucked at the Apex development stage.
I have things in XML with API to do so, (at least to create an account), but I need to do it automatically from the Bot.
Do someone have an idea about how can I do that?

I have seen things and developments begining with:

Public with sharing class (Create Account -> this is how i'll name it)
Public class ChatBotAccOutput
@InvocableVariable
Public string name

So if I understand, now I have the name of the account in a variable that i can get back later in the Apex Code, But now i need to cross everything. Take the variable from the bot for the name, and put it inside the apex code, which will create a new account.

I really need help!

Thank you very much!

Benoit V
Khan AnasKhan Anas (Salesforce Developers) 
Hi Benoit,

Greetings to you!

Please refer to the below link which might help you further with the above issue.

http://amitsalesforce.blogspot.com/2018/07/einstein-bots-with-apex-class-how-to.html


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks and Regards,
Khan Anas
Benoit VAQUEZ 13Benoit VAQUEZ 13
This is exactly where I found the informations about the @InvocableVariable(Required=true). But I have absolutely no idea how to develop in Apex. I’m trying to learn by myself with all the informations that I can get, but unfortunately for me, this is not enough for me to understand how to create an account. Would you have an Idea? Thanks for your answer! Benoit V