• rob_ocp
  • NEWBIE
  • 10 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
We are trying to do a trigger to calculate the amount in USD and store in a custom field in Opportunity. But I am facing the NullPointerException

Code:
trigger opptyAmountNusd on Opportunity (after update) {
//Calculates the USD equivalent and updates in another field

if (Trigger.isUpdate) {
    //for (Opportunity o_oppty : Trigger.old) {
   
    Opportunity[] opps = new List<Opportunity>();
        for (Opportunity n_oppty : Trigger.new) {
            Opportunity opp_tmp = n_oppty;
           
            if ((n_oppty.Amount != 0) ||(n_oppty.Amount != NULL) ) {
                    Decimal a = n_oppty.Amount;
                    String c = n_oppty.CurrencyIsoCode.substring(0,3);
                   
                    CurrencyType ct = [Select ConversionRate from CurrencyType where IsoCode=:c limit 1][0];
           
                    Decimal cr = ct.ConversionRate;
                   
                    opp_tmp.Amount_In_USD__c = cr*a;
                    opps.add(opp_tmp);
                   
                    //n_oppty.Amount_In_USD__c = cr*a;      
            }
        }
    //}
   
     for (Opportunity opp_tmp : opps) {
    
         update opp_tmp;
     }
}



}

Message Edited by rob_ocp on 07-10-2008 11:08 AM

Message Edited by rob_ocp on 07-10-2008 11:11 AM
I am in the midst of testing the Salesforce Mobile with the Blackberry Simulator B8707g.
I am recieving the below error message.
"Unable to register your Simulator because you are attempting to create a Simulator device and the device address is in use by another user"

How to change the device address? Have anyone of used this simulator?
Any lead to this issue is much appreciated.

Hi All,
 
I'm in the midst of using Print Anything.
The Tutorial of Print Invitation works fine when I log in as System Administrator.
But when I login as another user with non-system administrator profile, the below error message pops up
 

INVALID_TYPE: pkg.PRINTANY__Templates__r tmp) from PRINTANY__Package__c pkg where pkg.PRINTANY__Name__c ^ ERROR at Row:1:Column:166 sObject type 'PRINTANY__Package__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

Any lead is much appreciated.

regards

Rob.

 


 
Hi All,
 
I'm new to SFDC development.
We are in the midst of configuring Case.
There are two custom fields Employee Name (lookup of user) and Employee E-mail in the Case.
I wanted to perform a functionality such a way that when employee name is selected then corresponding e-mail should be populated in the employee e-mail.
How to implement this functionality?
 
Your help is appreciated.
 
We are trying to do a trigger to calculate the amount in USD and store in a custom field in Opportunity. But I am facing the NullPointerException

Code:
trigger opptyAmountNusd on Opportunity (after update) {
//Calculates the USD equivalent and updates in another field

if (Trigger.isUpdate) {
    //for (Opportunity o_oppty : Trigger.old) {
   
    Opportunity[] opps = new List<Opportunity>();
        for (Opportunity n_oppty : Trigger.new) {
            Opportunity opp_tmp = n_oppty;
           
            if ((n_oppty.Amount != 0) ||(n_oppty.Amount != NULL) ) {
                    Decimal a = n_oppty.Amount;
                    String c = n_oppty.CurrencyIsoCode.substring(0,3);
                   
                    CurrencyType ct = [Select ConversionRate from CurrencyType where IsoCode=:c limit 1][0];
           
                    Decimal cr = ct.ConversionRate;
                   
                    opp_tmp.Amount_In_USD__c = cr*a;
                    opps.add(opp_tmp);
                   
                    //n_oppty.Amount_In_USD__c = cr*a;      
            }
        }
    //}
   
     for (Opportunity opp_tmp : opps) {
    
         update opp_tmp;
     }
}



}

Message Edited by rob_ocp on 07-10-2008 11:08 AM

Message Edited by rob_ocp on 07-10-2008 11:11 AM
I am in the midst of testing the Salesforce Mobile with the Blackberry Simulator B8707g.
I am recieving the below error message.
"Unable to register your Simulator because you are attempting to create a Simulator device and the device address is in use by another user"

How to change the device address? Have anyone of used this simulator?
Any lead to this issue is much appreciated.

Hi All,
 
I'm in the midst of using Print Anything.
The Tutorial of Print Invitation works fine when I log in as System Administrator.
But when I login as another user with non-system administrator profile, the below error message pops up
 

INVALID_TYPE: pkg.PRINTANY__Templates__r tmp) from PRINTANY__Package__c pkg where pkg.PRINTANY__Name__c ^ ERROR at Row:1:Column:166 sObject type 'PRINTANY__Package__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

Any lead is much appreciated.

regards

Rob.

 


 
When prompted by the apex data loader I enter my salesforce.com username and password, but this message keeps appearing:

Error logging in to Salesforce. Please check your username and password.

When I login to salesforce.com with the same username and password it works.

Does anyone know why I can't login to the data loader?


Message Edited by Lkc037 on 12-11-2007 11:49 AM
  • December 11, 2007
  • Like
  • 0
When implementing a print anything document everything looks fine in IE 6 or 7 but firefox outputs garbage character stream. Does anyone know why??
  • May 10, 2007
  • Like
  • 0
Hi
I am facing an issue in following scenerio.
1. Account is in Currency Type "AUD"
2. want to update amount in  USD currency (which is corporate currency) 
 
How can I explicitly do it?
 
 
Thanks,
 
Shakil
  • December 01, 2006
  • Like
  • 0