• Trudge
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
Is something out of date with my code?  This button has has perfectly fine since July 2017 and now suddenly my users are getting the "Invalid or unexpected token" error. 

Any help would be greatly appreciated!! 
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")} 

if("{!NPAR__c.Status__c}"=="45-Approved for Sample Requests"){ 

var Fields = "&RecordType=012C0000000GT5L"; 

Fields += "&accid={! NPAR__c.AccountId__c }"; 

Fields += "&CF00N1A000006aAj3_lkid={!NPAR__c.Id}"; 

Fields += "&CF00N1A000006aAj3={!NPAR__c.Name}"; 

Fields += "&00NC0000005JZJ5={!NPAR__c.Market_Segment__c}"; 

Fields += "&CurrencyIsoCode=USD - U.S. Dollar"; 

Fields += "&opp11=Ideation/Sample"; 

Fields += "&00N1A000006Ys6M=Recognizing the need for a purchase"; 

Fields += "&opp5=Existing Customer"; 

Fields += "&opp3={!NPAR__c.Account__c} - {!NPAR__c.NPAR_Chemical_Name__c} - <add application here>"; 

Fields += "&ent=Opportunity"; 

var URL = "/006/e?retURL=%2F{!NPAR__c.Id}" + Fields 

parent.frames.location.replace(URL); 

} 

else{ 
alert("Status needs to be '45-Approved for Sample Requests' to create an Opportunity"); 
}

 
  • November 06, 2018
  • Like
  • 0
Hi all,

I created a VF email template that displays a related list.  Does anybody know a way to hide the Action column?  The email is for closed cases and I don't want to confuse my users by offering a link to edit said closed case. 

Thanks!

User-added image
 
Hello,

I'm going through the process of building Lightning alternatives to all of our JavaScript buttons from Classic.  I'm creating a quick action with prepopulated values to replace a JS button that did the same.  The issue I'm running into is that the JS button also included an if/else alert that required the object to have a specific Status for the button to work.

Is there a way to either hide or disable a quick action based on the value of a Status field?  

Thanks for any help in advance!

-Chad
  • February 01, 2018
  • Like
  • 0
I have a trigger that updates a lookup field based on the value of a text field.  It's working great with the bulk uploads I'm doing, except when the bulk uploads reference the same record for lookup.  The lookup field (Customer Product Mix) populates on the first record, but fails to do so on subsequent records only when the same lookup record is referenced.

User-added image

Here is the code we're using, which I thought was bulkified since all other records populate just fine on a bulk upload.  Any help would be greatly appreciated.
 
trigger UpdateCustomerProductMix on Sales_Order_Line_Item__c (before insert, before update ){
 
    Map<String, Sales_Order_Line_Item__c> CPMToSOLIMap = new Map<String, Sales_Order_Line_Item__c>();

    for(Sales_Order_Line_Item__c soli:Trigger.new)
    {
        CPMToSOLIMap.put(soli.Customer_Product_Mix_UploadID_HIDDEN__c, soli);
 
    }
 
    List<Customer_Product_Mix__c> cpmLst = [SELECT ID, Name FROM Customer_Product_Mix__c where Name in :CPMToSOLIMap.keySet()];
 
    for(Customer_Product_Mix__c cpm : cpmLst){
        CPMToSOLIMap.get(cpm.Name). Customer_Product_Mix__c = cpm.ID;
    }
}



 
  • September 25, 2017
  • Like
  • 0
Hello,

Our company has a custom object, Call Reports, that functions similarly to Activities.  I'm looking replicate the View All button in the Activity History related list of the Account object.  I want to recreate the View Activity History screen that shows all activities for an account on one screen, except containing the info from our Call Reports custom object.

Has anyone created something like this before? 

Thanks!


 
  • February 03, 2017
  • Like
  • 0
Is something out of date with my code?  This button has has perfectly fine since July 2017 and now suddenly my users are getting the "Invalid or unexpected token" error. 

Any help would be greatly appreciated!! 
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")} 

if("{!NPAR__c.Status__c}"=="45-Approved for Sample Requests"){ 

var Fields = "&RecordType=012C0000000GT5L"; 

Fields += "&accid={! NPAR__c.AccountId__c }"; 

Fields += "&CF00N1A000006aAj3_lkid={!NPAR__c.Id}"; 

Fields += "&CF00N1A000006aAj3={!NPAR__c.Name}"; 

Fields += "&00NC0000005JZJ5={!NPAR__c.Market_Segment__c}"; 

Fields += "&CurrencyIsoCode=USD - U.S. Dollar"; 

Fields += "&opp11=Ideation/Sample"; 

Fields += "&00N1A000006Ys6M=Recognizing the need for a purchase"; 

Fields += "&opp5=Existing Customer"; 

Fields += "&opp3={!NPAR__c.Account__c} - {!NPAR__c.NPAR_Chemical_Name__c} - <add application here>"; 

Fields += "&ent=Opportunity"; 

var URL = "/006/e?retURL=%2F{!NPAR__c.Id}" + Fields 

parent.frames.location.replace(URL); 

} 

else{ 
alert("Status needs to be '45-Approved for Sample Requests' to create an Opportunity"); 
}

 
  • November 06, 2018
  • Like
  • 0
Hi all,

I created a VF email template that displays a related list.  Does anybody know a way to hide the Action column?  The email is for closed cases and I don't want to confuse my users by offering a link to edit said closed case. 

Thanks!

User-added image
 
I have a trigger that updates a lookup field based on the value of a text field.  It's working great with the bulk uploads I'm doing, except when the bulk uploads reference the same record for lookup.  The lookup field (Customer Product Mix) populates on the first record, but fails to do so on subsequent records only when the same lookup record is referenced.

User-added image

Here is the code we're using, which I thought was bulkified since all other records populate just fine on a bulk upload.  Any help would be greatly appreciated.
 
trigger UpdateCustomerProductMix on Sales_Order_Line_Item__c (before insert, before update ){
 
    Map<String, Sales_Order_Line_Item__c> CPMToSOLIMap = new Map<String, Sales_Order_Line_Item__c>();

    for(Sales_Order_Line_Item__c soli:Trigger.new)
    {
        CPMToSOLIMap.put(soli.Customer_Product_Mix_UploadID_HIDDEN__c, soli);
 
    }
 
    List<Customer_Product_Mix__c> cpmLst = [SELECT ID, Name FROM Customer_Product_Mix__c where Name in :CPMToSOLIMap.keySet()];
 
    for(Customer_Product_Mix__c cpm : cpmLst){
        CPMToSOLIMap.get(cpm.Name). Customer_Product_Mix__c = cpm.ID;
    }
}



 
  • September 25, 2017
  • Like
  • 0