• EllenH
  • NEWBIE
  • 0 Points
  • Member since 2011

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

We have a validation rule on our opportunity products, that if a user selects an subscription based product, they must choose and edition.

 

When we create the quotes, or try to add a line item to the quote for it to sync back to the opp, the validation rule prevents the quote object from working correctly.

 

Any thoughts on how to get around this?  Since Opp products do not have record types, I cannot updat the rule to symple include or exclude rec types.

 

Thanks in advance for any suggestions.

  • October 20, 2013
  • Like
  • 0

Looked and looked online, in communites and through my cookbook and cannot seem to figure it out - so hoping the collective community can help find the error.

 

I have a custom button that is calling an apex class.  I get the dreaded "fault code....etc.  No operation available for request, etc...  please check the WSDL for the service."

 

My understanding of this error is that the apex code being called is not declared as a webservice.  However in my case it is, but with @future.  

 

Here is the code in the button:

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}

if (
 (
// System Administrator
 ("{!$User.ProfileId}" == "00e30000000e1mu") ||
// Order Management
 ("{!$User.ProfileId}" == "00e30000000i5Km")
 ) && "{!Opportunity.Probability}" >= .75 ) {

var oppID = '{!Opportunity.Id}';
var man = true;

sforce.apex.execute("oppClose","createCase",{oppID: oppID, man: true});

location.reload();

}

else

{
alert("Only Authorized Users can manually trigger the creation of all necessary //Cases for Implementation and only from a Closed Won Opportunity");
}

 


Here is the snippet of code from the apex class that is being called where the webservice is defined:

 

global class OppClose {
    public static String koAmericanPrnCaseId;
    public static String koBeehiveCaseId;
    public static String koHarcourtCaseId;
    public static String koJohnsonCaseId;
    public static String koRidgwaysCaseId;
    public static String koMondoCaseId;
    public static ID cntct;
    public static Integer count;
    public static ID impCase;
    public static ID pbeID;
    @future
    webService static void createCase(ID oppID, Boolean man){
      
       List<Opportunity> oppList =
        [select o.AssdImpCase__c, .....  etc.

 

 

I am writing a trigger to insert an additionlal Line Item if a specific line item is present.  The code is below, but I keep getting errors that "x" field name is not a field on the SObject Opportunity Line Item.

 

Code is listed below...  Thanks for any review, advice and/or recommendations.

 

trigger InsertRigbyForHarcourt on OpportunityLineItem (after insert) {
    for (Integer i=0; i < Trigger.new.size(); i++)
    {
    
    OpportunityLineItem nw = Trigger.new[i];
    Boolean man = false;  
    PricebookEntry pbe = [select p.Product2Id from PricebookEntry p where p.Id = :nw.PricebookEntryId];
    
    if ( pbe.Product2Id == '01t80000002ZQH6')      //*** ID of product to check for
    {
       OppProdList.add (new OpportunityLineItem
            ( Name = 'Kit (68 Book Set)',
            ProductCode = '3232'));
            OpportunityLineItem__c = nw.Id,
            Quantity = 1,
            UnitPrice = nw.UnitPrice));

        insert OpportunityLineItem;
      }
  }     
 }     

 

 

  • September 19, 2012
  • Like
  • 0

Hi There,

 

Looking for a little assistance on this trigger.

 

Essentially I am looking to update a hidden field on an opportunity with a line item name.  I am searching for a specific name as the hidden field will then be used in a VF email template.

 

However, I am not exactly sure how to call the product name within the trigger.  I have tried Product2, Name, etc. but I get a compile error message that the "Product2" or "Name" (whatever I seem to choose) is not a column on the entity "OpportunityLineItem".  Do I need to use a name from the pricebook?

 

Thanks to anyone in the community that can provide some assistance.

 

Here is my trigger code:

 

trigger CECProductUpdate on Opportunity (after update, after insert) {

    List<Opportunity> OpptoUpdate= new List<Opportunity>();

    OpportunityLineItem[] OppLI = [Select o.Product2 from
                                      OpportunityLineItem o  where o.Product2 = '[5200] Online Product Course'];
                                      
                                      
    for (OpportunityLineItem CurOppLI : OppLI){

 OpptoUpdate.CEC_Hidden_Product__c = CurOpLI.Product2
    }


   update OpptoUpdate

}


 

  • April 24, 2012
  • Like
  • 0

I am new to VF and am wondering if anyone has come up against this issue...  I am looking to switch our views to using the Tabbed method.  It worked great with the sample code that I received from a course and did see on developer force.  I have two issues:

 

1.  How can you code the VF page to include the related list that is a custom object

2.  Even if it is not a tab, it will not display on the new view with the tabs.  Only the standard object do.  I checked the profiles to ensure they have the right modifications. 

 

I am stumped.  Thanks in advance for your collective knowledge.

 

 

  • November 05, 2011
  • Like
  • 0

Looked and looked online, in communites and through my cookbook and cannot seem to figure it out - so hoping the collective community can help find the error.

 

I have a custom button that is calling an apex class.  I get the dreaded "fault code....etc.  No operation available for request, etc...  please check the WSDL for the service."

 

My understanding of this error is that the apex code being called is not declared as a webservice.  However in my case it is, but with @future.  

 

Here is the code in the button:

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}

if (
 (
// System Administrator
 ("{!$User.ProfileId}" == "00e30000000e1mu") ||
// Order Management
 ("{!$User.ProfileId}" == "00e30000000i5Km")
 ) && "{!Opportunity.Probability}" >= .75 ) {

var oppID = '{!Opportunity.Id}';
var man = true;

sforce.apex.execute("oppClose","createCase",{oppID: oppID, man: true});

location.reload();

}

else

{
alert("Only Authorized Users can manually trigger the creation of all necessary //Cases for Implementation and only from a Closed Won Opportunity");
}

 


Here is the snippet of code from the apex class that is being called where the webservice is defined:

 

global class OppClose {
    public static String koAmericanPrnCaseId;
    public static String koBeehiveCaseId;
    public static String koHarcourtCaseId;
    public static String koJohnsonCaseId;
    public static String koRidgwaysCaseId;
    public static String koMondoCaseId;
    public static ID cntct;
    public static Integer count;
    public static ID impCase;
    public static ID pbeID;
    @future
    webService static void createCase(ID oppID, Boolean man){
      
       List<Opportunity> oppList =
        [select o.AssdImpCase__c, .....  etc.

 

 

Hi guys,

 

Still a noob with APEX so any help will be very appreciated.

 

My requirement is that I need to insert an OLI to a new Opportunity created with a certain criteria (depending on record type).

 

The pricebook/product will always be the same.

 

Thanking you guys in advance!

 

 

regards,

 

DG

  • March 12, 2013
  • Like
  • 0

Hi,

 

I have encountered an issue with Live Agent.

 

It is not working in IE, in other browsers it is working well. is this bug or something?

I am new to VF and am wondering if anyone has come up against this issue...  I am looking to switch our views to using the Tabbed method.  It worked great with the sample code that I received from a course and did see on developer force.  I have two issues:

 

1.  How can you code the VF page to include the related list that is a custom object

2.  Even if it is not a tab, it will not display on the new view with the tabs.  Only the standard object do.  I checked the profiles to ensure they have the right modifications. 

 

I am stumped.  Thanks in advance for your collective knowledge.

 

 

  • November 05, 2011
  • Like
  • 0

Wow, I just can't seem to figure this simple thing out.  In a visualforce template I want to create a link to an object record. 

 

I've seen examples like this

 

 

({!LEFT($Api.Partner_Server_URL_140, FIND(".com/",$Api.Partner_Server_URL_140)+3)

 

but shouldn't I be able to use a simple relative URL to get this to work?

 

 

 

 

A new record was created!  <a href="/{!RelatedTo.ID}">Click here</a>  to see it.

 

 

However, when the email gets sent out the link becomes "http://5008000000dmoskaax/" and not "http://na8.salesforce.com/5008000000dmoskaax"

 

 

 

Any idears?

 

 

 

Tyler