+ Start a Discussion
Priya AakankshaPriya Aakanksha 

LWC--I want to create Pop up message(Toast) when record type is changing.

I want to create Pop up message when the record type is changing from pre-sales person to salesperson.
The pre-sales person will lose the record after changing the record type at that moment I want to pop up(Toast) message as "successfully record gone to sales" for the Pre-sales person.

Please suggest to me some idea From LWC or any other way
ShivankurShivankur (Salesforce Developers) 
Hi Priya,

Check out similar implementation done by another community members:

This would give you an idea how you can approach with your particular business requirement.

Hope above information helps. Please mark as Best Answer so that it can help others in future.

Suraj Tripathi 47Suraj Tripathi 47
Hi Priya,

1. Create a checkbox in the object of Record Type which you want to change.
2. Create a process builder which runs when record is update and check the condition ISCHANGED(RecordTypeId).
3. If RecordTypeId Changed, update the checkbox to true which you created at the first step.
4. Create a VFPage that shows you the toast when the checkbox is true.
5. Update that field to false on the VF page after showing the toast.
6. Use that VF Page in the detail page (Set size 0) to run JS Only from VF Page.

If you find your Solution then mark this as the best answer. 

Thank you!

Suraj Tripathi
Maharajan CMaharajan C
Hi Priya,

You can use the Platform Event , Process Builder or Trigger , LWC to acheive this.

1. Create the Platform Form Event in your org. Setup => Platform Event.

2. Create the LWC Component and subcripe the above platform event in JS using lightning/empApi.

3.  Create process builder or apex trigger to publish th platform event to subscribers.

4. Place the LWC component in record detail page. In metaxml add <target>lightning__RecordPage</target> Interface to make the component available in record page. In Html below lines are enough. Only you have to work on component JS to handle the platformevent.
the same kind of scenario is handled in below links:

The below links also will help you :