• MandyKool
  • SMARTIE
  • 864 Points
  • Member since 2010

  • Chatter
    Feed
  • 30
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 22
    Questions
  • 283
    Replies
I have an active process that populates a date field on a lead based on a specific task type being completed, otherwise the field is blank. This date field is a read only field to the users. My goal is to have a validation rule to check that if this date field (last_call_date_c) is NOT blank (in other words, has any date); then a comments field (last_call_comments_c) is then mandatory. Most of what i'm seeing in my search for possible solutions involves picklists which this is not so i'm struggling to locate a similar sytax.

Thanks in advance.
I have a process that invokes an @InvocableMethod Class, which should post to an endpoint. I am not getting any errors, but it isn't making the call. My Class is below. What am I missing? Any help is appreciated. Thank you!


global class SalesCloudOnboardCustomerClass {
  
    @InvocableMethod(label ='Call Sales Cloud' description='Sends the Opportunity Id to Sales Cloud.')
    public static void makeCallout(List<Id> ids) {
      System.debug('DebugMe ids: ' + ids);
      String endpoint='';
      HttpRequest request = new HttpRequest();
      // Set the HTTP verb to POST.
      request.setMethod('POST');

      for(Id id : ids){
        //Set the endpoint URL.
        Remote_Endpoint__mdt onboardCustomer = [select Endpoint__c from Remote_Endpoint__mdt where QualifiedApiName = 'OnboardCustomer' Limit 1];
          endpoint = onboardCustomer.endpoint__c + id;
        }
                
     
        // Set the endpoint URL.
        request.setEndPoint(endpoint);
        // Set timeout to 40 seconds.
        request.setTimeout(40000); 
        // Send the HTTP request and get the response.
        System.debug('DebugMe request: ' + request);
        //HttpResponse response = new HTTP().send(request);
        
      }

  }
I have a custom button calling a webservice but when slected I get this error:
{faultcode: 'soapenv:client', faultString: ' No Operation available for request {http://soap.sforce.com/schemas/package/CallTrexWebServiceInsideSales}TrexWebServiceInsideSales,please check the WSDL for the Service.' ,}
Not sure if its the button or the Class:
Button:
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}

{
 var retStr; 
 retStr = sforce.apex.execute("CallTrexWebServiceInsideSales", "TrexWebServiceInsideSales", {id:'{!Lead.Id}'}); 
}

Class
Global class CallTrexWebServiceInsideSales{
    
    public static Lead leads {get;set;}
    public static String myresponse{get;set;}

    public static string TrexWebServiceInsideSales (String id) {
    
        TrexWebServiceInsideSalesAsync(id);
        return myresponse;        
    }


    @future(Callout=true)
    webservice static void TrexWebServiceInsideSalesAsync(String id) {
    
        leads = [SELECT Email, FirstName , LastName , city  FROM Lead WHERE id =:id];
        
        if(String.isEmpty(leads.email)) {
            myresponse = 'This lead is either missing an email address or the Account Type field is NULL.' ; 
        }
        else
        {
            HttpRequest req = new HttpRequest();
            Http http = new Http();
            req.setMethod('GET');
            
            String ActivityType = 'Sales';
            string Subject = 'Trexpro and Dealer Locations sent to Consumer ';
                  
            String url = 'https://abc/def.asmx' + leads + ActivityType +Subject;
            req.setEndpoint(url);
            
            HTTPResponse resp = http.send(req);
            myresponse = resp.getBody();
         }
    }
}

It was not throwing an error earlier so I am assuming it is due to the Class changes made.  Any suggestions is appreciated.
M


 
Hi
i m a new admin and a maybe stupid question . 
2 teams in my company (sales and support ) 
I need to create 2  differents opportunity path . Sales must be able to view (not edit) the support's opportunity and vice versa . 

is it possible ? how ? 
I am attempting to complete the Hands-On Challenge in the 'Use Standard List Controllers' module and the exercise doesn't reflect what I just learned in the module.  For example the apex:repeat command isn't explained so I have no real idea about how to use it.  Can someone please provide an explanation?  Thanks.
Hello Everyone,

My test class is failing and I can't figure out why. Any assistance is greatly appreciated.

This is the error message:

System.QueryException: List has no rows for assignment to SObject

Method 1: System.QueryException: List has no rows for assignment to SObject 
Stack Trace: Class.portalRequestControllerTests.AAAAAAAAAAAAAAAtestInsert: line 126, column 1

Method 2: System.QueryException: List has no rows for assignment to SObject 
Stack Trace: Class.portalRequestControllerTests.testInsertContactNotMatched: line 155, column 1

Method 3: System.QueryException: List has no rows for assignment to SObject 
Stack Trace: Class.portalRequestControllerTests.testMisMatchedAccount: line 184, column 1

Method 4: System.AssertException: Assertion Failed: Same value: null 
Stack Trace: Class.portalRequestControllerTests.testVeterinarianSchool: line 24, column 1

Method 5: System.AssertException: Assertion Failed: Same value: null 
Stack Trace: Class.portalRequestControllerTests.test_method_one: line 46, column 1

This is the test class as a whole:

@isTest
private class portalRequestControllerTests {
  
  @isTest static void testVeterinarianSchool() {
    portalRequestController ctlr     = new portalRequestController(new ApexPages.StandardController(new Portal_Request__c() ));
    RecordType rt             = [select Id from RecordType where SObjectType = 'Account' and Name  = 'Veterinarian School'];

      Account a    = new Account(Name='Test Account', RecordTypeId = rt.Id, Active__c = true, Account_Classification__c = 'School');
      insert a;


    List<Account> searchList       = portalRequestController.lookupAccount('Test Account');
    System.assertEquals(searchList.size(), 1);

      ctlr.pr.First_Name__c       = 'Joe';
      ctlr.pr.Last_Name__c       = 'Test';
      ctlr.pr.Email_Address__c     = 'test@mailinator.com';
      ctlr.clinicId           = portalRequestController.lookupAccount('Test Account')[0].Id;
      ctlr.pr.Clinic_Phone_Number__c   = '416 555 5555';
      ctlr.pr.Title__c         = 'Tester';
      ctlr.lang             = ctlr.getLanguageOptions()[0].getValue();

      ctlr.createRequest();
      System.assertNotEquals(ctlr.pr.Id, null);

  }


  @isTest static void test_method_one() {
    portalRequestController ctlr     = new portalRequestController(new ApexPages.StandardController(new Portal_Request__c() ));

        Account a    = new Account(Name='Test Account', RecordTypeId = slimfitUtils.getClinicAccountRecordType().Id, Active__c = true, Account_Classification__c = 'School');
        insert a;

      ctlr.createRequest();

      ctlr.pr.First_Name__c       = 'Joe';
      ctlr.pr.Last_Name__c       = 'Test';
      ctlr.pr.Email_Address__c     = 'test@mailinator.com';
      ctlr.clinicId           = portalRequestController.lookupAccount('Test Account')[0].Id;
      ctlr.pr.Clinic_Phone_Number__c   = '416 555 5555';
      ctlr.pr.Title__c         = 'Tester';
      ctlr.lang             = ctlr.getLanguageOptions()[0].getValue();

      ctlr.createRequest();
      System.assertNotEquals(ctlr.pr.Id, null);
  }
  

  @isTest static void test_rejection() {
    portalRequestController ctlr     = new portalRequestController(new ApexPages.StandardController(new Portal_Request__c() ));

      ctlr.createRequest();

      ctlr.pr.First_Name__c       = 'Joe';
      ctlr.pr.Last_Name__c       = 'Test';
      ctlr.pr.Email_Address__c     = 'test@mailinator.com';
      ctlr.pr.Clinic_Phone_Number__c   = '416 555 5555';
      ctlr.pr.Title__c         = 'Tester';

      ctlr.createRequest();
      System.assertEquals(ctlr.pr.Id, null);
  }



  @isTest static void testExistingPortalRequest() {
      Account a    = new Account(Name='Test Account');
      insert a;

        Portal_Request__c portalReqObj1           = new Portal_Request__c ();
        portalReqObj1.First_Name__c   = 'TestFirstName1';
        portalReqObj1.Last_Name__c     = 'TestLastName';
        portalReqObj1.Status__c        = 'New';
        portalReqObj1.Clinic__c       = a.id;
        portalReqObj1.Email_Address__c   = 'TestMail@testing.com';
        insert portalReqObj1;

    portalRequestController ctlr     = new portalRequestController(new ApexPages.StandardController(new Portal_Request__c() ));

      ctlr.pr.First_Name__c       = 'Joe';
      ctlr.pr.Last_Name__c       = 'Test';
      ctlr.pr.Email_Address__c     = portalReqObj1.Email_Address__c;
      ctlr.pr.Clinic_Phone_Number__c   = '416 555 5555';
      ctlr.pr.Title__c         = 'Tester';

      ctlr.createRequest();
      System.assertEquals(ctlr.pr.Id, null);
  }



    static testMethod void AAAAAAAAAAAAAAAtestInsert() {
    // prod
    ExactTarget_Settings__c settings = new ExactTarget_Settings__c(
      accessToken__c='bg5ccutef4qqcdxkjk63bd2u', 
      accessToken_Expiration_Date__c = Datetime.now().addYears(1),
      TriggeredSendEmail_Endpoint__c = 'https://www-exacttargetapis-com-nhz9abyp4su1.runscope.net/messaging/v1/messageDefinitionSends/key:%7B0%7D/send?access_token={1}',
      requestToken_EndPoint__c = 'https://auth.exacttargetapis.com/v1/requestToken',
      clientSecret__c = 'k6fs4dkvJr6XC3Uzw4yxVrYT',
      clientId__c = 'xdf5ehwugdv5afpybxrda9uq'
    );
    // dev
    //TMSSettings__c settings = new TMSSettings__c(Blocked_Off_Record_Type_ID__c=blackoutRecordTypeId, Shipment_Record_Type_ID__c=shipmentRecordTypeId, Carrier_New_Ship_Email_Template_ID__c='00XW0000000I8juMAC', Carrier_Profile_ID__c='00eW0000000QMpFIAW', Carrier_Updated_Ship_Email_Template_ID__c='00XW0000000I8jpMAC', From_Email_Notification_ID__c='0D250000000TN1PCAW', Portal_Domain_Name__c='  royalcanincanada.force.com', TMS_RC_Notification_Group_ID__c='00G50000001jledEAA', Warehouse_Address__c='Any street, Toronto', Warehouse_Phone__c='9056667890', Warehouse_Profile_ID__c='01IW0000000D4fx' , POD_Logistics_Email_Template_ID__c='00XW0000000I9xxMAC', POD_Carrier_Email_Template_ID__c='00XW0000000I9xsMAC');
    insert settings;

      Account a    = new Account(Name='Test Account');
      insert a;
        Account a1    = [select Id, OwnerId from Account where Id = :a.Id];

        Contact c    = new Contact(FirstName = 'first', LastName = 'last', Email = 'test@me.com', AccountId = a.Id, RecordTypeId = slimfitUtils.getClinicVetRecordType().Id, Vet_Portal_Welcome_Sent__c = true);
        insert c;
        
    portalRequestController ctlr     = new portalRequestController(new ApexPages.StandardController(new Portal_Request__c() ));

      ctlr.pr.First_Name__c       = 'Arthur';
      ctlr.pr.Last_Name__c       = c.LastName;
      ctlr.pr.Email_Address__c     = c.Email;
      ctlr.ClinicId           = a.Id;
      ctlr.pr.Clinic_Phone_Number__c   = '416 555 5555';
      ctlr.pr.Title__c         = 'Tester';
      ctlr.lang             = 'en_US';
      ctlr.pr.Email_Opt_In__c     = true;
      ctlr.createRequest();

    Portal_Request__c pr         = [select Id, Status__c, Clinic__c from Portal_Request__c where Id = :ctlr.pr.Id];
      //System.assertEquals(pr.Status__c, 'Approved');
      System.assertEquals(pr.Clinic__c, a.Id);

    Contact cCheck     = [select Id, FirstName, Vet_Express_Consent__c from Contact where Id = :c.Id];
    System.assertEquals(cCheck.FirstName, ctlr.pr.First_Name__c);
    System.assertEquals(cCheck.Vet_Express_Consent__c, true);
    }


    static testMethod void testInsertContactNotMatched() {
      Account a    = new Account(Name='Test Account');
      insert a;
        Account a1    = [select Id, OwnerId from Account where Id = :a.Id];

        Contact c    = new Contact(FirstName = 'first', LastName = 'last', Email = 'test@me.com', AccountId = a.Id);
        insert c;
        
    portalRequestController ctlr     = new portalRequestController(new ApexPages.StandardController(new Portal_Request__c() ));
      ctlr.pr.First_Name__c       = 'Arthur';
      ctlr.pr.Last_Name__c       = c.LastName;
      ctlr.pr.Email_Address__c     = c.Email;
      ctlr.ClinicId           = a.Id;
      ctlr.pr.Clinic_Phone_Number__c   = '416 555 5555';
      ctlr.pr.Title__c         = 'Tester';
      ctlr.lang             = 'en_US';
      ctlr.pr.Email_Opt_In__c     = true;
      ctlr.createRequest();

    Portal_Request__c pr         = [select Id, Status__c, Contact__c, Clinic__c from Portal_Request__c where Id = :ctlr.pr.Id];
      System.assertEquals(pr.Contact__c, null);
      System.assertEquals(pr.Clinic__c, a.Id);

    Contact cCheck     = [select Id, FirstName, Vet_Express_Consent__c from Contact where Id = :c.Id];
    System.assertNotEquals(cCheck.FirstName, ctlr.pr.First_Name__c);
    System.assertNotEquals(cCheck.Vet_Express_Consent__c, true);
    }


    static testMethod void testMisMatchedAccount() {
      Account a    = new Account(Name='Test Account');
      Account b     = new Account(Name='B Account');
      insert new List<Account> { a, b };

        Contact c    = new Contact(FirstName = 'first', LastName = 'last', Email = 'test@me.com', AccountId = b.Id);
        insert c;
        
    portalRequestController ctlr     = new portalRequestController(new ApexPages.StandardController(new Portal_Request__c() ));
      ctlr.pr.First_Name__c       = 'Arthur';
      ctlr.pr.Last_Name__c       = c.LastName;
      ctlr.pr.Email_Address__c     = c.Email;
      ctlr.ClinicId           = a.Id;
      ctlr.pr.Clinic_Phone_Number__c   = '416 555 5555';
      ctlr.pr.Title__c         = 'Tester';
      ctlr.lang             = 'en_US';
      ctlr.pr.Email_Opt_In__c     = true;
      ctlr.createRequest();

    Portal_Request__c pr         = [select Id, Status__c, Clinic__c from Portal_Request__c where Id = :ctlr.pr.Id];
      //System.assertEquals(pr.Status__c, 'Approved');
      System.assertEquals(pr.Clinic__c, a.Id);
      System.assertNotEquals(pr.Status__c, 'Approved');

    List<User> uList           = [select Id from User where Email = :c.Email];
    System.assertEquals(uList.size(), 0);

    List<Account> searchList       = portalRequestController.lookupAccount('Account');
    System.assertEquals(searchList.size(), 0);
    }}

I have highlighted error 
I can't get the Pagination piece of the course to work in my preview.  See the code I'm using per the instructions:

<apex:page standardController="Contact" recordSetVar="contacts">
  <apex:form>
    <apex:pageBlock title="Contacts List" id="contacts_list">
        
        Filter:
        <apex:selectList value="{! filterId }" size="1">
            <apex:selectOptions value="{! listViewOptions }"/>
            <apex:actionSupport event="onchange" reRender="contacts_list"/>   
        </apex:selectList>
        
        <!-- Contacts List -->
        <apex:pageblockTable value="{! contacts }" var="ct">
            <apex:column value="{! ct.FirstName }"/>
            <apex:column value="{! ct.LastName }"/>
            <apex:column value="{! ct.Email }"/>
            <apex:column value="{! ct.Account.Name }"/>
            
            <!-- Pagination -->
<table style="width: 100%"><tr>
    <td>
        Page: <apex:outputText 
    value=" {!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>
    </td>            
    <td align="center">
<!-- Previous page -->
<!-- active -->
<apex:commandLink action="{! Previous }" value="« Previous"
     rendered="{! HasPrevious }"/>
<!-- inactive (no earlier pages) -->
<apex:outputText style="color: #ccc;" value="« Previous"
     rendered="{! NOT(HasPrevious) }"/>
&nbsp;&nbsp;  
<!-- Next page -->
<!-- active -->
<apex:commandLink action="{! Next }" value="Next »"
     rendered="{! HasNext }"/>
<!-- inactive (no more pages) -->
<apex:outputText style="color: #ccc;" value="Next »"
     rendered="{! NOT(HasNext) }"/>
    </td>
    
    <td align="right">
        Records per page:
<apex:selectList value="{! PageSize }" size="1">
    <apex:selectOption itemValue="5" itemLabel="5"/>
    <apex:selectOption itemValue="20" itemLabel="20"/>
    <apex:actionSupport event="onchange" reRender="contacts_list"/>
</apex:selectList>
    </td>
</tr></table>

            
            
            
        </apex:pageblockTable>
    </apex:pageBlock>
  </apex:form>
</apex:page>
Hello,
I have an embedded VF Page in my Leads which pulls a custom onbject Documents, and displays all Documents in the list as below:
User-added image
You can probably tell what I'd like to do is upload a file to 'Proposal' and another one to other doc types I do not have listed there, and then click the 'Save All Docs Attached' button and have the attachments save properly to eash Document Type which is a separate record. Right now when I click Save it saves the attachment to each of the Doc Types in the list. Is there a way I can save the Attachment to a List, then have the List save to each respective Doc Type?
Apex:
public with sharing class LeadDoc{
    public ApexPages.StandardController Controller;
    public LeadDoc(ApexPages.StandardController Controller){
        this.Controller = Controller;}
    public Id getid {get;set;}{
        getid = ApexPages.currentPage().getParameters().get('id');}
    public List<Lead> Lds {get;set;}
    public List<Document__c> Docs {get;set;}
    public String fileName {get;set;}
    public transient Blob fileBody {get;set;}
    
    public LeadDoc(){
        Lds = [SELECT Id, Name FROM Lead WHERE Id =: getid];
        Docs = [SELECT Id, Name,Count_Attachments__c,Attach_Request_Status__c, Document__c,View_Doc__c,
                Lead__c FROM Document__c WHERE Lead__c =: Lds[0].Id];
    }
    public PageReference Save(){
        //List<Attachment> att = fileBody;
        for(Document__c doc : Docs){
            if(fileBody!=null){
                Attachment attachment = new Attachment();
                attachment.body = fileBody;
                attachment.name = this.fileName;
                attachment.parentId = doc.Id;
                insert attachment;}
        }
        return null;
    }
}

 
I'm trying to add a jQuery data table in Salesforce lightning component. Here is the code. It is not loading at all. What am I doing wrong?
<ltng:require scripts="{!join(',','//cdn.datatables.net/1.10.4/css/jquery.dataTables.css'
                        ,'//code.jquery.com/jquery-1.12.4.js'
                        ,'//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js'
                        ,'//cdn.datatables.net/buttons/1.5.1/js/dataTables.buttons.min.js'
                        ,'//cdn.datatables.net/buttons/1.5.1/js/buttons.flash.min.js'
                        ,'//cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js'
                        ,'//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js'
                        ,'//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js'
                        ,'//cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js'
                        ,'//cdn.datatables.net/buttons/1.5.1/js/buttons.print.min.js')}"
            afterScriptsLoaded="{!c.afterscriptsLoaded}"/>

or

<ltng:require scripts="{!join(',',$Resource.datatable + '/DataTables-1.10.16/css/jquery.dataTables.css'
                           ,$Resource.datatable + '/jQuery-1.12.3/jquery-1.12.3.js'
                            ,$Resource.datatable + '/DataTables-1.10.16/js/jquery.dataTables.min.js'
                           ,$Resource.datatable + '/Buttons-1.5.1/js/dataTables.bootstrap.min.js'
                            ,$Resource.datatable + '/Buttons-1.5.1/js/buttons.flash.min.js'
                            ,$Resource.datatable + '/JSZip-2.5.0/jszip.min.js'
                            ,$Resource.datatable + '/pdfmake-0.1.32/pdfmake.min.js'
                            ,$Resource.datatable + '/pdfmake-0.1.32/vfs_fonts.js'
                            ,$Resource.datatable + '/Buttons-1.5.1/js/buttons.html5.min.js'
                            ,$Resource.datatable + '/Buttons-1.5.1/js/buttons.print.min.js')}"
              	afterScriptsLoaded="{!c.afterscriptsLoaded}"/>



<table id="showContacts" class="slds-table slds-table--bordered slds-table--cell-buffer">
          <thead>
            <tr class="slds-text-title--caps">

                <th class="slds-is-sortable slds-text-title--caps">

                  <span class="slds-truncate" title="EID">EID</span>  

               </th>

               <th class="slds-is-sortable slds-text-title--caps">

                  <span class="slds-truncate" title="Name">Name</span>

               </th>
          </tr>
  </thead>
  <tbody>
      <tr>
         <td scope="row">
             <div class="text-wrap">10887738</div>
         </td>
         <td>
            <div class="slds-truncate  text-wrap" title="Adam Will"><a href="javascript:void(0);">Adam, Will</a></div>
         </td>
    </tr>
</tbody>
</table>


({
afterscriptsLoaded : function(component,event,helper){
    j$('[id$="showContacts"]').DataTable({
            "scrollY": "260px",
            "scrollCollapse": true,
            "paging": true,
            "searching": true,
            "ordering": true,
            "info": true,
            "dom": 'Bfrtip',
           "destroy" : true,
            "buttons": [
                        'copy',
                        {extend: 'csv',title: 'Criteria export'},
                        {extend: 'excel',title: 'Criteria export'},
                        {extend: 'pdf',title: 'Criteria export'},
                        'print'
            ]
        } );
},


})

My question is about how to show this table on lightning component in Salesforce? Whenever I load the page I see a blank page.
Note: I am showing a sample table. this is not the total table
After spending close to two hours on the phone with Salesforce support, they suggested I should post here to find a solution to my problem. So now I am at the mercy of you kind developers prowling these boards and I am hopeful that together we can find a solution to my problem.

The Problem
Case ownership is transferring between users and my default support queue without the user's input, however, it appears as if the user is the one transferring the case. This can occur minutes after they initially take ownership, and sometimes it happens several hours later. It occurs with both open and closed cases, the latter be especially frustrating since the newly assigned owner will go to work the case without realizing it's already been closed. I have also verified that this is happening both during and after hours - when users are no longer logged into the system  - so I know that they are not the ones transferring the cases despite the Case feed suggesting otherwise. 

Investigation Thus Far
Assignment Rules - Even though I assumed this had nothing to do with assignment rules, I double checked. Sure enough, there are no active assignment rules - nor are there any Case page layouts where the 'Assign using active assignment rules' is visible and/or checked by default.

Apex Triggers - Salesforce support suggested this was the cause, which makes sense, but I looked and there are no active Apex Triggers that I have written / implemented, which would cause this behavior. In fact, there are only three (3) Case object triggers, all of which are managed by installed packages, and none of which are desigend to do anything with regards to Case ownership (one is related to our mapping software and the other two are for a contest/gamification application)

 
I just want to thank everyone in advance for any support or guidance you can provide here. Please let me know if there is anything else I should provide that would help diagnose the issue here.

Thank you.

Ben
 
Im very new to SF Dev, and I've written my first trigger Befire Insert for newly created Opp Products.   At the opp level, there is a custom field "Corp Ad Class"  Picklist.  When the Opp is created, this field must be assigned a pickist value. 

The trigger is for each new Opp product created on that opp, I want it to enter the Corp Ad Class from the Opportunity as the default value.   I was unsuccessful accessing the Opportunity field to assign the data.  I had to create a custom formula field to capture the Picklist value first and then I could do the assignment using that field.  I'd like not to have these extra fields if I can aviod them and I assume I can access the parent related record to collect the data as need.

This is what I've come up with :

//Replicates the Opportunity level Corp Ad Class to each product line
trigger StampCorpAdClassNewRec on OpportunityLineItem (Before Insert)
{
for(OpportunityLineItem OpportunityLineItem:Trigger.new)
    {
    OpportunityLineItem.Corp_Ad_Class__c = OpportunityLineItem.OppCorpAdClass__c ;  
    }
}

Opportunity.Corp_Ad_Class__c is what I first placed to the right of the = but it errored.  I was attempting to reference the Master Record field value, Corp Ad Class field on the Opportunity Object.

OpportunityLineItem.OppCorpAdClass__c is a formula field "text(Opportunity.Corp_Ad_Class__c)"; referencing this field, the trigger works, I can make the default value assignment using that field.  Its likely the most efficient way to do this.  I've created an extra field I likely do not need.

Reading other posts on the topic, It appears I may possibly do a SOQL query for the field value then assign it to oppproduct field.   Im not quite sure.    Any feedback for a better would be greatly appreciated.

thank you, David

 
Hi All,
I have an attachment with "Anyone with link" sharing configuration. How can I retrieve (or construct) the actual sharing URL using the apex code?
E.g., I have an attachment with id: 069240000009bdU and ViewAll permissionsI. From UI (web) I can see that its URL is:
https://ap1.salesforce.com/sfc/p/90000000t55g/a/90000000Chhk/fZcNyce65hRkHRM95T0nhPrJUNHiJ47If6BLyK24ixY
How can I get this URL through Apexcode and update to custom field?

Thanks in Advance.
I need to create multiple list views for several users, how can I do this quickly in APEX?
I do not have the option in IE 11 to switch to Lightning Experience.  I do, however, have the option in Chrome.  What might be the issue?

What I see in Chrome:
Chrome

What I see in IE 11:
IE 11
IE 11 version information:
User-added image
I'm looking to find the object types of the WhatId/WhoId fields of the Task and Event objects, so I can query these objects and get more information about them and perform certain automated tasks based on the type.

I found this tech article, which uses the first 3 digits as a marker, but the article also says that this may change at any time:

http://www.sforce.com/us/resources/tn-1.jsp

Is there a better way of getting the object types of WhatId/WhoId fields or querying them based on Id only (no type)?

Thanks!