• jostman
  • NEWBIE
  • 30 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies

Hi

 

I have successfully imported the Entreprise WSDL into a new SOAP Project. I can LOGIN with success, use the GETSERVERTIMESTAMP successfully but I am unable to use the UPSERT call.

 

I have copy-pasted part of the sample available here : SOAP Sample Message

 

 

<urn:externalIDFieldName>CIEID__C</urn:externalIDFieldName>
   <urn:sObjects xsi:type="Account">
      <CIEID__C>1330</CIEID__Cc>
      <Name>Acme Rocket Superstore</Name
      <NumberOfEmployees>340</NumberOfEmployees>
   </urn:sObjects>

 Error msg : The prefix "xsi" for attribute "xsi:type" associated with an element type "urn:sObjects" is not bound.

 

 

So, code was adapted :(xsi:type was removed) :

 

   <urn:sObjects ="Account">
      <CIEID__C>1330</CIEID__Cc>
      <Name>Acme Rocket Superstore</Name>
      <NumberOfEmployees>340</NumberOfEmployees>
   </urn:sObjects>

 

Error msg : Element type "urn:sObjects" must be followed by either attribute specifications, ">" or "/>". (I also tried with <urn:sObjects =Account> with the same error msg).

 

Finally, code was adapted to :

 

 

   <urn:sObjects>Account</urn:sObjects>
      <CIEID__C>1330</CIEID__Cc>
      <Name>Acme Rocket Superstore</Name>
      <NumberOfEmployees>340</NumberOfEmployees>
   <!--/urn:sObjects-->

 And error msg was : INVALID_TYPE: Must send a concrete entity type

 

Do someone have any idea how to successfully make such a call ??

 

Thank you in advance

 

Dimitri

 

Issue: Lightning Container loading a jquery fileupload widget as a static resource - throws "403 Forbidden" error in container.js

Plain iframe works
    <iframe src="/resource/jqfileupload/fileupload/index.html"></iframe>
Same static resource fails in lightning container with 403    
    <lightning:container src="{!$Resource.jqfileupload + '/fileupload/index.html'}"/>

Any help is greatly appreciated. Thanks!

 

I am in need of assistance, any help would be appreciated;


We have a trigger that updates information on Chatter feeds when a product is chaged on an Opportunity Line Item.

 

We are now receiving exception errors due to the governing limit on queries. 

 

The code:

 

trigger LineItemToOpportunityFeedUpdate on OpportunityLineItem (after update) {
    List<FeedPost> posts = new List<FeedPost>();
    Set<Id> pbeIds = new Set<Id>();
    
    for(OpportunityLineItem newOLI : Trigger.new) {
        OpportunityLineItem oldOLI = Trigger.oldMap.get (newOLI.id);
        //System.debug('New: '+newOLI.Part_Outcome__c+' Old: '+oldOLI.Part_Outcome__c);
        
        if(newOLI.Part_Outcome__c != oldOLI.Part_Outcome__c) {
            
            List<OpportunityFeed> opportunityFeedPosts = [SELECT Id, Type, FeedPost.Body
                                                            From OpportunityFeed
                                                            Where ParentID = :newOLI.OpportunityID
                                                            ORDER BY CreatedDate DESC];
                       
            pbeIds.add(newOLI.PricebookEntryId);
            Map<Id, PricebookEntry> entries = new Map<Id, PricebookEntry>([select Product2.ProductCode from PricebookEntry where id in :pbeIds]);

            pbeIds.add(newOLI.opportunityid);
            Map<Id, Opportunity> Opp = new Map<Id, Opportunity>([select Account.Name, Account.ID from Opportunity where id in :pbeIds]);
                                                                            
            //String bodyText = 'Got here....'+Opp.get(newOLI.OpportunityId).Account.Name+'';                                                               
            String bodyText = 'has updated the '+entries.get(newOLI.Pricebookentryid).Product2.ProductCode+' from '+oldOLI.Part_Outcome__c+' to '+newOLI.Part_Outcome__c+' at '+opp.get(newOLI.OpportunityId).Account.Name+'';    
            
            if(opportunityFeedPosts.size() == 0 || opportunityFeedPosts[0].FeedPost.Body != bodyText) {
                //System.debug('OpportunityFeed Posts: '+opportunityFeedPosts[0]);

               
                FeedPost opportunityPost = new Feedpost();
                opportunityPost.Type = 'LinkPost';
                opportunityPost.Title = ''+entries.get(newOLI.Pricebookentryid).Product2.ProductCode+' socket details';
                opportunityPost.Body = bodyText;
                String id = String.valueOf(newOLI.Id).substring(0,15);
                opportunityPost.LinkURL = 'https://na2.salesforce.com/'+id;
                opportunityPost.ParentID = newOLI.opportunityid;
                posts.add(opportunityPost);
                System.Debug('Got Here but did not post');
                
                /*@Version 1.3 - removed because I could not get it to display one feedpost with 2 links in the Opportunity Post Title
                FeedPost opportunityPost2 = new FeedPost ();
                opportunityPost2.Type = 'LinkPost';
                opportunityPost2.Title = 'Account Details';
                opportunityPost2.Body = bodyText;
                String id2 = String.valueOf(opp.get(newOLI.OpportunityId).Account.Id).substring(0,15);
                opportunityPost2.LinkURL = 'https://na2.salesforce.com/'+id2;
                opportunityPost2.ParentID = newOLI.opportunityid;
                posts.add(opportunityPost2);
                system.debug('got here and it should have posted twice');
                */
                }
            }
         
        //This section will trigger a feed update to the Opportunity if the Max Potential of any given socket is increased by $1,000,000           
        if(newOLI.Max_Potential__c >= oldOLI.Max_Potential__c + 1000000){
            
            List<OpportunityFeed> opportunityFeedPosts = [Select Id, Type, FeedPost.Body
                                                            From OpportunityFeed
                                                            Where ParentId = :newOLI.OpportunityID
                                                            ORDER BY CreatedDate DESC];
        
            //@1.1 Code that will traverse the Pricebookentry ID and pull back the part number. We could not directly access the part number from the opportunitylineitem.productcode field
            pbeIds.add(newOLI.PricebookEntryId);    
            Map<Id, PricebookEntry> entries = new Map<Id, PricebookEntry>([select Product2.ProductCode from PricebookEntry 
                                                                            where id in :pbeIds]);
                                                                            
            //Traverse the opportunity object to return the Account detail and get the account name                                                                
            pbeIds.add(newOLI.opportunityid);
            Map<Id, Opportunity> Opp = new Map<Id, Opportunity>([select Account.Name, Account.ID from Opportunity where id in :pbeIds]);                                                                
            
            //Round the dollar values to whole numbers
            decimal NewWholeMaxPotential = newOLI.Max_Potential__c;
            decimal maxpotentialdifference = newOLI.Max_Potential__c/1.0 - oldOLI.Max_Potential__c/1.0;                                                             
            
            String bodyText = 'has increased the Max Potential of the '+entries.get(newOLI.Pricebookentryid).Product2.ProductCode+' by $'+maxpotentialdifference+' at '+opp.get(newOLI.OpportunityId).Account.Name+'';
                                                                                                
        if(opportunityFeedPosts.size() == 0 || opportunityFeedPosts[0].FeedPost.Body != bodyText) {
                //System.debug('OpportunityFeed Posts: '+opportunityFeedPosts[0]);
                
                FeedPost opportunityPost = new FeedPost ();
                opportunityPost.Type = 'LinkPost';
                opportunityPost.Title = ''+entries.get(newOLI.Pricebookentryid).Product2.ProductCode+' socket details';
                opportunityPost.Body = bodyText;
                String id = String.valueOf(newOLI.id).substring(0,15);
                opportunityPost.LinkURL = 'https://na2.salesforce.com/'+id;
                opportunityPost.ParentID = newOLI.opportunityid;
                posts.add(opportunityPost);
                }    
            }
          
        //This section will update the Chatter feed when the PS3 checkbox is marked true
        //if(newOLI.Socket_Strategy_Required__c == true && oldOLI.Socket_Strategy_Required__C == false){
        if(newOLI.Socket_Strategy_Required__c == true && oldOLI.Socket_Strategy_Required__c == false){  
            List<OpportunityFeed> opportunityFeedPosts = [Select Id, Type, FeedPost.Body
                                                            From OpportunityFeed
                                                            Where ParentId = :newOLI.OpportunityID
                                                            ORDER BY CreatedDate DESC];
                                                      
            pbeIds.add(newOLI.PricebookEntryId);

            Map<Id, PricebookEntry> entries = new Map<Id, PricebookEntry>([select Product2.ProductCode from PricebookEntry 
                                                                            where id in :pbeIds]);
            
            
            //OppOwnerFirstName = get.FirstName;
            //OppOwnerLastName = get.LastName;
                                                                            
            String bodyText = ' has required a PS3 for the '+entries.get(newOLI.Pricebookentryid).Product2.ProductCode+'.';                                             
            //String bodyText = ''+opportunity.OwnerId+' has required a PS3 for the '+entries.get(newOLI.Pricebookentryid).Product2.ProductCode+'.';
            
        if(opportunityFeedPosts.size() == 0 || opportunityFeedPosts[0].FeedPost.Body != bodyText) {
                //System.debug('OpportunityFeed Posts: '+opportunityFeedPosts[0]);
                
                FeedPost opportunityPost = new FeedPost ();
                opportunityPost.Type = 'LinkPost';
                opportunityPost.Title = 'Click here for the PS3';
                opportunityPost.Body = bodyText;
                String id = String.valueOf(newOLI.id).substring(0,15);
                opportunityPost.LinkURL = 'https://na2.salesforce.com'+newOLI.PS3_Link__c+'';
                opportunityPost.ParentID = newOLI.opportunityid;
                posts.add(opportunityPost);
                }    
            }*/         
        }
        insert posts;
}

 

Error:

 

Trigger.LineItemToOpportunityFeedUpdate: line 40, column 65

 

 

That line of code is:

 

Map<Id, Opportunity> Opp = new Map<Id, Opportunity>([select Account.Name, Account.ID from Opportunity where id in :pbeIds]);

 I know that the query should be outside the for loop and please understand that I am still fairly new to APEX. 

 

Where can I place these queries and still have this trigger work as designed.

 

Thanks to anyone in advance!!

 

~Mike

Hi

 

I have successfully imported the Entreprise WSDL into a new SOAP Project. I can LOGIN with success, use the GETSERVERTIMESTAMP successfully but I am unable to use the UPSERT call.

 

I have copy-pasted part of the sample available here : SOAP Sample Message

 

 

<urn:externalIDFieldName>CIEID__C</urn:externalIDFieldName>
   <urn:sObjects xsi:type="Account">
      <CIEID__C>1330</CIEID__Cc>
      <Name>Acme Rocket Superstore</Name
      <NumberOfEmployees>340</NumberOfEmployees>
   </urn:sObjects>

 Error msg : The prefix "xsi" for attribute "xsi:type" associated with an element type "urn:sObjects" is not bound.

 

 

So, code was adapted :(xsi:type was removed) :

 

   <urn:sObjects ="Account">
      <CIEID__C>1330</CIEID__Cc>
      <Name>Acme Rocket Superstore</Name>
      <NumberOfEmployees>340</NumberOfEmployees>
   </urn:sObjects>

 

Error msg : Element type "urn:sObjects" must be followed by either attribute specifications, ">" or "/>". (I also tried with <urn:sObjects =Account> with the same error msg).

 

Finally, code was adapted to :

 

 

   <urn:sObjects>Account</urn:sObjects>
      <CIEID__C>1330</CIEID__Cc>
      <Name>Acme Rocket Superstore</Name>
      <NumberOfEmployees>340</NumberOfEmployees>
   <!--/urn:sObjects-->

 And error msg was : INVALID_TYPE: Must send a concrete entity type

 

Do someone have any idea how to successfully make such a call ??

 

Thank you in advance

 

Dimitri

 

Hey,

Hopefully a simple question:  when you invoke a synchronous callout to an external Web service, is there any way to tune the timeout value?  It seems to be 10 seconds by default; can this be changed programatically (e.g. by tweaking the class file derived from the external WS's WSDL)? 

Thanks!

-philbo