How to get notified of a new lead in SalesForce? [closed] - salesforce

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
I want to get notified when a new lead is created in Salesforce. Is there something like webhook in Salesforce or some other way to achieve this?

Yes, plenty of options :)
For Salesforce as actor:
Workflow rule that would fire on insert of Lead and send you an email (or if it's for system integration - outbound message).
You can always write an "after insert" Apex trigger and have in it a callout to external system (SOAP and RESTful APIs are supported). Although you'll need a #future annotation because the triggers by default aren't supposed to send callouts (the database commit/rollback shouldn't depend on whether the external system has accepted the message or not).
For external system as actor:
Simply poll every once in a while for something like [SELECT Id FROM Lead WHERE CreatedDate > :lastTimeIhaveChecked]
Or there's fairly recent addition called Streaming API. Basically you define a PushTopic (query that interests you). Salesforce peeks at the current results returned by it and whenever the results change you'll get a notification. I haven't played with it yet but seems from the docs you can set event type to show "created" events only. This might be closest to a webhook.

I hate to self-promote but since some might fine this as a useful answer... I built a Webhook creator for Salesforce. It is open source: https://github.com/jamesward/salesforce-webhook-creator

This usually involves writing your own code to "subscribe to" events, construct a message and send it to an external endpoint. I have written quite extensively on this topic at: http://beachmonks.com/posts/integrations/salesforce/practical-guide.html. The source code is at: http://github.com/beachmonks/choir-salesforce.

Salesforce does support webhooks, but they are just called by a different name - Callouts.
Here's a link to the Developer documentation on the topic:
Invoking Callouts Using Apex
Here's a description of the feature taken directly from the link above:
An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response. Apex provides integration with Web services that utilize SOAP and WSDL, or HTTP services (RESTful services).
(emphasis added)
This is basically a webhook, commonly defined as "a user-defined callback over HTTP" 2

There is another way. Use RoundRobin logic to assign new incoming leads. Then create a new WF rule to send notification to new owners plus Admin or who ever else wanted to be notified.

Related

How could we deal with user's input in case no internet connection [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I think that we all deal comfortably with programming in case there is an Internet connection, especially if we are dealing with a server , But gentlemen, there are terrifying and disturbing results in the event that the user does not have an Internet connection , Imagine that there is a server connected to the Internet that interacts with the user's input , I often wonder what is the global applications use in such a case
I'm going to make it simple what is the problem I'm facing
i am building flutter app using dart and Firebase ..
well lets say user sent data to firestore Let's say it's a message for example
int count ;
FirebaseFirestore.instance.collection(widget.documentUid).doc(currentUser.uid).set({
"timestamp": DateTime.now(),
"name": currentUser.name,
"receiverUid": widget.documentUid,
"countM" : count++
});
well everything going to be perfect here If the user has an internet connection .
What I noticed is that the same process in the event that there is no internet connection is that the data sent will not wait for the connection again and therefore the process will be canceled .. This is a shame :( .. user will never accept like this app .. and it is only a example from many like count messages and delete messages and read messages which i developed them to be Responsive with the server how could i deal with this problem ..
and please no one tell me to chick internet state before , because this process it self will never make data to wait ,
Is there a data caching control?
Is there a library that handles this?
Is there a way to control the user's input in in case no Internet connection and make it wait until the connection again and execute without losing anything?
Is there anything important that I missed?
This process is not automated. You will have to handle offline/online cases yourself.
This package allows you to stream the connectivity status:
https://pub.dev/packages/connectivity_plus
You can use this with provider to rebuild UI whenever the stream changes.
Also, firebase itself has some level of caching, but I would recommend using an offline database like hive to sync with your online data incase internet connection is lost. You can also store the state of your navigator in the database when connection is lost and switch to the offline database. When connection is back, reload the state and continue. If only online data is to be shown, make a page which shows internet connectivity lost and switch the UI using the connectivity stream.
As for messages, don't use async on your firestore writes and it will automatically write to the database when internet connection is back on. But again, if the app was closed when internet was lost, this won't happen. To enable this, when internet goes offline, store the messages in the hive db and then when its back online or the user starts the app with internet, it will push the messages with the relevant timestamps.

GMB PubSub trigger notifications with delay or not trigger

I create topic.
Attach push-subscription with target to my server.
Set the email mybusiness-api-pubsub#system.gserviceaccount.com as an administrator.
Update notification settings with valid topic name and next notificationTypes:
GOOGLE_UPDATE
NEW_REVIEW
UPDATED_REVIEW
NEW_QUESTION
UPDATED_QUESTION
NEW_ANSWER
UPDATED_ANSWER
Did a test by manually posting a message and got the webhook successfully.
But, when I edit review reply - I recive part of events and with delay up to 30 minutes. Part of notifications don't receive.
If I try to write question or answer - I don't receive any events.
Question:
why events do not come for questions
why events are delayed
how to fix the previous two points
Concerning NEW_QUESTION, UPDATED_QUESTION, NEW_ANSWER, UPDATED_ANSWER, this is a bug (more see here Google My Business push notification is not sent for Question and Answers ).
Concerning review updates, we are also seeing such delays. My guess is this is due to Google's publishing/QA pipeline where changes are first checked if they meet the guidelines before they are published globally. You yourself may see your changes right after editing, but that does not mean that the whole world will.
There's nothing you can do about either case, unfortunately.

how to code a chat bot to use Alchemy data

Apologies for posting a basic question and not a detailed programming problem! Alas, IBM send people here for BlueMix support.
We're evaluating different AI Bots, and with Watson what we want to do, I think, is use Alchemy to analyze our web site, and have a chat bot that can answer random questions using general knowledge as well as what Alchemy has learnt from our site.
But, I can't find an example of how to hook up Alchemy to a chat bot. Could any of you point me in the right direction? I'll try to come back with more difficult questions another day!
I think, is use Alchemy to analyze our web site, and have a chat bot that can answer random questions using general knowledge as well as what Alchemy has learnt from our site.
There is two ways to do this.
You can create a controller that sits in front of Alchemy API + Dialog. The user talks to the controller and it sends the information to Dialog. Dialog can then request a lookup to the controller. This option is only useful if you don't expect Dialog to be maintained at a later date (or you are using earlier versions of WEA).
The better option is to use the FUNCTION call within Dialog. This will allow you to talk to a third party system and get information back to work with.
Once you have your data returned, you can use your tags or keywords within the returned data to activate a particular process flow using SEARCH.
One thing to be aware of is that depending on the answer you need to determine how to present it.
If your corpus is stored as conversational, then you can use the content as-is. If it is stored from documentation, then you should have Dialog talk as if it is reviewing the content and coming back with an answer. The latter should be visible in a way that distinguishes it as separate from the conversation.

Override UserId in Segment Analytics

Basic question here related to Segment analytics. Unfortunately I haven't been able to find a good answer after a fair bit of searching so turning here.
I have a couple of analytics events that need to be logged against multiple users, e.g. "Matched"
Is there a way to override the "userId" property on a event without calling identify again (which would override the user for all future events & thus risks race conditions or blocking on analytics)?
This is not possible with analytics.js. If you need to send events for another userId than the one you had called .identify() with, you should use a server side library to send that event.
All server side libraries will need a userId defined so it would be a good place to send that particular event.
Also Segment just got a brand new community to post these questions fyi.

will gatling actually perform the operation or will it check only the urls' response time?

I have a gatling test for an application that will answer a survey and upon answering this survey, the application will identify possible answers that may pose a risk and create what we call riskareas. These riskareas are normally created in the background as soon as the survey answering is finished. My question is I have a gatling test with ten users who will go and answer the survey and logout, I used recorder to record the test; now after these ten users are finished I do not see any riskareas being created in the application. Am I missing something--should the survey be really answered by gatling (like it does in selenium) user or is it just the urls that the gatling test will touch ?
I am new to gatling please help.
Gatling should be indistinguishable from a user in a web browser (or Selenium) as far as the server is concerned, so the end result should be exactly the same as if you'd gone through the process yourself. However, writing a Gatling script is a little more work than writing a Selenium script.
For performance reasons, Gatling operates at a lower level than Selenium. Gatling works with the actual data that is sent and received from the server (i.e, the actual GETs and POSTs sent to the server), rather than with user-level interactions (such as clicking links and filling forms).
The recorder will generally produce a relaitvely "dumb" script. It records the exact data that was sent to the server, and makes no attempt to account for things that may change from run to run. For example, the web application you are testing might have hidden form fields that contain session information, or the link addresses might contain a unique identifier or a session id.
This means that your script may not be doing what you think it's doing.
To debug the script, the first thing to do is to add checks on each of the requests, to validate that you are getting the response you expect (for example, check that when you submit page 1 of the survey, you are taken to page 2 - check for something that you'd only expect to find on page 2, like a specific question).
Once you know which requests are failing, look at what data was sent with the request, and try to figure out where it came from. You will probably find that there are session ids, view state, or similar, that must be extracted from the previous page.
It will help to enable request and response logging, as per the documentation.
To simplify testing of web apps, we wrote some helper functions to allow tests to be written in a more Selenium-like way. Once you understand what your application is doing, you may find that it simplifies scripting for you too. However, understanding why your current script doesn't work the way you expect should be your first step.

Resources