-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
4Questions
-
4Replies
Sending emails from trigger or apex class
Any ideas?
Basically what I'm trying to do is if an Opportunity Product Sales Price is changed I would like to notify the Opportunity->Account->Contacts via email.
I've also looked at the workflow email notification/etc features but I can't find a way to have the work flow initiated from Opportunity Product but send the email to the Opportunity->Account->Contacts. I also do not see a way to specify that I only want the email sent when the specific sales price field is updated, instead of anytime the field is updated.
Thanks
-
- AC1
- August 06, 2008
- Like
- 0
- Continue reading or reply
Formula Error
Can someone help? I have created the following formula and I keep getting Syntax errors. Missing ")"
IF(
ISPICKVAL(FOB_Point__c ,"Delivered"),
(((( UnitPrice - ( Del_Unit_Cost__c + CUPS__c )+( Freight_Amount__c / Quantity ))/ UnitPrice ))),
(UnitPrice - (Del_Unit_Cost__c + CUPS__c))/UnitPrice
Thank you!
IF(
ISPICKVAL(FOB_Point__c ,"Delivered"),
(((( UnitPrice - ( Del_Unit_Cost__c + CUPS__c )+( Freight_Amount__c / Quantity ))/ UnitPrice ))),
(UnitPrice - (Del_Unit_Cost__c + CUPS__c))/UnitPrice
Thank you!
-
- AC1
- October 11, 2007
- Like
- 0
- Continue reading or reply
Financial Formula Error
Can someone help? I have created the following formula and I keep getting Syntax errors. Missing ")"
IF(
ISPICKVAL(FOB_Point__c ,"Delivered"),
(((( UnitPrice - ( Del_Unit_Cost__c + CUPS__c )+( Freight_Amount__c / Quantity ))/ UnitPrice ))),
(UnitPrice - (Del_Unit_Cost__c + CUPS__c))/UnitPrice
Thank you!
IF(
ISPICKVAL(FOB_Point__c ,"Delivered"),
(((( UnitPrice - ( Del_Unit_Cost__c + CUPS__c )+( Freight_Amount__c / Quantity ))/ UnitPrice ))),
(UnitPrice - (Del_Unit_Cost__c + CUPS__c))/UnitPrice
Thank you!
-
- AC1
- October 11, 2007
- Like
- 0
- Continue reading or reply
Auto-populate fields with S-Control
Help.....
If someone out there has a sample S-control I could use, I would like to auto-populate the following. On the oppty products section; I would like to pull in a value from a custom field within the products object, when the product is added to an oppty. Can this be done with an S-Control?
Any help is appreciated.
Thanks, AC-
- AC1
- October 07, 2007
- Like
- 0
- Continue reading or reply
Financial Formula Error
Can someone help? I have created the following formula and I keep getting Syntax errors. Missing ")"
IF(
ISPICKVAL(FOB_Point__c ,"Delivered"),
(((( UnitPrice - ( Del_Unit_Cost__c + CUPS__c )+( Freight_Amount__c / Quantity ))/ UnitPrice ))),
(UnitPrice - (Del_Unit_Cost__c + CUPS__c))/UnitPrice
Thank you!
IF(
ISPICKVAL(FOB_Point__c ,"Delivered"),
(((( UnitPrice - ( Del_Unit_Cost__c + CUPS__c )+( Freight_Amount__c / Quantity ))/ UnitPrice ))),
(UnitPrice - (Del_Unit_Cost__c + CUPS__c))/UnitPrice
Thank you!
- AC1
- October 11, 2007
- Like
- 0
- Continue reading or reply
Auto-populate fields with S-Control
Help.....
If someone out there has a sample S-control I could use, I would like to auto-populate the following. On the oppty products section; I would like to pull in a value from a custom field within the products object, when the product is added to an oppty. Can this be done with an S-Control?
Any help is appreciated.
Thanks, AC- AC1
- October 07, 2007
- Like
- 0
- Continue reading or reply
Hands-On: S-Controls and Buttons Session Help
Hi:
Thank you for attending one of my hands-on sessions on S-Controls.
I hope Dreamforce was a great experience for you.
I have set up this discussion for class members to post and answer questions you might have after Dreamforce.
Please add your question under this post and a class participant or myself will answer you.
I will monitor this post for 2 weeks after Dreamforce.
Thank you
Here is the source:
Code:
Thank you for attending one of my hands-on sessions on S-Controls.
I hope Dreamforce was a great experience for you.
I have set up this discussion for class members to post and answer questions you might have after Dreamforce.
Please add your question under this post and a class participant or myself will answer you.
I will monitor this post for 2 weeks after Dreamforce.
Thank you
Here is the source:
Code:
<html> <head> <!-- Answers this is the working scontrol for class --> <!-- author Michael Fullmore Salesforce.com --> <!-- version .1 8/21/2007 --> <!-- version 1.0 8/28/2007 --> <!-- addes the salesforce.com css file (look and feel) --> <link href="/dCSS/Theme2/default/common.css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" type="text/css" /> <!-- adding my own styles to this scontrol --> <style type="text/css"> .edit{display:none;} p{width:70%} </style> <!-- these two script tags add the salesforce.com AJAX API and are required to "talk to salesforce" --> <script type="text/javascript" src="/js/functions.js"></script> <script src="/soap/ajax/10.0/connection.js"></script> <!-- this script tag starts our code, you can have as many script tags in your file as needed. we only need 1 for this demo --> <script type="text/javascript"> //create the oppty object var opp = {id:"{!Opportunity.Id}", stage:"{!Opportunity.StageName}", nextStep:"{!Opportunity.NextStep}", description:"{!Opportunity.Description}"}; //create an array of stages that we want to lock var lockedStages = ["Perception Analysis","Proposal/Price Quote","Negotiation/Review"," Closed Won","Closed Lost"]; //checking to see if the user has access or not function doesUserHaveAccess(){ //this is the first AJAX call, nice! Bonus points, what is it doing— var user = sforce.connection.getUserInfo(); //get the profile name var profileNameQuery = sforce.connection.query("select Name from Profile where Id = '" + user.profileId + "'"); var profileNameRecords = profileNameQuery.getArray("records"); var profileName = profileNameRecords[0].Name; //next check if the user is locked out of oppty if(profileName == 'System Administrator'){ //adding TEST to the system administrator string to test with sys admin //using URLFOR to "skip over the override the second time around. window.parent.location.href = "{!URLFOR($Action.Opportunity.Edit, Opportunity.Id,[retURL=URLFOR($Action.Opportunity.View, Opportunity.Id)],true)}"; }else{ //if the user is not in the admin user group then we show the edit page for them. This page just gives us access to 3 fields on the opportunity showPage(); } } function showPage(){ document.getElementById('edit').style.display = 'block'; document.getElementById('next').value = opp.nextStep; document.getElementById('des').value = opp.description; } //custom edit screen button actions function saveEdit(){ //create an opportunity object var o = new sforce.SObject("Opportunity"); //fill the opportunity SObject with data o.Id = opp.id; o.NextStep = document.getElementById('next').value; o.Description = document.getElementById('des').value; //save the SObject to salesforce, using the AJAX Tool Kit var saveO = sforce.connection.update([o]); if(saveO[0].getBoolean("success") == false){ error(saveO[0]); } //go back to the opportunity window.parent.location.href = "/" + opp.id; } function cancelEdit(){ window.parent.location.href = "/" + opp.id; } //help error function function error(e){ alert("There is an error\n\n" + e); } //where the page starts it's loading function initPage(){ var isLocked = false; //this function starts the process, every scontrol needs to start somewhere, and I like using initPage //first thing we need to do is check to see what stage the oppty is in. for(i=0; i<lockedStages.length; i++){ if(opp.stage == lockedStages[i]){ //if it's in a "locked" stage then we go and see if the user has access. isLocked = true; break; } } if(isLocked){ doesUserHaveAccess(); }else{ //if the oppty is not is the "locked" stages then put up the normal edit page window.parent.location.href = "{!URLFOR($Action.Opportunity.Edit, Opportunity.Id,[retURL=URLFOR($Action.Opportunity.View, Opportunity.Id)],true)}"; } } /**************************************************************************************************** **what's next– * **Try adding a stage advancer, something that puts the opportunity in the next stage for the reps * **Add your own fields * **Display read only fields * ****************************************************************************************************/ </script> </head> <body onload="initPage();" class="opportunity overviewPage"> <div id="edit" class="edit"> <div class=bPageTitle> <div class="ptBody secondaryPalette"> <div class="content"> <img class="pageTitleIcon" title="Opportunity" alt="Opportunity" src="/s.gif"/> <h1 class="pageType">Opportunity Edit (Custom)<span class="titleSeparatingColon">:</span></h1> <h2 class="pageDescription">{!Opportunity.Name}</h2> <br> </div> </div> </div> <div class="bPageBlock secondaryPalette"> <div class="pbBody"> <div class="pbSubsection"> <p>This Opportunity is in a stage that is locked by your company. The only fields that you have access to are Next Steps and Description. If you need to make edits to other fields please contact your Administrator. <br>Thank you.</p> <label for="next">Next Step: </label> <input type="text" id="next" size="80" /> <br><br> <label for="des">Description:</label> <textarea id="des" cols="60" rows="5"></textarea> <br><br> <input type="button" id="btn1" value="Save" class="btn" onclick="saveEdit();" /> <input type="button" id="btn2" value="Cancel" class="btn" onclick="cancelEdit();" /> </div> </div> </div> </div> </body> </html>
Message Edited by mikef on 09-21-2007 11:59 AM
- mikef
- September 15, 2007
- Like
- 0
- Continue reading or reply