• New_Developer
  • NEWBIE
  • 105 Points
  • Member since 2011

  • Chatter
    Feed
  • 4
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 89
    Questions
  • 117
    Replies
Hi,
I have a  custom object Opportunity Service Line Item which has lookup relation to opportunity.
I have a field in Opportunity Service Line Item called 'TCV'.
Each Opportunity Line Item can have multiple Service Line Items.
I want to write a trigger to calculate the sum of TCV for all the Service Line Items and update in Opportunity Object.
Can anyone please provide a sample trigger for this.

Thanks,
Ipsita
trigger Trigger_Name on CustomObject__c (after insert) {
List<CustomObject__c> emailList = [select id from CustomObject__c where ID in :trigger.newMap.keyset()];
List<OtherCustomObject__c> recordsToUpdate = new List<OtherCustomObject__c>{};

for(CustomObject__c e: emailList){

for(OtherCustomObject__c le : e.letter__r.id ){
le.emailed__c=true;
le.date_emailed__c = datetime.now();
lettersToUpdate.add(le);
} 

update lettersToUpdate; 
}
}

Hello - I would like to update a field in one object based on the creation of a record in aother object.

 

I get this error when I try to save:  

Save error: Loop must iterate over a collection type: Id 

 

Help?

 

  • March 29, 2012
  • Like
  • 0

Hi all!

 

Relatively new to Apex but I have the controller extension below:

 

public class ControllerExt
{
    ApexPages.StandardController stdCtrl;
    public ControllerExt(ApexPages.StandardController std)
    {
       stdCtrl=std;
    }

    public PageReference save()
    {
        stdCtrl.save();
        return null;        
    }
}

 And I have been, unsuccesfully, trying to write the test code for it. My current attempt is below (saves and runs with no errors), but the code coverage is 0...any suggestions?

 

@isTest
public class ControllerExtTest {
    static testMethod void myPage_Test() {
        PageReference pageRef = Page.TypeA;
        Test.setCurrentPage(pageRef);
        
                Account acc1 = new Account (Name = 'Account 1', Type = 'Type A');
                insert acc1;        
                Opportunity opp1 = new Opportunity(Name = 'Opportunity1', AccountID = acc1.id, Probability = 20.00, CloseDate = Date.newInstance(System.now().year(),10,10), StageName = 'Prospect');
                insert opp1;

        ApexPages.StandardController sc = new ApexPages.standardController(opp1);
        
        String nextPage = sc.save().getUrl();
       
        String str1 = string.valueof (opp1.Id).substring (0, 15);
        System.assertEquals('/'+str1, nextPage);
    }
}

 

Hello,

 

I am using the below email template to send an email to the primary contact of an opportunity once the opportunity has reached a certain stage. I added a contact lookup field to the Opportunity object so that the contact could be shown. The trouble is that when the email is sent, it doesn't send the contacts name rather the id

 

<messaging:emailTemplate subject="Equipment Order Confirmation" recipientType="Contact" relatedToType="Opportunity">

<messaging:htmlEmailBody >
<html>
    <body>
    <STYLE type="text/css">
           TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
           TD  {font-size: 11px; font-face: verdana }
           TABLE {border: solid #CCCCCC; border-width: 1}
           TR {border: solid #CCCCCC; border-width: 1}
    </STYLE>
        <font face="arial" size="2">
          <p>Dear {! Relatedto.Contact__c},</p>
          <p>The following is a confirmation of your equipment order:</p>
          <p/>
          <p>Pickup Date: {! RelatedTo.Pick_Up_Date__c}</p>
          <p>Return Date: {! RelatedTo.Return_Date__c}</p>
          <p/>
          <p>Pickup Location: {! RelatedTo.Pick_Up_Location__c}</p>
            <table border="0" >
                <tr >
                    <th>Item</th><th>Quantity</th>
                </tr>
            <apex:repeat var="cx" value="{!relatedTo.OpportunityLineItems}">
                <tr>
                    <td>{!cx.pricebookentry.Product2.name}</td>
                    <td>{!cx.Quantity}</td>
                </tr>
            </apex:repeat>
            </table>
            </font>
    </body>
</html>
</messaging:htmlEmailBody>

 

Here is an example of what was sent:

 

Dear 003C000001IDKYcIAP,

The following is a confirmation of your equipment order:

Pickup Date: Fri Feb 24 00:00:00 GMT 2012

Return Date: Tue Feb 28 00:00:00 GMT 2012

Pickup Location:

Item

Quantity

AED Trainer (Generic)

1.0

Kyle Manikin

5.0

Bandage & CPR Training Kit

10.0

Adult Annie Manikin

5.0

Is there a way to capture the url of the page that the customers are clicking the chat link. There is this lastVisitedPage in the post chat available but that captures the recently viewed pages. If the customer tried to chat from page1 and ends the chat and if the same customer tries to chat from page2 then that lastVisitedPage only shows the url of the page1. 
I need help with hovering over an image which shows the list of values from the <apex:repeat> tag: I want the values from the code in the bold below to be shown when i hover over an image something like help bubble(?).

Here is my code

<apex:repeat value="{!dpgEnrollmentGuidelines}" var="dpGuideline" >
                 
                    <tr>
                       <td class= "changecolor">
                            <apex:outputText value="{!dpGuideline.Required_for__c}"/>
                        </td>
                       
                        <td onclick="navigateToElement('{!dpGuideline.Id}');">
                        <apex:outputText value="{!dpGuideline.Display_Name__c}"/>
                            <apex:repeat value="{!dpGuideline.Acceptable_Documents__r}" var="accdoc" >
                   <apex:outputText value = "{!accdoc.Acceptable_doc__Name__c}"
                        </apex:repeat> 

                                                </td>
                         
                           </apex:repeat>

Thanks
Iam trying to get the value of the field entered by the user and use that value to show up other fields on the visualforce page. I did below. We have been dynamically pulling the fields on to the visualforce page based on the data in some objects.. so the id's will changed based on the number of fields that display for each record type. So i tried this

  var code = document.getElementById('pageid:codeid:codeparent:1:codechild:0:codeinnerchild:2:thecode').value;

the part where it says codeparent:1, what does that :1 mean?? those values after colon are changing based on the fields diaplyed on the vf page .How can i get the value irrespective of the fields displayed on the vf page??

Thanks
Is it possible to send attachments(Image , word,pdf's) to an external system? If so can someone point me to right documentation and any sample code.

Thanks for the help in advnace.
I have a requirement where i need to send and email alert with the articles attached to the email whenever a case is closed using Apex. Is this possible??

Thanks
 
We have a web page where the cookies are captured and that web page has a button which will redirect to a force.com site visualforce page. Is there a way we can capture the cookie in that visulaforce page and insert into a field in salesforce!! Please note that the web page is on a differnt domain.
Hi,

What iam trying to acheive here is the affiliated tracking. we have different affiliates and there is button on each of their websites which will redirect to a force.com site visualforce page of our company. They all have a input hidden filed which stores the affiliate code. I need to be able to capture that code when its redirected to the force.com site and store it on a field in salesforce. What is the best way to acheive it. Any help is greatly appreciated.

Thanks
Hi,

Iam trying to schedule a apex job that runs for every 30 mins from 6PM to 11 PM. Here is the scheduler iam trying to use

ScheduledClass obj= new ScheduledClass();
String sch = '0 0,30 18,19,20,21,22,23 ? * MON-FRI';
System.schedule('My Job', sch, obj);

But iam getting the below error

System.StringException: Seconds and minutes must be specified as integers: 0 15,30,45 18,19,20,21,22,23 ? * MON-FRI

Is there any way we could scehdule a job which could run for every 30 mins starting from  6 PM and ending at 11.30 PM??

Thanks
Hi,

I have a batch class which runs and attached like hundreds of text files to the Document object and i have a vf page and controller to get all the data in that documents into one big text file. The size of the file would be around 9MB. But iam getting the Apex heap sze too large error. Is it possible to generate a 9 MB text file from a vf page??

Here is my code

<apex:page standardController="Child__c" extensions="DocumentController" contentType="text/plain/#testfile" cache="false" >
<apex:repeat value="{!lstStringOutput}" var="str">
{!str}
</apex:repeat>
</apex:page>

Conrtoller:
public with sharing class DocumentController {
public List<String> lstStringOutput {get;set;}
Public Static String text;
    public DocumentController(ApexPages.StandardController controller) {

         lstStringOutput = new List<String>();
          Folder folder = [select id from Folder where name='Test file' LIMIT 1];
        
        for(Document doc : [Select id, Description , Body , folderId from Document where folderId = :folder.id ]){
          text= doc.Body.toString();
             lstStringOutput.add(text+'\r');
           } 
}
}
Thanks

I was trying to get a good coverage for a trigger , but no luck so far

here is my trigger on Opportunity

Map<String, Integer> classificationTypePriorities = new Map<String, Integer>{
            'Sustainer' => 1,
            'Donor' => 2,
            'Fundraiser' => 3,
            'Buyer' => 4,
            'Activist' => 5,
            'Volunteer' => 6,
            'Prospect' => 7,
            'Lead' => 8
        };
        Map<String, Id> classificationTypes = new Map<String, Id>();
        for (cv__Engagement_Channel__c c : [SELECT Id, Name FROM cv__Engagement_Channel__c WHERE Name IN :classificationTypePriorities.keySet()]) {
            classificationTypes.put(c.Name, c.Id);
           
        }

for(Opportunity opp : trigger.new){

if(opp.RecordTypeId == rd.Id && opp.cv__Contact__r.cv__Primary_Engagement_Channel__r.id ==classificationTypes.get('Prospect')&& (opp.Child_ID__c == null || opp.Child_ID__c == ''))

conids.add(opp.cv__Contact__c);
}

 and the test clas is

static testMethod void testAssignmentType()
    {
      
     List<cv__Engagement_Channel__c> classificationTypesList = new List<cv__Engagement_Channel__c>{
            new cv__Engagement_Channel__c(Name = 'Sustainer'),
            new cv__Engagement_Channel__c(Name = 'Donor'),
            new cv__Engagement_Channel__c(Name = 'Fundraiser'),
            new cv__Engagement_Channel__c(Name = 'Buyer'),
            new cv__Engagement_Channel__c(Name = 'Activist'),
            new cv__Engagement_Channel__c(Name = 'Volunteer'),
             new cv__Engagement_Channel__c(Name = 'Prospect'),
            new cv__Engagement_Channel__c(Name = 'Lead')
                 };
        insert classificationTypesList;
       
          Map<String , Id> classificationTypes = new Map<String, Id>();
        for (cv__Engagement_Channel__c ct : classificationTypesList) {
            classificationTypes.put(ct.Name, ct.Id);
        }

List<RecordType> rt = [Select Id From RecordType Where Name = 'Household' and SobjectType = 'Account'];
        Account a = new Account();
        a.recordtypeId = rt[0].Id;
        a.Name = 'Test';
        insert a;
              
        Contact c = new Contact();
        c.lastName='testing';
        c.Client_Id__c = '42412';
        c.AccountId = a.Id;
      c.cv__Primary_Engagement_Channel__c = classificationTypes.get('Prospect');
        c.cv__Addressee__c = 'Mr.xyz';
           insert c;
            
          
RecordType rd = [SELECT Id FROM RecordType WHERE SObjectType = 'Opportunity' AND Name = 'Recurring Donation'];
       
        Opportunity opp = new Opportunity();
                    opp.RecordTypeId = rd.Id;
                    opp.cv__Recurring_Gift__c = rg.id;
                    opp.Name = 'Test Opp';
                    opp.AccountId = a.id;
                    opp.cv__Contact__c = c.id;
                     opp.CampaignId = cn.id;
                    opp.Amount = 30;
                    opp.CloseDate = Date.today();
                    opp.StageName = 'Received';
                    opp.cv__Payment_Type__c = 'Check';
        insert opp;
       System.debug('primary classification'+opp.cv__Contact__r.cv__Primary_Engagement_Channel__c) ;

Not sure whats going on but the debug logs shows opp.cv__Contact__r.cv__Primary_Engagement_Channel__c as null . Any help is appreciated
HI,

I have to implement webservices(consuming ws) for a new requirement and the wsdl file which the webservice provider has given me has only soap12 binding and salesforce doesn't support it. Is there any workaround for this. Is there any other way of implementing this?  I have been google seraching it form days and couldn't find anything . Any help is greatly appreciated.

Thanks
Hi,

Iam trying to implement webservices where i need to post the data from salesforce to external syatem and i wrote an apex class with POST request and i get the below error

The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree".

What does the error mean??

Thanks. Any help is appreciated.
Hi,

Iam trying to use http POST request to enter data from salesforce to external system.  My WSDl file contans below soapAction

-<wsdl:operation name="AddCustomerData">
<soap12:operation style="document" soapAction="http://xxxx.org/WebServices/AddCustomerData"/>

Salesforce doesnot support SOAP 1.2 , so does that mean i cannot use the webservices for POSt operation too? The WSDL file i got only has SOAP12 operations. How can make it work so that i can use webservices to POST and GET data.

Thanks
I need to use wenservices to enter data to the external satem. I wrote a triggre and used @future in the Apex class to do this.But iam getting the response as [Status=Bad Request, StatusCode=400]. Not sure how to set the body for POSt request with application/soap+xml content type.  Below is my code. An help is appreciated

HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();

req.setEndpoint('https://testurl');
req.setMethod('POST');

String username = 'test';
String password = 'test';


Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setTimeout(100000);
req.setHeader('Content-Type', 'application/soap+xml; charset=utf-8');
req.setCompressed(false);
req.setBody('Customer= 500269677900& Name=TestCallout');


try {
    res = http.send(req);
} catch(System.CalloutException e) {
    System.debug('Callout error: '+ e);
}

Thanks

Hi,

I have a requirement where i need to send a data upon creation to an external hub using Webservices. I mean when a record in a custom object is created , the data in the fields should also get stored in the external system. Any ideas on how do this is really appreciated.

Thanks
Need help with a button code .I have a custom object and  I need a list view button where user clicks the button and it should be able to pull the records based on the below criteria.
if the two fields are same like there is number field and a picklist field. For ex if there are three duplicate records with 1234 as number and picklist value as  test dupes then i need to update a checkbox field as true on those three records.

Any help is appreciated.

Thanks

Hi,

 

I have an after update trigger and iam getting the below error

 

System.DmlException: Update failed. First exception on row 0 with id a0zc0000001JnZLAA0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You are above your limit to select "Pay All" Action: []: Trigger.updateAlertItems: line 47, column 1

 

How can i get only the red highlighted error message which is a validation rule error message instead of that whole trigger FIELD_CUSTOM_VALIDATION_EXCEPTION error

 

Below is the trigger

 

trigger updateAlertItems on Alerts__c (after update) {

Set<ID> ids = Trigger.newMap.keySet();
List<Alerts__c> updatedParents = [SELECT Id, Calculated_Balance__c ,
(SELECT Id, Action__c , Pay_Validation_Rule_Check_1__c , Pay_Validation_Rule_Check_2__c , Pay_Validation_Rule_Check_3__c
from Alert_Items__r ) FROM Alerts__c
WHERE Id in :ids];


List<Alert_Items__c> childrenToUpdate = new List<Alert_Items__c>();

for ( Alerts__c p : updatedParents)
{

if(trigger.oldMap.get(p.id).Action__c!= p.Action__c)
{
system.debug('Enter here 1');
for(Alert_Items__c kid : p.Alert_Items__r)
{

if(p.Action__c == 'Pay All')
{
System.debug('Enter here 2');
kid .Action__c= 'Pay';
}

if(p.Action__c == 'Return All')
{
kid .Action__c= 'Return';

}

childrenToUpdate.add(kid);
}
}
}

if( !childrenToUpdate.isEmpty())
{

System.debug('Enter here 3');
update childrenToUpdate;

}

}

 

Thanks

 

Hi All,

 

Iam getting the error of too many code statements for my below class. I know its because of the for loops which iterates 40 times and each statement is counted against code statement. But iam not sure of what the workaround would be to overcome this error.

 

global class OCrLine1 implements Schedulable{
global void execute(SchedulableContext SC) {

Set<Id> ids = new Set<Id>();
Map<Id , String> ocrMap = new Map<Id , String>();
Integer ifactor= 2;
Integer iResult;
Integer iSum = 0;
Integer i;
String total;
List<Contact> contacts = new List<Contact>();

List<Contact> cons = [Select id ,Total_Due__c, OCR_Check_Digit__c,OCR_ClientID__c,Billing_Cycle__c ,PayNotIfType__c from Contact where Billing_Cycle__c = '1' AND PayNotIfType__c = 'Statement' AND Number_Of_Sponsored_Children__c!=0];
List<cv__Recurring_Gift_Designation_Relationship__c> rdg = [Select id , cv__Recurring_Gift__r.cv__Contact__c ,cv__Recurring_Gift__r.cv__Recurring_Gift_Status__c, cv__Designation__r.Name from cv__Recurring_Gift_Designation_Relationship__c
where cv__Designation__r.Name != 'Child Sponsorship' AND cv__Recurring_Gift__r.cv__Recurring_Gift_Status__c = 'Active' ];

for(Contact c : cons)
{
ids.add(c.id);
}

for(cv__Recurring_Gift_Designation_Relationship__c rr : rdg)
{
ids.add(rr.cv__Recurring_Gift__r.cv__Contact__c);
}

Map<Id, Double> ChildBalance = new Map<Id,Double>();

for(AggregateResult groupedResults:[SELECT sum(Total_Amount_Due__c) Due , cv__Contact__c from cv__Recurring_Gift__c Where cv__Recurring_Gift_Status__c='Active'
AND cv__Payment_Type__c = 'Check'AND cv__Next_Payment_date__c <= THIS_MONTH AND cv__Contact__c IN :ids Group By cv__Contact__c ]){

ChildBalance.put((String)groupedResults.get('cv__Contact__c'),(Double)groupedResults.get('Due'));
}

for(Contact c : cons){
if(ChildBalance.get(c.id)!=null)
c.Total_Due__c = ChildBalance.get(c.id);
else
c.Total_Due__c = 0;
if(c.Total_Due__c==0)
total = '000000';
else
total = String.valueOf(c.Total_Due__c);
if(total.contains('.'))
total = total.remove('.');

if(total.length()==3)
total = '00'+total+'0';
if(total.Length()==4)
total = '0'+total+'0';
if(total.length()==5)
total = total+'0';
else
total = total;

ocrMap.put(c.id , c.OCR_ClientID__c+'01000000000000000000000000'+total);
for(i=0; i<=40 ; i++){
if(i<40)
iResult = Integer.valueOf(ocrMap.get(c.id).SubString(i,i+1))* iFactor;
if(i==40)
iResult = Integer.valueOf(ocrMap.get(c.id).right(1))* iFactor;

if(iResult>9){
iResult = Integer.valueOf(String.valueOf(iResult).SubString(1,2)) + Integer.valueOf(String.valueOf(iResult).right(1));
}
iSum = iSum+iResult;


if(iFactor == 1)
iFactor = 2;
else
iFactor = 1;
}

iResult = math.mod(iSum,10);

if(iResult == 0)
c.OCR_Check_Digit__c = '0';
else
c.OCR_Check_Digit__c = String.valueOf(10-iResult);

contacts.add(c);
}
if(contacts.size()>0)
update contacts;


}
}

 

Any help is greatly appreciated.

 

Thanks

Hi,

 

Iam trying to execute a simple code . Its supposed to show the output as 3 but its throwing error at the for loop. Not sure whats wrong.  Here is the below code

 

Integer ifactor= 2;
Integer iResult;
Integer iSum = 0;
Integer i;
String OCR_Line = '0000000401000000000000000000000000002800';
Integer OCR_Check_Digit;

for(i=0; i<=40 ; i++){
iResult = Integer.valueOf(OCR_Line.SubString(i,1))* iFactor;

if(iResult>9){
iResult = Integer.valueOf(String.valueOf(iResult).SubString(1,1)) + Integer.valueOf(String.valueOf(iResult).SubString(2,1));
}
iSum = iSum+iResult;

if(iFactor == 1)
iFactor = 2;
else
iFactor = 1;
}

iResult = math.mod(iSum,10);

if(iResult == 0)
OCR_Check_Digit = 0;
else
OCR_Check_Digit = 10-iResult;

 

The OCR_Check_Digit should show the output as 3.

Is there any way in the Report we can get only the latest opportunity associated to an Account? and anothet report with largest opportunity Amount ?

 

Thanks

Hi,

I have a batch class which runs and attached like hundreds of text files to the Document object and i have a vf page and controller to get all the data in that documents into one big text file. The size of the file would be around 9MB. But iam getting the Apex heap sze too large error. Is it possible to generate a 9 MB text file from a vf page??

Here is my code

<apex:page standardController="Child__c" extensions="DocumentController" contentType="text/plain/#testfile" cache="false" >
<apex:repeat value="{!lstStringOutput}" var="str">
{!str}
</apex:repeat>
</apex:page>

Conrtoller:
public with sharing class DocumentController {
public List<String> lstStringOutput {get;set;}
Public Static String text;
    public DocumentController(ApexPages.StandardController controller) {

         lstStringOutput = new List<String>();
          Folder folder = [select id from Folder where name='Test file' LIMIT 1];
        
        for(Document doc : [Select id, Description , Body , folderId from Document where folderId = :folder.id ]){
          text= doc.Body.toString();
             lstStringOutput.add(text+'\r');
           } 
}
}
Thanks

Hi All,

 

Iam new to this OCR(Optical Character recognition). Right now we have a requirement to integrate OCR with Salesforce. Is there any APP out there which can do this?

 

Thanks

Hi,

What iam trying to acheive here is the affiliated tracking. we have different affiliates and there is button on each of their websites which will redirect to a force.com site visualforce page of our company. They all have a input hidden filed which stores the affiliate code. I need to be able to capture that code when its redirected to the force.com site and store it on a field in salesforce. What is the best way to acheive it. Any help is greatly appreciated.

Thanks
Hi,

Iam trying to schedule a apex job that runs for every 30 mins from 6PM to 11 PM. Here is the scheduler iam trying to use

ScheduledClass obj= new ScheduledClass();
String sch = '0 0,30 18,19,20,21,22,23 ? * MON-FRI';
System.schedule('My Job', sch, obj);

But iam getting the below error

System.StringException: Seconds and minutes must be specified as integers: 0 15,30,45 18,19,20,21,22,23 ? * MON-FRI

Is there any way we could scehdule a job which could run for every 30 mins starting from  6 PM and ending at 11.30 PM??

Thanks
So i am looking to compare a picklist value to a name field where i take the value of the picklist and see if the name field contains that value. The formula works but however it only returns "match" when the name field is blank which is incorrect. Does anyone see what i am doing wrong.

IF(ISPICKVAL( Site__r.Support_Package__c , "Support") && CONTAINS("Support", Product__r.Name), "Match",
IF(ISPICKVAL( Site__r.Support_Package__c , "Enhanced") && CONTAINS("Enhanced", Product__r.Name), "Match",
IF(ISPICKVAL( Site__r.Support_Package__c , "Premium") && CONTAINS("Premium", Product__r.Name), "Match", "Different")))

Thanks.....
Hi,

I have a batch class which runs and attached like hundreds of text files to the Document object and i have a vf page and controller to get all the data in that documents into one big text file. The size of the file would be around 9MB. But iam getting the Apex heap sze too large error. Is it possible to generate a 9 MB text file from a vf page??

Here is my code

<apex:page standardController="Child__c" extensions="DocumentController" contentType="text/plain/#testfile" cache="false" >
<apex:repeat value="{!lstStringOutput}" var="str">
{!str}
</apex:repeat>
</apex:page>

Conrtoller:
public with sharing class DocumentController {
public List<String> lstStringOutput {get;set;}
Public Static String text;
    public DocumentController(ApexPages.StandardController controller) {

         lstStringOutput = new List<String>();
          Folder folder = [select id from Folder where name='Test file' LIMIT 1];
        
        for(Document doc : [Select id, Description , Body , folderId from Document where folderId = :folder.id ]){
          text= doc.Body.toString();
             lstStringOutput.add(text+'\r');
           } 
}
}
Thanks

I have field called 'Length MT' (number type). I would like to update this field by a value from my another field 'MAIN ASSY HOSE LENGTH' (number type), but if another field 'Hose Accessories' name contain 'None', formula should use '0.00' value.

Is it possible to create above working formula for updating my custom field?
Thank you for any help
Hi,
I have a  custom object Opportunity Service Line Item which has lookup relation to opportunity.
I have a field in Opportunity Service Line Item called 'TCV'.
Each Opportunity Line Item can have multiple Service Line Items.
I want to write a trigger to calculate the sum of TCV for all the Service Line Items and update in Opportunity Object.
Can anyone please provide a sample trigger for this.

Thanks,
Ipsita
I have the below trigger, to update a child if a field on the parent is a specific value. 

I am getting the below error

Error: Compile Error: Invalid field Status__c for SObject ADR__c at line 28 column 1


trigger ADRParentUpdateChild on ADR__c ( after update, after insert) {

List<ADR__c > ParentRecords= [Select id, Next_Step__c, (Select ADR__c, Status__c FROM ADRUser__r) from ADR__c  WHERE id IN :Trigger.newMap.keySet()];

for(ADR__c parent: ParentRecords){
if(parent.Next_Step__c == 'Submit'){
   
parent.Status__c = 'Submit';
   }
   }
   
}
Hi,

Iam trying to implement webservices where i need to post the data from salesforce to external syatem and i wrote an apex class with POST request and i get the below error

The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree".

What does the error mean??

Thanks. Any help is appreciated.
Hi All,

I want to send multiple attachments to salesforce using Bulk API.

please tell me what should be the endpoint in this case,what should be my CSV format ,what all headers I'll be including and other stuff if you know which could help me

Thanks in advance!!
Hi,

Iam trying to use http POST request to enter data from salesforce to external system.  My WSDl file contans below soapAction

-<wsdl:operation name="AddCustomerData">
<soap12:operation style="document" soapAction="http://xxxx.org/WebServices/AddCustomerData"/>

Salesforce doesnot support SOAP 1.2 , so does that mean i cannot use the webservices for POSt operation too? The WSDL file i got only has SOAP12 operations. How can make it work so that i can use webservices to POST and GET data.

Thanks
I need to use wenservices to enter data to the external satem. I wrote a triggre and used @future in the Apex class to do this.But iam getting the response as [Status=Bad Request, StatusCode=400]. Not sure how to set the body for POSt request with application/soap+xml content type.  Below is my code. An help is appreciated

HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();

req.setEndpoint('https://testurl');
req.setMethod('POST');

String username = 'test';
String password = 'test';


Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setTimeout(100000);
req.setHeader('Content-Type', 'application/soap+xml; charset=utf-8');
req.setCompressed(false);
req.setBody('Customer= 500269677900& Name=TestCallout');


try {
    res = http.send(req);
} catch(System.CalloutException e) {
    System.debug('Callout error: '+ e);
}

Thanks

Hi,

I have a requirement where i need to send a data upon creation to an external hub using Webservices. I mean when a record in a custom object is created , the data in the fields should also get stored in the external system. Any ideas on how do this is really appreciated.

Thanks