• cog
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 13
    Replies
Hi,

How can we aceess or use "ASP.net WSDL" in Apex class.
when i am trying to use this its give the following error
"Failed to parse wsdl: Found more than one wsdl:binding. WSDL with multiple binding not supported"

Please help


  • February 20, 2008
  • Like
  • 0

I know that the Metadata API doesn't support the deletion of existing picklist values. Are there any workarounds for this? Any ideas?

 

Thanks for your time.

  • September 07, 2011
  • Like
  • 0

How to  add ideas application in developer edition?

Hi,

   I created Page for custom save controller. my page apex code given below...

 

<apex:page controller="newOpportunityController11" tabStyle="Account">
<apex:form >
<apex:pageBlock title="Congratulations">
<apex:inputField value="{!Invoice.Name}"/>
<apex:inputField value="{!Invoice.Line_Item__c}"/>
<apex:inputField value="{!Invoice.Pay_by_Date__c}"/>
<apex:inputField value="{!Invoice.Total_Amount__c}"/>
<apex:inputField value="{!Invoice.Client_Name__c}"/>
<apex:inputField value="{!Invoice.Invoice_Status__c}"/>
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlock>
</apex:form>
</apex:page>
and my apex class is...
public class newOpportunityController11
 {  
Opportunity opportunity;
public Invoice__c invoice{ get; set; }
public Opportunity getOpportunity() {
//if(opportunity == null) opportunity = new Opportunity();
return opportunity;
}
public Invoice__c getinvoice() {
//if(Invoice == null) Invoice = new Invoice__c();
Id id = ApexPages.currentPage().getParameters().get('id');
invoice= [SELECT Client_Name__c,Invoice_Status__c,Line_Item__c,Pay_by_Date__c,Total_Amount__c FROM Invoice__c WHERE id = :id];
return invoice;
}
public PageReference cancel() {
PageReference opportunityPage = new ApexPages.StandardController(opportunity).view();
opportunityPage.setRedirect(true);
return opportunityPage;
}
public PageReference save() 
{
update invoice;
return null;
}
}
the above page and class was successfully save without error... and then when i run this page and enter the data then click save button the error given below error is occur...
System.NullPointerException: Attempt to de-reference a null object

 

Class.newOpportunityController11.save: line 47, column 8 External entry point
How to solve this....pls help

 

 

 

 

 

  • January 25, 2011
  • Like
  • 0

Hi all,

 

I want to create a rollup summary field which sums up the amount from its child records.

This summing of amounts should take place only if flag is checked on the child record. Otherwise, the rollup field should ignore this amount field on the child records.

 

Really appreciate any help or idea on how to implement this.

 

Thanks,

VK86

  • June 15, 2010
  • Like
  • 0

You can use Dynamic DML to insert untyped SObjects one-at-a-time, but not as an array:

SObjectType token = Schema.getGlobalDescribe().get('contact');
SObject[] objs = new SObject[0];
for (integer i = 0; i<2; i++) {
SObject tmp = token.newSObject();
tmp.put('LastName', 'test' + i);
objs.add(tmp);
}

boolean showBug = true;

if (showBug) { // fails with "DML not allowed on abstract class SObject"
insert objs;
}
else { // works
for (SObject i : objs) insert i;
}

 

 

  • April 15, 2010
  • Like
  • 0

I would like to determine current total apex script size against stated governor limit of 1MB.  I would also like a break down per Apex class/trigger.  Is this possible?

 

I've review the Limit methods.  Would any of the following API provide this information:

 

  • runTests
  • compileAndTest
  • compileClasses
  • compileTriggers

 

Thanks in advance for any assistance.

I just created a custom app and it has everything the marketing group wanted. However, at the end of the approval process it needs to send an email with the contents of the record (which is no problem) AND a listing of the related items.

I'm not sure how to send that list since it could be one entry or many and it is not part of the main object. It has a lookup relationship to the main object though.

 

Is there a way to somehow query the related list using Apex or some other method so that I could return the items in an email?

 

 

Thanks

Hi,
 
I have created an email template in Visualforce which displays a form including checkboxes, text boxes and labels. Everything works fine except the checkboxes. The checkbox values doesnt display in the outlook email, nor does a image of a checkbox. Instead I see a Image box with a red cross sign.
 
Code:
<apex:outputLabel rendered="{!relatedTo.LAN__c}"><apex:image url="https://na1.salesforce.com/servlet/servlet.FileDownload—file=01530000000dpeZ"/></apex:outputLabel>
<apex:outputLabel rendered="{!!relatedTo.LAN__c}"><apex:image url="https://na1.salesforce.com/servlet/servlet.FileDownload–file=01530000000dpee"/></apex:outputLabel>
 

The checkbox image has been stored in the Documents folder in salesforce and I have made it externally availaible. 
I tried using a static Resource which did not work either. Also, I have modified my outlook settings to display images but still dont see the image.
 
Please let me know,
Anchal
I have an Apex trigger that writes "Lead Status History" to a custom object I've made called "Lead_Status_History__c". It fires whenever the lead status changes on a lead. The problem I am having is that the trigger is firing twice on a specific Lead Status.
 
I believe the reason why it is firing twice on this specific lead status is because I have a workflow rule set up on the lead. When the lead status is changed to that specific status, it performs a field update on a date field on the lead, and I believe that this field update is causing my trigger to fire again.
 
To rehash the order of execution when it comes to triggers, I'll highlight the steps that are relevant to me:
 

1. The original record loads from the database or initializes for an insert operation
2. The new values load from the incoming request and overwrite the old values in the record buffer. The old values are saved in the old context variable for update triggers.
3. Before triggers run.
...
5. The record is saved to the database, but the record is not committed.
6. After triggers run.
...
8. Workflow rules execute. If field updates are specified, the record updates again, and before and after triggers for the update fire.
...
10. All data manipulation operations are committed to the database.


I believe step 8 is causing my trigger to fire again. Is there anyway to prevent triggers from doing a repeat action if step 8 causes your trigger to fire again?

Here is my apex trigger code:

Code:
trigger LeadStatusHistoryTrigger on Lead (before update) 
{
 // Declare a list of Lead_Status_History__c to be insertedin Salesforce
 List<Lead_Status_History__c> LeadStatusHistoryObjects = new List<Lead_Status_History__c>();
 
 // If the trigger is an update trigger insert all the new status changes
 if ( Trigger.isUpdate )
 {
  for ( Lead l_new: Trigger.new )
  {
    // Check to see if the status of the old and new lead values are the same.
    // If they are different then we create a new entry in the lead_status_history custom object
    if ( l_new.Status != Trigger.oldMap.get( l_new.Id ).Status )
    {
     LeadStatusHistoryObjects.add( new Lead_Status_History__c ( Lead__c = l_new.Id, Lead_Status_New__c = l_new.Status, Lead_Status_Old__c = Trigger.oldMap.get( l_new.Id ).Status ) ); 
    }
  }
  
  // After all the new Lead Status History items have been added, now insert them into Salesforce
  try
  {
   insert LeadStatusHistoryObjects;
  }
  catch (DmlException de)
  {
   for ( integer i = 0; i < de.getNumDml(); i++ )
   {
    System.debug('LeadStatusHistoryTrigger Error Inserting Lead Status History Objects: ' + de.getDmlMessage(i));
   } 
  }
  
 }
}


 

  • November 17, 2008
  • Like
  • 0
I was having difficulty with migrating email templates and finally figured out that it was not seeing any templates in folders.

I can move templates from the 'unfilled' 'folder just fine now.

I tried using the 'folder' type and many other variations for 'emailtemplate' with no sucess. There are no examples I can find for the syntax to migrate email templates and folders. Does anyone have a sample here?

Thanks

  • September 18, 2008
  • Like
  • 0
Hi everyone.  

   Is there a Apex class method to get current Salesforce.com instance or URL at runtime?

I want to generate hyperlinks like https://na4.salesforce.com/{accountId} in code.  But I don't want to hard code 'na4'.

Every time I deploy the same code back to Sandbox, I must fix the instance manually.

Thanks in advance.


  • August 04, 2008
  • Like
  • 0
Hi,

How can we aceess or use "ASP.net WSDL" in Apex class.
when i am trying to use this its give the following error
"Failed to parse wsdl: Found more than one wsdl:binding. WSDL with multiple binding not supported"

Please help


  • February 20, 2008
  • Like
  • 0
Ok, I'm getting the following error when using this Apex Trigger.

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger copyMSGIdCases caused an unexpected exception, contact your administrator: copyMSGIdCases: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.copyMSGIdCases: line 21, column 56

Here is the code I am using:

Code:
// This trigger assigns a value to the MSG_ID__c custom field on cases before the new case
// is saved to the database.

trigger copyMSGIdCases on Case (before insert, before update) {
 // Determine the account
 Set<ID> accIds = new Set<ID>();
 for (Case cas : Trigger.new)
  accIds.add(cas.accountid);
 // Query the Account to get the MSG_ID__c entry
 Map<Id, Account> entries = new Map<Id, Account>(
  [select MSG_ID__c, PAS_ID__c from Account
  where id in :accIds]);
 
 // Now set the Account_MSG_ID__c on the Contact to be the same as MSG_ID__c on the
 // related account
 // Now set the PAS_Account_ID__c on the Case to be the same as PAS_ID__c on the
 // related account
 for (Case cas : Trigger.new)
 cas.MSG_ID__c = entries.get(cas.AccountId).MSG_ID__c;
 for (Case cas : Trigger.new)
 cas.PAS_Account_ID__c = entries.get(cas.AccountId).PAS_ID__c;

}
Now, I'm sure this can be done in a different way, but I went this route because I wanted to learn more about Apex Triggers.

So here is the funny thing, I only get this error if I am trying to create a new case as an regular user in SFDC. If I am logged in as the System Administrator, it all executes fine with no errors and does what I expect it to do.

Let me clarify, I am logged in as a System Admin User and then from there, go to Manage Users->Users, and choose the user I want to login as and then press the login button.

 Has anyone run into this before?

Any suggestions?
 

Message Edited by craskulinecz on 10-16-2007 10:36 PM

Message Edited by craskulinecz on 10-16-2007 10:38 PM