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
Nada El Ouadrhiri 14Nada El Ouadrhiri 14 

update a record via a custom component in community

Hello,

In the community page layout, I created a custom component on the product page layout. What I need to do now is when clicking on this custom component (a button), I want to send an email to the admin and to update the record of the product. Is this possible? Thank you.

 
Best Answer chosen by Nada El Ouadrhiri 14
GhanshyamChoudhariGhanshyamChoudhari
here is sample app i created https://github.com/soql101/EmailSendComponent for email send. for record update, you can write soql and update that soql with new value.

 

All Answers

GhanshyamChoudhariGhanshyamChoudhari
yes it is possible 
Nada El Ouadrhiri 14Nada El Ouadrhiri 14
Good to know!! Can you let me know how you do it :)
GhanshyamChoudhariGhanshyamChoudhari
here is sample app i created https://github.com/soql101/EmailSendComponent for email send. for record update, you can write soql and update that soql with new value.

 
This was selected as the best answer
Nada El Ouadrhiri 14Nada El Ouadrhiri 14
Thank you for sharing this GhanshyamChoudhari. For the record update, I couldn't figure out how to do it, as soon as I define a "var xxx = new sforce.SObject('Product2__c');" in the controller, the email is not sent for some reason. Is it the right way to do it? I don't know where to define my variable. Thanks