• kstites1
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 7
    Replies

When you click on the button, it now gives an error message that states:

Your search results are not optimized. If these results are not what you expected, please try again later.
Does anyone have any ideas how to fix this as we have changed nothing, it just started happening.
This doesn't recognize the close date filter.  Can someone help?

 

IF( RecordTypeId ="0123000000004s7" ,null,IF(AND( Amount <>0,CloseDate > (2009-03-31)),".6",JP_Points_1__c + JP_Points_2__c + JP_Points_3__c))

 


 

 

 

<html> <head> <script src="/soap/ajax/11.1/connection.js" type="text/javascript"></script> <title>Executed Contract Received</title> <script> function setupPage() { var conn = sforce.connection; var today = new Date(); contract.AccountId = "{!Opportunity.AccountId}"); contract.RecordTypeId = "012300000000ojo"; contract.Initial_Term_months__c = "36"; contract.Content_Rights_Alteration__c = "Standard"; contract.Content_Rights_Assoc_WS__c = "Standard"; contract.Content_Rights_Term__c = "Standard"; contract.Content_Rights_Use_other_than_Assoc_WS__c = "Standard"; contract.Contract_Expiration_Date__c = "Measured from Launch Date"; contract.Data_Use_Restrictions__c = "Standard"; contract.Pricing_Parity__c = "Standard"; contract.Content_Parity__c = "Standard"; contract.Selection_Parity__c = "Standard"; contract.Tax_Collection_Offered__c = "None"; contract.Insurance_Terms_Standard_as_per_Form__c = "Standard"; contract.A_Z_Guarantee__c = "Standard"; contract.Name = "MAPA"; contract.Agreement_Type__c = "JP M@ 1.0 Gold"; contract.Assigned_Attorney__c = "Kayoko Kurose"; contract.Executed_Agreement_Received__c = "Yes"; contract.Seller_Early_Termination_Rights__c = "No"; contract.Agreement_Party_Country__c = "Japan"; contract.Amazon_Sites__c = "Amazon.co.jp"; contract.Content_Rights_Territory_Channel__c = "Japan"; contract.Effective_Date__c = "Today"; var saveContract= conn.create([contract]); var contractid=saveContract[0].id; var shortid=contractid.substring(0, 15); var result = sforce.connection.create([contract]); var contractid = result[0].id; var contracttype="M@ JP Agreement"; var oppid="{!Opportunity.Id}"; var contractlink = new sforce.SObject("Contract2Opp__c"); contractlink.Contract__c = contractid; contractlink.Opportunity__c = oppid; contractlink.Contract_Type__c = contracttype; var result = sforce.connection.create([contractlink]); var myObj = new sforce.SObject("Opportunity"); myObj.id = oppid; myObj.Contract_ID__c = shortid; myObj.Locale__c = "JP"; var saveResults = conn.update([myObj]); //render the generated html string var retUrl = "https://na1.salesforce.com/" + contractid; window.parent.parent.location.href = retUrl; } </script> </head> <body leftmargin="20" bgcolor=#000099 onload="setupPage()"> <H2><BR><BR><BR><font color = #FFFFFF>Creating New Contract...</font></H2> <div id="output"> </div> </body> </html>

 

This is broken can anyone help me?
does anyone know how I could mass submit approvals?

This s-control doesn't work and I can't figure out why.  You can click on the custom link and it just takes you to a white screen and then does nothing.  The opportunity doesn't get updated either.

 

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Executed Contract Received</title>
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
<script>
function initPage() {
//Initialize the connection to salesforce.com by setting the sessionid and the
//soap endpoint in the init call
sforceClient.setLoginUrl("https://www.salesforce.com/services/Soap/u/7.0");
sforceClient.registerInitCallback(startUp);
sforceClient.init("{!API.Session_ID}", "{!API.Partner_Server_URL_70}", false);
}

function startUp() {

var Type="{!Opportunity.Type}";
var Status="{!Opportunity.Export_Status__c}";
var Profile="{!$User.ProfileId}";
//if(Profile = "00e30000000g5na"){
// var retUrl = "https://na1.salesforce.com/" + "{!Opportunity.Id}";
// window.parent.parent.location.href = retUrl;
// alert("You do not have the proper permissions to mark this opportunity as received!");


if ((Type == "Merchants@ Platinum") || (Type == "Merchants@ Gold") || (Type == "Merchants@ Upgrade")) {
if (Status == "Exported"){
var retUrl = "https://na1.salesforce.com/" + "{!Opportunity.Id}";
window.parent.parent.location.href = retUrl;
alert("This opportunity has already been exported!");
}
else{

//set as Ready for export
var myObj = new Sforce.Dynabean("Opportunity");
myObj.set("id", "{!Opportunity.Id}");
myObj.set("Export_Status__c", "Ready");
var saveResults = sforceClient.Update([myObj]);
var retUrl = "https://na1.salesforce.com/{!Opportunity.Id}";
window.parent.parent.location.href = retUrl;
}
}
else if ((Type == "Amendment") || (Type == "Platinum Renewal") || (Type=="Gold Renewal")) {
if ("{!Opportunity.Master_Opportunity__c}" == "") {
var retUrl = "https://na1.salesforce.com/" + "{!Opportunity.Id}";
window.parent.parent.location.href = retUrl;
alert("This opportunity is missing the Master Opportunity field! Please refer to Sales Ops.");
}
else {
//create remedy ticket
var holdback = "%0D%0AReturn Holdback: {!Opportunity.ReturnHoldback__c}%0D%0A";

//get rev shares from contract
var qr = sforceClient.Query("Select Category__c, Product_Rev_Share__c, Gift_Wrap_Rev_Share__c, Shipping_Rev_Share__c from Revenue_Share__c Where Contract__c = '{!Opportunity.Contract_ID__c}' ");
alert(qr);
var fees = "Category+++++++++ Product | Shipping | Giftwrap%0D%0A-----------------------------------------------------------------------%0D%0A";
for (var i=0;i<qr.records.length;i++) {
var revshare = qr.records[i];
var category = revshare.get("Category__c");
var product = revshare.get("Product_Rev_Share__c");
var shipping = revshare.get("Shipping_Rev_Share__c");
var giftwrap = revshare.get("Gift_Wrap_Rev_Share__c");
var fees = fees + category + "++++++" + product + " | " + shipping + " | " + giftwrap + "%0D%0A";
}

//get contract info
var qr = sforceClient.Query("Select Effective_Date__c, SpecialTerms,Description from Contract Where ID = '{!Opportunity.Contract_ID__c}' ");
alert (qr);
for (var i=0;i<qr.records.length;i++) {
var contract = qr.records[i];
var effective = "Effective Date: " +contract.get("Effective_Date__c") + "%0D%0A";
var terms = "Special Terms: " + contract.get("SpecialTerms") + "%0D%0A";
var descr = "Description:" + contract.get("Description") + "%0D%0A";
var descrclean = descr.replace("&", "and");
}

//find all affected storefronts
var masteropp = "{!Opportunity.Master_Opportunity__c}";
var qr = sforceClient.Query("Select Production_Customer_ID__c, Name from Opportunity Where ID = '{!Opportunity.Master_Opportunity__c}'");
alert(qr);
var storefronts = "%0D%0A%0D%0AAffected Storefronts:%0D%0A%0D%0AProd Cust ID +++++ Opportunity Name%0D%0A-------------------------------------------------------------------------------------------------%0D%0A";
for (var i=0;i<qr.records.length;i++) {
var storefront = qr.records[i];
var prodid = storefront.get("Production_Customer_ID__c");
var name = storefront.get("Name");
var storefronts = storefronts + prodid + "+++++" + name + "%0D%0A";
}

//document.write(qr);
// document.write("%0D%0AEffective Date - " + effective+ "%0D%0A%0D%0ASpecial Terms - " + terms + "%0D%0A");
// document.write(storefronts);

//get original opp
//get names and prod ids from all related opps %0D%0A


//document.write("This is where we would create a remedy ticket");

if (Type=="Tax Amendment"){
var retUrl = "https://tt.amazon.com/new?impact=4&category=Website&type=IWS3&item=Tax+Enablement&assigned_group=IWS-Tax-Manual&assigned_individual=tax-engine-bz&problem_location=&case_type=Trouble+Ticket&short_description={!Opportunity.Type}+Request+for%3A+{!Opportunity.Account}&details={!Opportunity.Type}+Request+for%3A+{!Opportunity.Account}&240000007=" + fees + holdback + effective + terms +descrclean + storefronts;&cc_list=&vendor_id=&quantity=&purchase_order_id=&asin=&isd=&upc=&title=&binding=&stock_number=&ship_origin=&invoice_number=&physical_location=&tracking_number=&picture_file_imdex_location=&bol_number=;
}
else
{
var retUrl = "https://tt.amazon.com/new?impact=4&category=Partners&type=Merchant+Engagement&item=Fee+Changes&assigned_group=Merchant+Engagement&assigned_individual=lmirth&problem_location=&case_type=Trouble+Ticket&short_description={!Opportunity.Type}+Request+for%3A+{!Opportunity.Account}&details={!Opportunity.Type}+Request+for%3A+{!Opportunity.Account}&240000007=" + fees + holdback + effective + terms +descrclean + storefronts;&cc_list=&vendor_id=&quantity=&purchase_order_id=&asin=&isd=&upc=&title=&binding=&stock_number=&ship_origin=&invoice_number=&physical_location=&tracking_number=&picture_file_imdex_location=&bol_number=;
}
var myObj = new Sforce.Dynabean("Opportunity");
myObj.set("id", "{!Opportunity.Id}");
myObj.set("Export_Status__c", "Remedy");
var saveResults = sforceClient.Update([myObj]);

window.location.href = retUrl;
}
}


else {
//warn that type is not correct
var retUrl = "https://na1.salesforce.com/" + "{!Opportunity.Id}";
window.parent.parent.location.href = retUrl;
alert("This opportunity has an unrecognized Type!");
}

}

</script>
</head>
<body onload="initPage()">
</body>
</html>

This doesn't recognize the close date filter.  Can someone help?

 

IF( RecordTypeId ="0123000000004s7" ,null,IF(AND( Amount <>0,CloseDate > (2009-03-31)),".6",JP_Points_1__c + JP_Points_2__c + JP_Points_3__c))

 


 

 

 

<html> <head> <script src="/soap/ajax/11.1/connection.js" type="text/javascript"></script> <title>Executed Contract Received</title> <script> function setupPage() { var conn = sforce.connection; var today = new Date(); contract.AccountId = "{!Opportunity.AccountId}"); contract.RecordTypeId = "012300000000ojo"; contract.Initial_Term_months__c = "36"; contract.Content_Rights_Alteration__c = "Standard"; contract.Content_Rights_Assoc_WS__c = "Standard"; contract.Content_Rights_Term__c = "Standard"; contract.Content_Rights_Use_other_than_Assoc_WS__c = "Standard"; contract.Contract_Expiration_Date__c = "Measured from Launch Date"; contract.Data_Use_Restrictions__c = "Standard"; contract.Pricing_Parity__c = "Standard"; contract.Content_Parity__c = "Standard"; contract.Selection_Parity__c = "Standard"; contract.Tax_Collection_Offered__c = "None"; contract.Insurance_Terms_Standard_as_per_Form__c = "Standard"; contract.A_Z_Guarantee__c = "Standard"; contract.Name = "MAPA"; contract.Agreement_Type__c = "JP M@ 1.0 Gold"; contract.Assigned_Attorney__c = "Kayoko Kurose"; contract.Executed_Agreement_Received__c = "Yes"; contract.Seller_Early_Termination_Rights__c = "No"; contract.Agreement_Party_Country__c = "Japan"; contract.Amazon_Sites__c = "Amazon.co.jp"; contract.Content_Rights_Territory_Channel__c = "Japan"; contract.Effective_Date__c = "Today"; var saveContract= conn.create([contract]); var contractid=saveContract[0].id; var shortid=contractid.substring(0, 15); var result = sforce.connection.create([contract]); var contractid = result[0].id; var contracttype="M@ JP Agreement"; var oppid="{!Opportunity.Id}"; var contractlink = new sforce.SObject("Contract2Opp__c"); contractlink.Contract__c = contractid; contractlink.Opportunity__c = oppid; contractlink.Contract_Type__c = contracttype; var result = sforce.connection.create([contractlink]); var myObj = new sforce.SObject("Opportunity"); myObj.id = oppid; myObj.Contract_ID__c = shortid; myObj.Locale__c = "JP"; var saveResults = conn.update([myObj]); //render the generated html string var retUrl = "https://na1.salesforce.com/" + contractid; window.parent.parent.location.href = retUrl; } </script> </head> <body leftmargin="20" bgcolor=#000099 onload="setupPage()"> <H2><BR><BR><BR><font color = #FFFFFF>Creating New Contract...</font></H2> <div id="output"> </div> </body> </html>

 

This is broken can anyone help me?
does anyone know how I could mass submit approvals?

This s-control doesn't work and I can't figure out why.  You can click on the custom link and it just takes you to a white screen and then does nothing.  The opportunity doesn't get updated either.

 

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Executed Contract Received</title>
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
<script>
function initPage() {
//Initialize the connection to salesforce.com by setting the sessionid and the
//soap endpoint in the init call
sforceClient.setLoginUrl("https://www.salesforce.com/services/Soap/u/7.0");
sforceClient.registerInitCallback(startUp);
sforceClient.init("{!API.Session_ID}", "{!API.Partner_Server_URL_70}", false);
}

function startUp() {

var Type="{!Opportunity.Type}";
var Status="{!Opportunity.Export_Status__c}";
var Profile="{!$User.ProfileId}";
//if(Profile = "00e30000000g5na"){
// var retUrl = "https://na1.salesforce.com/" + "{!Opportunity.Id}";
// window.parent.parent.location.href = retUrl;
// alert("You do not have the proper permissions to mark this opportunity as received!");


if ((Type == "Merchants@ Platinum") || (Type == "Merchants@ Gold") || (Type == "Merchants@ Upgrade")) {
if (Status == "Exported"){
var retUrl = "https://na1.salesforce.com/" + "{!Opportunity.Id}";
window.parent.parent.location.href = retUrl;
alert("This opportunity has already been exported!");
}
else{

//set as Ready for export
var myObj = new Sforce.Dynabean("Opportunity");
myObj.set("id", "{!Opportunity.Id}");
myObj.set("Export_Status__c", "Ready");
var saveResults = sforceClient.Update([myObj]);
var retUrl = "https://na1.salesforce.com/{!Opportunity.Id}";
window.parent.parent.location.href = retUrl;
}
}
else if ((Type == "Amendment") || (Type == "Platinum Renewal") || (Type=="Gold Renewal")) {
if ("{!Opportunity.Master_Opportunity__c}" == "") {
var retUrl = "https://na1.salesforce.com/" + "{!Opportunity.Id}";
window.parent.parent.location.href = retUrl;
alert("This opportunity is missing the Master Opportunity field! Please refer to Sales Ops.");
}
else {
//create remedy ticket
var holdback = "%0D%0AReturn Holdback: {!Opportunity.ReturnHoldback__c}%0D%0A";

//get rev shares from contract
var qr = sforceClient.Query("Select Category__c, Product_Rev_Share__c, Gift_Wrap_Rev_Share__c, Shipping_Rev_Share__c from Revenue_Share__c Where Contract__c = '{!Opportunity.Contract_ID__c}' ");
alert(qr);
var fees = "Category+++++++++ Product | Shipping | Giftwrap%0D%0A-----------------------------------------------------------------------%0D%0A";
for (var i=0;i<qr.records.length;i++) {
var revshare = qr.records[i];
var category = revshare.get("Category__c");
var product = revshare.get("Product_Rev_Share__c");
var shipping = revshare.get("Shipping_Rev_Share__c");
var giftwrap = revshare.get("Gift_Wrap_Rev_Share__c");
var fees = fees + category + "++++++" + product + " | " + shipping + " | " + giftwrap + "%0D%0A";
}

//get contract info
var qr = sforceClient.Query("Select Effective_Date__c, SpecialTerms,Description from Contract Where ID = '{!Opportunity.Contract_ID__c}' ");
alert (qr);
for (var i=0;i<qr.records.length;i++) {
var contract = qr.records[i];
var effective = "Effective Date: " +contract.get("Effective_Date__c") + "%0D%0A";
var terms = "Special Terms: " + contract.get("SpecialTerms") + "%0D%0A";
var descr = "Description:" + contract.get("Description") + "%0D%0A";
var descrclean = descr.replace("&", "and");
}

//find all affected storefronts
var masteropp = "{!Opportunity.Master_Opportunity__c}";
var qr = sforceClient.Query("Select Production_Customer_ID__c, Name from Opportunity Where ID = '{!Opportunity.Master_Opportunity__c}'");
alert(qr);
var storefronts = "%0D%0A%0D%0AAffected Storefronts:%0D%0A%0D%0AProd Cust ID +++++ Opportunity Name%0D%0A-------------------------------------------------------------------------------------------------%0D%0A";
for (var i=0;i<qr.records.length;i++) {
var storefront = qr.records[i];
var prodid = storefront.get("Production_Customer_ID__c");
var name = storefront.get("Name");
var storefronts = storefronts + prodid + "+++++" + name + "%0D%0A";
}

//document.write(qr);
// document.write("%0D%0AEffective Date - " + effective+ "%0D%0A%0D%0ASpecial Terms - " + terms + "%0D%0A");
// document.write(storefronts);

//get original opp
//get names and prod ids from all related opps %0D%0A


//document.write("This is where we would create a remedy ticket");

if (Type=="Tax Amendment"){
var retUrl = "https://tt.amazon.com/new?impact=4&category=Website&type=IWS3&item=Tax+Enablement&assigned_group=IWS-Tax-Manual&assigned_individual=tax-engine-bz&problem_location=&case_type=Trouble+Ticket&short_description={!Opportunity.Type}+Request+for%3A+{!Opportunity.Account}&details={!Opportunity.Type}+Request+for%3A+{!Opportunity.Account}&240000007=" + fees + holdback + effective + terms +descrclean + storefronts;&cc_list=&vendor_id=&quantity=&purchase_order_id=&asin=&isd=&upc=&title=&binding=&stock_number=&ship_origin=&invoice_number=&physical_location=&tracking_number=&picture_file_imdex_location=&bol_number=;
}
else
{
var retUrl = "https://tt.amazon.com/new?impact=4&category=Partners&type=Merchant+Engagement&item=Fee+Changes&assigned_group=Merchant+Engagement&assigned_individual=lmirth&problem_location=&case_type=Trouble+Ticket&short_description={!Opportunity.Type}+Request+for%3A+{!Opportunity.Account}&details={!Opportunity.Type}+Request+for%3A+{!Opportunity.Account}&240000007=" + fees + holdback + effective + terms +descrclean + storefronts;&cc_list=&vendor_id=&quantity=&purchase_order_id=&asin=&isd=&upc=&title=&binding=&stock_number=&ship_origin=&invoice_number=&physical_location=&tracking_number=&picture_file_imdex_location=&bol_number=;
}
var myObj = new Sforce.Dynabean("Opportunity");
myObj.set("id", "{!Opportunity.Id}");
myObj.set("Export_Status__c", "Remedy");
var saveResults = sforceClient.Update([myObj]);

window.location.href = retUrl;
}
}


else {
//warn that type is not correct
var retUrl = "https://na1.salesforce.com/" + "{!Opportunity.Id}";
window.parent.parent.location.href = retUrl;
alert("This opportunity has an unrecognized Type!");
}

}

</script>
</head>
<body onload="initPage()">
</body>
</html>

I am a bit of a beginner at formulas, so hopefully one of you will think this is easy, and be able to help. :-)

 

Customer requirement:

 

Create a formula field that displays the Week Number (as Week 1, Week 2, etc), based on the Date entered on a particular record (same object).

 

Ex: 01/01/09 - 01/04/09 would return a value of "Week 1"  

01/05/09 - 01/11/09 = Week 2

01/12/09 - 01/18/09 = Week 3

 

and so on.....

 

Is using the CASE function the way to go, and if so, what's the shortest way to create this formula?

 

Thank you in advance!

S

 

  • April 20, 2009
  • Like
  • 0
Is there a bug in processSubmitRequest?  I have a process that requires the  approver to be manually chosen but when I run the processSubmitRequest on this I get an error saying a required field is missing.  If I try to set the nextOwnerId it doesn't work either.  Is this a bug or if manual requests are not supported is there a graceful way to determine this and report it back to users instead of displaying a message implying a field is missing?  Here is the syntax:
 
Code:
var request = new sforce.ProcessSubmitRequest();
request.objectId = id;
//request.nextOwnerId = approverIds;
//request.comment = "Test Process Submit Request";

var requests = new Array(1);
requests[0] = request;

var results = sforce.connection.process(requests);