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
Chetana MalakannavarChetana Malakannavar 

custom component to sharing notes to single group by clicking on create button

i have a requirement to share notes to single group ,
Custom component - Create a  button(share) by clicking on that share button notes will be sent to single Group.
Deepak DineshDeepak Dinesh
Hi chetana,
Good Day!

Do you need to Share the Standard Notes or the Custom Notes built on your org?
Chetana MalakannavarChetana Malakannavar
Custom Notes Build and click on Create It should share with Single Group
 
Deepak DineshDeepak Dinesh
Hi Chetana,
Good Day!

Thanks for your reply. can You please elaborate your requirements.
 Can you please help us with your comments in order to proceed further:

1.Does the Custom Notes is a child Object? If yes(is it a child Object in master- Detail or lookup relationship)
2.Does the Custom Notes needs to be shared as soon as it got created?
3.When the Create It Button will be used?
 
Chetana MalakannavarChetana Malakannavar
one created note we have to send it to only single group ?
 
Deepak DineshDeepak Dinesh
You can create sharing Rules on the Custom Notes Object  to Share the Records,
Else you can use apex Sharing, which might need a trigger on Custom Note Share Object to share it with respective public group which you needed.
Just sharing a Link for apex sharing : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htm

All the above mentioed two methods can be used on Custom Notes, only when the Custom Notes is not a child in Master - Detail relationship to Parent.
Please let me know if this solves your issue