• Raffi
  • NEWBIE
  • 50 Points
  • Member since 2011

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

I'm trying to update currency rates from our ERP through a SOAP API call to Salesforce. I'm getting update success returned and the timestamp on LastModifiedDate shows that the sObject are in fact being updated but the values do not actually change.  I'm using the following code:

 

List<sObject> ctList = new List<sObject>();

                while (queryResult.size > i)
                {
                    CurrencyType ct = (CurrencyType)queryResult.records[i];
                    CurrencyType c = new CurrencyType(); // contains fields to be updated
                    
                    if (ct.IsoCode == "USD")
                    {
                        c.Id = ct.Id;
                        c.ConversionRate = curr_USD;
                    }
                    if (ct.IsoCode == "EUR")
                    {
                        c.Id = ct.Id;
                        c.ConversionRate = curr_EUR;
                    }
                    ctList.Add(c);
                    i++;                    
                }

                updateSObject(ctList); // calls update metod to SFDC

 Any ideas why?

 

Thanks,

  • July 17, 2013
  • Like
  • 0

I created a sample test VF page displaying assets in customer portal (High Volume Customer Portal).  Access privleges are setup correctly, I can see the page as a portal user, except no data gets displayed, all assets are displayed when logged in as standard user.  I understand that Asset Tab can not be displayed in portal, but there is no mention of custom pages displaying assets (customer portal notes). Furthermore, customer can view/select their assets when opening a Case from the portal. At this point, I just want to find out if this is suppose to work, and if so what am I missing or do we need different portal license.  According to Tier 1 SF support this should work but without Premier Support Tier 2 will not help.

 

Thanks,

  • March 25, 2013
  • Like
  • 0

Hello,

 

I created this very simple VS page and supporting cotroller to send out an email upon page load. The send() function executes fine, but the recepient does not get the email.  I've succesfully run the Email Deliverability Tool and checked corporate mail filter without success.  I must be missing something very obvious here.

 

Thanks,

Raf 

 

 

<apex:page controller="sendEmailController">
  <apex:outputText value="{!errorMessage}"/>

</apex:page>


public class sendEmailController {

    public String errorMessage {get; set;}

    public sendEmailController(){
           send();
    }
    
    public PageReference send(){

        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
        email.setSubject('Test email from Salesforce');
        String[] toAddresses = new String[] {'username@company.com'};
        email.setToAddresses(toAddresses);
        email.setPlainTextBody('sent from quoteSendToCop');
        
        Messaging.SendEmailResult [] r = 
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   
        
        if (!r.get(0).isSuccess()) {
            System.StatusCode statusCode = r.get(0).getErrors()[0].getStatusCode();
            errorMessage = r.get(0).getErrors()[0].getMessage();
        } else {errorMessage = 'success';}
            
        return null;
    }
}

 

 

  • February 13, 2012
  • Like
  • 0
I want to create a child of OpportunitiyLineItem object, say OpportunityLineItemProfitSchedule but there is no option to create the neither master-detail nor lookup relationship to OpportunityLineItem object, i.e.. OpportunityLineItem object is not available in a drop down list of available objects. Is there a different way to set this up?
  • December 22, 2011
  • Like
  • 0

I'm trying to update currency rates from our ERP through a SOAP API call to Salesforce. I'm getting update success returned and the timestamp on LastModifiedDate shows that the sObject are in fact being updated but the values do not actually change.  I'm using the following code:

 

List<sObject> ctList = new List<sObject>();

                while (queryResult.size > i)
                {
                    CurrencyType ct = (CurrencyType)queryResult.records[i];
                    CurrencyType c = new CurrencyType(); // contains fields to be updated
                    
                    if (ct.IsoCode == "USD")
                    {
                        c.Id = ct.Id;
                        c.ConversionRate = curr_USD;
                    }
                    if (ct.IsoCode == "EUR")
                    {
                        c.Id = ct.Id;
                        c.ConversionRate = curr_EUR;
                    }
                    ctList.Add(c);
                    i++;                    
                }

                updateSObject(ctList); // calls update metod to SFDC

 Any ideas why?

 

Thanks,

  • July 17, 2013
  • Like
  • 0

Hello,

 

I created this very simple VS page and supporting cotroller to send out an email upon page load. The send() function executes fine, but the recepient does not get the email.  I've succesfully run the Email Deliverability Tool and checked corporate mail filter without success.  I must be missing something very obvious here.

 

Thanks,

Raf 

 

 

<apex:page controller="sendEmailController">
  <apex:outputText value="{!errorMessage}"/>

</apex:page>


public class sendEmailController {

    public String errorMessage {get; set;}

    public sendEmailController(){
           send();
    }
    
    public PageReference send(){

        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
        email.setSubject('Test email from Salesforce');
        String[] toAddresses = new String[] {'username@company.com'};
        email.setToAddresses(toAddresses);
        email.setPlainTextBody('sent from quoteSendToCop');
        
        Messaging.SendEmailResult [] r = 
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   
        
        if (!r.get(0).isSuccess()) {
            System.StatusCode statusCode = r.get(0).getErrors()[0].getStatusCode();
            errorMessage = r.get(0).getErrors()[0].getMessage();
        } else {errorMessage = 'success';}
            
        return null;
    }
}

 

 

  • February 13, 2012
  • Like
  • 0
I want to create a child of OpportunitiyLineItem object, say OpportunityLineItemProfitSchedule but there is no option to create the neither master-detail nor lookup relationship to OpportunityLineItem object, i.e.. OpportunityLineItem object is not available in a drop down list of available objects. Is there a different way to set this up?
  • December 22, 2011
  • Like
  • 0
The code below runs fine and prints the ID of the newly created object, but when I look in the app, AnnualRevenue is blank!

sforce.Account newAcc = new sforce.Account();
newAcc.Name = "Test Account";
newAcc.AnnualRevenue = 10000;
sforce.SaveResult [] sr = svc.create ( new sforce.sObject[] { newAcc } );
if(sr[0].success)
{
Console.WriteLine("new id of account is {0}", sr[0].id); } else {
Console.WriteLine("error creating account {0}", sr[0].errors[0].message);
}


What's happening is that for field type's that do not support being null in .NET, the generated .NET code includes an additional property that indicates if it should send the value. Unfortuanly even if you explicitly set a value, the property that says to send the value doesn't get set. You need to also set that property as well. These properties have "Specified" appended to the property name they apply to, so the above example should be

sforce.Account newAcc = new sforce.Account();
newAcc.Name = "Test Account";
newAcc.AnnualRevenue = 10000;
newAcc.AnnualRevenueSpecified = true;
sforce.SaveResult [] sr = svc.create ( new sforce.sObject[] { newAcc } );
if(sr[0].success)
{
Console.WriteLine("new id of account is {0}", sr[0].id); } else {
Console.WriteLine("error creating account {0}", sr[0].errors[0].message); }
}

If you run this revised version, you'll see the AnnualRevenue value in the application. Properties of type DateTime, bool, int and double all have these additional specified flags.