• dev_jh
  • NEWBIE
  • 150 Points
  • Member since 2008

  • Chatter
    Feed
  • 6
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 44
    Questions
  • 107
    Replies

I'm doing my first major Apex scripting job to automatically create events based on a quantity # specified in Opportunity Products.  I'm not the best coder around, so please bear with me here :)

 

I'm trying to query PricebookEntry.Product2.Name but am finding that the output via Apex is the name of the field instead of the actual name specified for the related object.  This also happens with ProductCode as well.

 

For example:

 

PricebookEntry.Product.Name                             .....results in "Name"

Trigger.new[0].PricebookEntry.Product2.Name    .....results in "null"

 

I've been able to narrow down a SOQL query with other fields in the table, so I know it is possible.  Here's an example:

 

[select Id,OpportunityId,Quantity,PricebookEntry.Product2.Family from OpportunityLineItem where PricebookEntry.Product2.Family = 'Services' AND Opportunity.Id = :eachNewOpportunityLineItem.OpportunityId]

 

 

What am I missing?  Someone fill in the obvious for me :)

Hi,

we reached the limit for creating new custom fields. Now I am sure a number of the custom fields we once created are not used and/or displayed at all in the different record types. How could I identify those?

Regards,

Jerry

  • January 30, 2009
  • Like
  • 0

Hi,

 

I wanted to copy some Worflow from one SF environment to another using Eclipse. The problem is that I don´t see an option to create an "Email" object manually through the IDE. Is this possible? Thanks,

 

J

Hi all,

 

I have a VF page on Opportunity in which I want to display owner information. If I use the standard Opportunity controller I can do this without a problem:

 

{!Opportunity.Owner.LastName}

 

However, I have created a controller extension since I need to order the OppLineItems in a certain way and do a bit more stuff. Now the above line is failing which kind of makes sense because there is no "Owner" field on an opportunity, only an "OwnerId" field. Howeve if I try:

 

{!Opportunity.OwnerId.LastName}

 

I get an "unknown property 'String.LastName'

 

Any ideas? Thanks,

 

J

Hi all,

 

I have been researching the forum to understand how to get headers and footers in the PDFs generated from Visualforce. According to these posts it is possible:

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=6411

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=3403

 

However, I have been following the instructions but I get no header or footer. I will explain:

 

1 - I created the static resource as suggested. The file contains the following:

 

 

@page { @bottom-left { content: "Page " counter(page) " Customer Report"; } @top-center { content: "PDF Header"; } }

 

 2 - I included this static resource on my Visualforce page. The first lines of code are:

 

 

<apex:page standardController="Opportunity" showHeader="true" renderas="pdf"> <apex:includeScript value="{!$Resource.PDFHeaderFooter}"/> <table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1"> <tr> <td valign="top">

 

 However, I am not getting anything on the header or footer of the PDF. Can you help? Thanks,

 

J

 

 

 

Hi all,

 

We are generating quotes from Salesforce using Visualforce and rendering the page as PDF.

 

We are trying to display discounts only on line items that have a discount using the following code:

 

 

<apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line"> <tr> <td>{!line.PricebookEntry.Product2.ProductCode}</td> <td align="right"><apex:OutputText value="{!ROUND(line.Quantity,0)}"/></td> <td>&nbsp;{!line.Description}</td> <td align="right"><apex:OutputField value="{!line.UnitPrice}"/></td> <td align="right"><apex:OutputField value="{!line.TotalPrice}"/></td> </tr> <apex:outputPanel id="Discounts" rendered="{!IF(AND(ISPICKVAL(Opportunity.Transport_Charges__c, "Producto Level"), line.Discount__c > 0.0), true, false)}"> <tr> <td align="right" colspan="5">Descuento <apex:OutputField value="{!line.Discount__c}"/></td> </tr> </apex:outputPanel> </apex:repeat>

 

 However this is not working properly. I will explain the 2 problems we are facing:

 

  1. Rendered condition - The below formula does not work properly. Even though Transport_Charges__c is a PICKLIST fiel, Visualforce throws up an error when saying it is a text field. If we try to change the expression to Opportunity.Transport_Charges__c == "Product Level" it does not work. Any ideas why?
    IF(AND(ISPICKVAL(Opportunity.Transport_Charges__c, "Producto Level"), line.Discount__c > 0.0), true, false)
  2. Conditional line not displaying correctly - For test purposes, until we solve point 1 above, we have used a condition that always evaluates to true. Now we can see the line speciying the discount level, but the line does not print with the same length as the other lines (see image below). This does not seem to make any sense. Any help much appreciated.
Error Screen Shot

 

Hi all,

 

We have the following requirement we are trying to fulfill:

 

Our customer is a reseller that has 2 product lists, one with all products without Transport Costs and the same with the Transport Costs.

 

For opportunity gross margin analysis what we would need ideally is the ability to add the cost of the product as a new field in the PriceBookEntry object. Is this possible? We can´t see the option through the admin screens!

 

Thanks,

 

J

Hi all,

 

I am getting a very strange error from Eclipse while trying to deploy Code from Sandbox to Live:

 

!MESSAGE WARN [2009-05-25 13:03:07,690] (DeploymentController.java:deployWork:940) - Deployment FAILED. Got the following deploy messages [10]: (1) filename = classes/TestCreacionCandidatosYAnunciantes.cls, result = SUCCESS, affect = changed, id = 01p200000002YrhAAE, fullname = TestCreacionCandidatosYAnunciantes (2) filename = objects/Account.object, result = SUCCESS, affect = changed, id = 00N20000001t0q6EAA, fullname = Account.ApellidosContacto__c (3) filename = objects/Account.object, result = SUCCESS, affect = changed, id = 00N20000001t0q7EAA, fullname = Account.NombreContacto__c (4) filename = objects/Account.object, result = SUCCESS, affect = changed, id = 00N20000001t0q8EAA, fullname = Account.Repeticiones__c (5) filename = objects/Account.object, result = SUCCESS, affect = none, id = 00N20000000itFrEAI, fullname = Account.Tel_fono_2__c (6) filename = objects/Lead.object, result = SUCCESS, affect = none, id = 00N20000001sz5iEAA, fullname = Lead.Repeticiones__c (7) filename = package.xml, result = SUCCESS, affect = changed, id = null, fullname = package.xml (8) filename = triggers/ComprobacionCandidatos.trigger, result = SUCCESS, affect = changed, id = 01q200000004fJEAAY, fullname = ComprobacionCandidatos (9) filename = triggers/PostInsertCuentas.trigger, result = SUCCESS, affect = changed, id = 01q200000004fJFAAY, fullname = PostInsertCuentas (10) filename = triggers/PreInsertCuentas.trigger, result = SUCCESS, affect = changed, id = 01q200000004fJGAAY, fullname = PreInsertCuentas

 

 As you can see, the log states there has been a problem but then shows 10 lines that all display success. Any ideas how I can find out what the problem is? (ie: a more verbose log?)

 

Just getting started with these, hopefully they will be easy to answer!

 

  1. We have created a Custom Object called Test__c that has a Parent / Child relationship to Accounts. We have used other Visualforce templates in the past for lookup relationships using the following syntax to show the related records: <apex:repeat var="cx" value="{!relatedTo.Test__c}">. However now we are getting a message stating: "Error: Invalid field Test__c for SObject Account", is there a different way to access these type of relationships?
  2. On a simmilar subject. We wouldn´t want all Test__c records returned on that query, but just those that have a certain condition. How do you add conditions here?


Many thanks,

 

J

We are looking for an experienced Salesforce Consultant (Certification a Plus but not a must). The candidate must be local (Madrid / Spain) as this is for a customer facing role. Native Spanish speaker. If you are interested drop me a note and I will provide more details.

 

Full Time or Contractor irrespective.

 

Regards,

 

J

Hi all,

 

We have an org with several hundred workflow alerts that send different emails. We need quite a few of these emails copied to a specific email address.

 

Rather than manually modifying all these through the GUI we thought about connecting with Eclipse to the Production Org and modifying the Workflow XMLs to include on each alert a line:

 

<ccEmails>xxxx@yyyy.com</ccEmails>

 

We have done so successfully for one of the Objects. When we try to proceed with another object it does not seem to work. As soon as we edit the XML with Ultra Edit we get a mark in Eclipse stating the data is dirty. Even if we try to refresh it, it remains dirty. When we deploy, we get an error message (here is the Eclipse Log for it). Can anyone help or suggest another approach? Thanks!!!

 

 

!SESSION 2009-05-01 16:07:45.415 ----------------------------------------------- eclipse.buildId=M20080221-1800 java.version=1.6.0_13 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86 !ENTRY com.salesforce.ide.core 2 0 2009-05-01 16:07:53.234 !MESSAGE WARN [2009-05-01 16:07:53,225] (ProxyManager.java:init:49) - No proxy bundle found - default proxy service will be initialized !ENTRY org.eclipse.osgi 2 0 2009-05-01 16:07:59.676 !MESSAGE While loading class "com.salesforce.ide.upgrade.internal.UpgradeNotifier$3", thread "Thread[main,6,main]" timed out waiting (5000ms) for thread "Thread[Worker-2,5,main]" to finish starting bundle "update@plugins/com.salesforce.ide.upgrade_15.0.0.200902181452.jar [288]". To avoid deadlock, thread "Thread[main,6,main]" is proceeding but "com.salesforce.ide.upgrade.internal.UpgradeNotifier$3" may not be fully initialized. !STACK 0 org.osgi.framework.BundleException: State change in progress for bundle "update@plugins/com.salesforce.ide.upgrade_15.0.0.200902181452.jar" by thread "Worker-2". at org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1141) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:258) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:408) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addViewListener(UpgradeNotifier.java:300) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addPackagesViewListener(UpgradeNotifier.java:265) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addOpenedViewListeners(UpgradeNotifier.java:243) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.access$0(UpgradeNotifier.java:239) at com.salesforce.ide.upgrade.internal.UpgradeNotifier$1.run(UpgradeNotifier.java:108) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:129) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447) at org.eclipse.equinox.launcher.Main.run(Main.java:1173) Caused by: org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException ... 42 more Root exception: org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException at org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1141) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:258) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:408) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addViewListener(UpgradeNotifier.java:300) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addPackagesViewListener(UpgradeNotifier.java:265) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addOpenedViewListeners(UpgradeNotifier.java:243) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.access$0(UpgradeNotifier.java:239) at com.salesforce.ide.upgrade.internal.UpgradeNotifier$1.run(UpgradeNotifier.java:108) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:129) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447) at org.eclipse.equinox.launcher.Main.run(Main.java:1173) !ENTRY com.salesforce.ide.core 2 0 2009-05-01 16:09:56.163 !MESSAGE WARN [2009-05-01 16:09:56,162] (ProjectService.java:handleDeployResult:1892) - Save failed! !ENTRY com.salesforce.ide.core 2 0 2009-05-01 16:09:56.201 !MESSAGE WARN [2009-05-01 16:09:56,200] (ProjectService.java:handleRetrieveResult:2023) - Nothing to save to project - retrieve result is empty

 

 

 

Hi,

 

We want a report to check which accounts are being neglected. This is all accounts that have not been contacted in the last 30 days and also there is no future task or event.

 

We are thinking of creating a field in the Account and have a trigger on Activities but want to check we are not overcomplicating... Is there a standard way to achieve this without code?

 

Thanks,

 

J

  • April 15, 2009
  • Like
  • 0

Hi all,

 

We are using Eclipse to deploy changes made on a Sandbox and we are getting a few odd errors. This has made us deploy in batches (and also, having to re-do changes manually in Production, for those changes that just can´t be migrated!).

 

The most annoying thing is that, whenever we want to add objects to an existing Force.com project in Eclipse (like, for example, the Opportunity Standard Object) we get an error message and it doesn´t work. The message states: "Factory Exception occurred when marshalling package manifest into DOM document, please make sure package manifest is well-form and present in proper location. Reason: Invalid byte 2 of 4-byte UTF-8 sequence".

 

The only option we have is to delete the project and recreate but this is incredibly frustrating. Any thoughts?

 

Thanks,

 

J

  • April 12, 2009
  • Like
  • 0

Hi all,

 

We need to execute a bit of Apex Code each time a new currency is added to our organization. However there doesn´t seem that currencies are an object where you can add a trigger from within Salesforce.

 

Any ideas?

 

Thanks,

 

J

  • April 10, 2009
  • Like
  • 0

Hi all,

 

Quick question for the community. If you need to integrate Salesforce.com with SAP/R3, why would someone fork out X thousand USD per year to use a Third Party tool if there is a free Native SAP Connector?

 

Can anyone that has used both approaches enlighten me? Thanks,

 

J

  • March 25, 2009
  • Like
  • 0

Hi all,

 

We have created a custom object with a couple of triggers (before and after insert) and some Apex classes, one of them called from the after insert trigger and the other is the test class to test it all.

 

Within our Sandbox environment, we run all tests and get an 84% code coverage and no failures.

 

However, when we try to deploy to production, we get an odd error on Eclipse, an error on line 48 which is where we Insert the new object (for which there are 2 triggers, the after insert one calling another Apex Class). The error we get says:

 

 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CreaCrompromisos: execution of AfterInsert

 

All I can say is that within the AfterInsert trigger, we call a class passing the custom object ID so within it, we can access this object and update it. Maybe the issue is this, that within an AfterInsert trigger, you can´t update the calling object (surprisingly, tests within Salesforce do not show errors!). If this is so, how can we work around this? We are calling a process that takes some time and processes a few records, so we want to capture the start time, end time and number of records processed. Any ideas?

 

Thanks,

 

J

 

 

  • March 18, 2009
  • Like
  • 0

Hi all,

 

I have a field with a default value specified by a fomula based on TODAY(). It behaves differently depending on the month of the year we are in. The question is: how do I test the formula is correct for all months in advance?

 

Thanks,

 

  • March 18, 2009
  • Like
  • 0

Hi all,

 

I am helping out a Non Profit with their Salesforce implementation. The process they want to put into Salesforce related to recurring donations is for the system to automatically create the Donation records for all the active recurring donations at the end of each month. They then send a report to each credit entity (Visa, Amex, etc...) so that they collect the money.

 

The credit entities produce back a report of what was actually collected and what wasn´t and at this point, they would like to find the automatically created Donations that did not go through and make them enter a recovery process.

 

So the question is: what is the best way to have Salesforce actually run a bit of code that creates all those donations? I know how to do the Apex bit what I am not sure how to accomplish is to have Salesforce automatically execute a script on a specific point in time. Any ideas much appreciated, it is for a good cause :smileywink:

 

Thanks,

 

J

 

PS: I know I can use a Visualforce page and make the users click a button but I would rather not follow that route if possible.

 

  • March 11, 2009
  • Like
  • 0

Hi,

 

I have an S-Control (in Javascript) that is failing and I have no idea why. I am unable to see any trace of the problem in the logs. How can you see what the issue is?

 

Also, in case someone can help, here is the issue. The following Code works perfectly:

 

<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/8.0/connection.js"></script>
{!INCLUDE($SControl.RecordTypesLookup)}

<script language="JavaScript">
function redirect() {
var DonationRecordType = "012400000009J6q";

parent.frames.location.replace("/006/e?retURL=%2F{!Recurring_Donation__c.Id}&RecordType="+DonationRecordType+ "&accid={!Recurring_Donation__c.OrganizationId__c}&opp3={!Recurring_Donation__c.Contacto__c} Donacion Recurrente - {!Today}&opp9={!Today}&opp11=Concretada&CF00N80000002VMyv={!Recurring_Donation__c.Name}&CF00N40000001tLEN_lkid={!Recurring_Donation__c.ContactoId__c}&CF00N40000001uHhg_lkid={!Recurring_Donation__c.Id}&CF00N40000001uHhg={!Recurring_Donation__c.Name}&CF00N40000001tLEN={!Recurring_Donation__c.Contacto__c}&opp7={!Recurring_Donation__c.Donation_Amount__c}&00N40000001dRhJ=TC")

 But, if I add the following it stops working (changes in bold):

 

<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/8.0/connection.js"></script>
{!INCLUDE($SControl.RecordTypesLookup)}

<script language="JavaScript">
function redirect() {
var DonationRecordType = "012400000009J6q";
var TipoPago = "";

if ({!Recurring_Donation__c.RecordTypeId} == "012R0000000CprF") {
TipoPago="TA";
}
else {
TipoPago="TC";
}

parent.frames.location.replace("/006/e?retURL=%2F{!Recurring_Donation__c.Id}&RecordType="+DonationRecordType+ "&accid={!Recurring_Donation__c.OrganizationId__c}&opp3={!Recurring_Donation__c.Contacto__c} Donacion Recurrente - {!Today}&opp9={!Today}&opp11=Concretada&CF00N80000002VMyv={!Recurring_Donation__c.Name}&CF00N40000001tLEN_lkid={!Recurring_Donation__c.ContactoId__c}&CF00N40000001uHhg_lkid={!Recurring_Donation__c.Id}&CF00N40000001uHhg={!Recurring_Donation__c.Name}&CF00N40000001tLEN={!Recurring_Donation__c.Contacto__c}&opp7={!Recurring_Donation__c.Donation_Amount__c}&00N40000001dRhJ="+TipoPago)

 

 

 


 

Message Edited by dev_jh on 02-19-2009 06:30 AM
  • February 19, 2009
  • Like
  • 0

Hi,

 

Is there a quicker way to deactivate a trigger than:

 

- Deactivate the trigger in the Sandbox environment

- Refresh Sandbox data on Eclipse IDE

- Deploy the changes

 

Do I need to use Eclipse or Ant to get this done? Thanks,

 

J

  • February 18, 2009
  • Like
  • 0

Hi all,

 

When you track historical changes in Salesforce they are stored in a table that (apparently) can´t be  accessed to delete the records. However, if you inactivate history tracking and reactivate it, the changes prior to the deactivation are still visible.

 

So the question is: how can you get rid of these? flush that history table to free up some space and also to get rid of updates that happened during an import?

 

Thanks,

 

J

  • February 17, 2009
  • Like
  • 0

Hi all,

 

We have created a trigger on Opportunities (after insert, update and delete) that calls a function to summarize certain Opp data on the contact related to the Opp (for this we have created a Custom Contact field in the Opp rather than using the standard related list).

 

We are getting a System.NullPointerException: Attempt to de-reference a null object error and we have no idea why (the Debug Log does not shed any light, and out calls to System.Debug are not being shown there for some reason). Here is the Code of the Class up to the offending line, can you help?

 

 

public class ContactUpdate { public static void ContactOppUpdate (Contact contacto) { System.Debug('START'); Boolean Primero = TRUE; Decimal Cantidad = 0; System.Debug('ID CONTACT: ' +contacto.Id); for(Opportunity Donacion: [Select Amount, CloseDate from Opportunity Where Contacto__c=:contacto.Id AND StageName='Concretada' order by CloseDate desc]) {

The only thing we can see is that we are testing this for a Contact with no Opportunities, so the SELECT will return no rows. However that should not be a reason for an error... Any help much appreciated.

 

Thanks

 

J

 

 

  • February 16, 2009
  • Like
  • 0
Hi all,

I am using Eclipse as a deployment tool for the first time. Among the changes I wanted to migrate from my Sandbox environment to the Production one, I had an email template that is used in workflow rules for the Opp Line Item standard object.

So I tried to migrate the workflows for this object. The problem is that, on the Sandbox environment, all the email addresses for the users have been suffixed with the name of the Sandbox (eg: an email which in Production is "joe.blogs@somewhere.com" will have the email changed in a Sandbox called test to: "joe.blogs@somewhere.com.test") and Eclipse throws an error (a good thing, for sure!).

The question is: how are you supposed to perform the migration without having to update all the email addresses? What is the ideal way to do this? Thanks,

J
  • November 29, 2008
  • Like
  • 1

Hi,

 

I wanted to copy some Worflow from one SF environment to another using Eclipse. The problem is that I don´t see an option to create an "Email" object manually through the IDE. Is this possible? Thanks,

 

J

Hi all,

 

I have a VF page on Opportunity in which I want to display owner information. If I use the standard Opportunity controller I can do this without a problem:

 

{!Opportunity.Owner.LastName}

 

However, I have created a controller extension since I need to order the OppLineItems in a certain way and do a bit more stuff. Now the above line is failing which kind of makes sense because there is no "Owner" field on an opportunity, only an "OwnerId" field. Howeve if I try:

 

{!Opportunity.OwnerId.LastName}

 

I get an "unknown property 'String.LastName'

 

Any ideas? Thanks,

 

J

Hi all,

 

I have been researching the forum to understand how to get headers and footers in the PDFs generated from Visualforce. According to these posts it is possible:

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=6411

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=3403

 

However, I have been following the instructions but I get no header or footer. I will explain:

 

1 - I created the static resource as suggested. The file contains the following:

 

 

@page { @bottom-left { content: "Page " counter(page) " Customer Report"; } @top-center { content: "PDF Header"; } }

 

 2 - I included this static resource on my Visualforce page. The first lines of code are:

 

 

<apex:page standardController="Opportunity" showHeader="true" renderas="pdf"> <apex:includeScript value="{!$Resource.PDFHeaderFooter}"/> <table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1"> <tr> <td valign="top">

 

 However, I am not getting anything on the header or footer of the PDF. Can you help? Thanks,

 

J

 

 

 

Hi all,

 

We are generating quotes from Salesforce using Visualforce and rendering the page as PDF.

 

We are trying to display discounts only on line items that have a discount using the following code:

 

 

<apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line"> <tr> <td>{!line.PricebookEntry.Product2.ProductCode}</td> <td align="right"><apex:OutputText value="{!ROUND(line.Quantity,0)}"/></td> <td>&nbsp;{!line.Description}</td> <td align="right"><apex:OutputField value="{!line.UnitPrice}"/></td> <td align="right"><apex:OutputField value="{!line.TotalPrice}"/></td> </tr> <apex:outputPanel id="Discounts" rendered="{!IF(AND(ISPICKVAL(Opportunity.Transport_Charges__c, "Producto Level"), line.Discount__c > 0.0), true, false)}"> <tr> <td align="right" colspan="5">Descuento <apex:OutputField value="{!line.Discount__c}"/></td> </tr> </apex:outputPanel> </apex:repeat>

 

 However this is not working properly. I will explain the 2 problems we are facing:

 

  1. Rendered condition - The below formula does not work properly. Even though Transport_Charges__c is a PICKLIST fiel, Visualforce throws up an error when saying it is a text field. If we try to change the expression to Opportunity.Transport_Charges__c == "Product Level" it does not work. Any ideas why?
    IF(AND(ISPICKVAL(Opportunity.Transport_Charges__c, "Producto Level"), line.Discount__c > 0.0), true, false)
  2. Conditional line not displaying correctly - For test purposes, until we solve point 1 above, we have used a condition that always evaluates to true. Now we can see the line speciying the discount level, but the line does not print with the same length as the other lines (see image below). This does not seem to make any sense. Any help much appreciated.
Error Screen Shot

 

I'm doing my first major Apex scripting job to automatically create events based on a quantity # specified in Opportunity Products.  I'm not the best coder around, so please bear with me here :)

 

I'm trying to query PricebookEntry.Product2.Name but am finding that the output via Apex is the name of the field instead of the actual name specified for the related object.  This also happens with ProductCode as well.

 

For example:

 

PricebookEntry.Product.Name                             .....results in "Name"

Trigger.new[0].PricebookEntry.Product2.Name    .....results in "null"

 

I've been able to narrow down a SOQL query with other fields in the table, so I know it is possible.  Here's an example:

 

[select Id,OpportunityId,Quantity,PricebookEntry.Product2.Family from OpportunityLineItem where PricebookEntry.Product2.Family = 'Services' AND Opportunity.Id = :eachNewOpportunityLineItem.OpportunityId]

 

 

What am I missing?  Someone fill in the obvious for me :)

Hi all,

 

We have the following requirement we are trying to fulfill:

 

Our customer is a reseller that has 2 product lists, one with all products without Transport Costs and the same with the Transport Costs.

 

For opportunity gross margin analysis what we would need ideally is the ability to add the cost of the product as a new field in the PriceBookEntry object. Is this possible? We can´t see the option through the admin screens!

 

Thanks,

 

J

Hi all,

 

I am getting a very strange error from Eclipse while trying to deploy Code from Sandbox to Live:

 

!MESSAGE WARN [2009-05-25 13:03:07,690] (DeploymentController.java:deployWork:940) - Deployment FAILED. Got the following deploy messages [10]: (1) filename = classes/TestCreacionCandidatosYAnunciantes.cls, result = SUCCESS, affect = changed, id = 01p200000002YrhAAE, fullname = TestCreacionCandidatosYAnunciantes (2) filename = objects/Account.object, result = SUCCESS, affect = changed, id = 00N20000001t0q6EAA, fullname = Account.ApellidosContacto__c (3) filename = objects/Account.object, result = SUCCESS, affect = changed, id = 00N20000001t0q7EAA, fullname = Account.NombreContacto__c (4) filename = objects/Account.object, result = SUCCESS, affect = changed, id = 00N20000001t0q8EAA, fullname = Account.Repeticiones__c (5) filename = objects/Account.object, result = SUCCESS, affect = none, id = 00N20000000itFrEAI, fullname = Account.Tel_fono_2__c (6) filename = objects/Lead.object, result = SUCCESS, affect = none, id = 00N20000001sz5iEAA, fullname = Lead.Repeticiones__c (7) filename = package.xml, result = SUCCESS, affect = changed, id = null, fullname = package.xml (8) filename = triggers/ComprobacionCandidatos.trigger, result = SUCCESS, affect = changed, id = 01q200000004fJEAAY, fullname = ComprobacionCandidatos (9) filename = triggers/PostInsertCuentas.trigger, result = SUCCESS, affect = changed, id = 01q200000004fJFAAY, fullname = PostInsertCuentas (10) filename = triggers/PreInsertCuentas.trigger, result = SUCCESS, affect = changed, id = 01q200000004fJGAAY, fullname = PreInsertCuentas

 

 As you can see, the log states there has been a problem but then shows 10 lines that all display success. Any ideas how I can find out what the problem is? (ie: a more verbose log?)

 

Just getting started with these, hopefully they will be easy to answer!

 

  1. We have created a Custom Object called Test__c that has a Parent / Child relationship to Accounts. We have used other Visualforce templates in the past for lookup relationships using the following syntax to show the related records: <apex:repeat var="cx" value="{!relatedTo.Test__c}">. However now we are getting a message stating: "Error: Invalid field Test__c for SObject Account", is there a different way to access these type of relationships?
  2. On a simmilar subject. We wouldn´t want all Test__c records returned on that query, but just those that have a certain condition. How do you add conditions here?


Many thanks,

 

J

We are looking for an experienced Salesforce Consultant (Certification a Plus but not a must). The candidate must be local (Madrid / Spain) as this is for a customer facing role. Native Spanish speaker. If you are interested drop me a note and I will provide more details.

 

Full Time or Contractor irrespective.

 

Regards,

 

J

Hi all,

 

We have an org with several hundred workflow alerts that send different emails. We need quite a few of these emails copied to a specific email address.

 

Rather than manually modifying all these through the GUI we thought about connecting with Eclipse to the Production Org and modifying the Workflow XMLs to include on each alert a line:

 

<ccEmails>xxxx@yyyy.com</ccEmails>

 

We have done so successfully for one of the Objects. When we try to proceed with another object it does not seem to work. As soon as we edit the XML with Ultra Edit we get a mark in Eclipse stating the data is dirty. Even if we try to refresh it, it remains dirty. When we deploy, we get an error message (here is the Eclipse Log for it). Can anyone help or suggest another approach? Thanks!!!

 

 

!SESSION 2009-05-01 16:07:45.415 ----------------------------------------------- eclipse.buildId=M20080221-1800 java.version=1.6.0_13 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86 !ENTRY com.salesforce.ide.core 2 0 2009-05-01 16:07:53.234 !MESSAGE WARN [2009-05-01 16:07:53,225] (ProxyManager.java:init:49) - No proxy bundle found - default proxy service will be initialized !ENTRY org.eclipse.osgi 2 0 2009-05-01 16:07:59.676 !MESSAGE While loading class "com.salesforce.ide.upgrade.internal.UpgradeNotifier$3", thread "Thread[main,6,main]" timed out waiting (5000ms) for thread "Thread[Worker-2,5,main]" to finish starting bundle "update@plugins/com.salesforce.ide.upgrade_15.0.0.200902181452.jar [288]". To avoid deadlock, thread "Thread[main,6,main]" is proceeding but "com.salesforce.ide.upgrade.internal.UpgradeNotifier$3" may not be fully initialized. !STACK 0 org.osgi.framework.BundleException: State change in progress for bundle "update@plugins/com.salesforce.ide.upgrade_15.0.0.200902181452.jar" by thread "Worker-2". at org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1141) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:258) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:408) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addViewListener(UpgradeNotifier.java:300) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addPackagesViewListener(UpgradeNotifier.java:265) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addOpenedViewListeners(UpgradeNotifier.java:243) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.access$0(UpgradeNotifier.java:239) at com.salesforce.ide.upgrade.internal.UpgradeNotifier$1.run(UpgradeNotifier.java:108) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:129) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447) at org.eclipse.equinox.launcher.Main.run(Main.java:1173) Caused by: org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException ... 42 more Root exception: org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException at org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1141) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:258) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:408) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addViewListener(UpgradeNotifier.java:300) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addPackagesViewListener(UpgradeNotifier.java:265) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.addOpenedViewListeners(UpgradeNotifier.java:243) at com.salesforce.ide.upgrade.internal.UpgradeNotifier.access$0(UpgradeNotifier.java:239) at com.salesforce.ide.upgrade.internal.UpgradeNotifier$1.run(UpgradeNotifier.java:108) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:129) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447) at org.eclipse.equinox.launcher.Main.run(Main.java:1173) !ENTRY com.salesforce.ide.core 2 0 2009-05-01 16:09:56.163 !MESSAGE WARN [2009-05-01 16:09:56,162] (ProjectService.java:handleDeployResult:1892) - Save failed! !ENTRY com.salesforce.ide.core 2 0 2009-05-01 16:09:56.201 !MESSAGE WARN [2009-05-01 16:09:56,200] (ProjectService.java:handleRetrieveResult:2023) - Nothing to save to project - retrieve result is empty

 

 

 

Hi all,

 

We are using Eclipse to deploy changes made on a Sandbox and we are getting a few odd errors. This has made us deploy in batches (and also, having to re-do changes manually in Production, for those changes that just can´t be migrated!).

 

The most annoying thing is that, whenever we want to add objects to an existing Force.com project in Eclipse (like, for example, the Opportunity Standard Object) we get an error message and it doesn´t work. The message states: "Factory Exception occurred when marshalling package manifest into DOM document, please make sure package manifest is well-form and present in proper location. Reason: Invalid byte 2 of 4-byte UTF-8 sequence".

 

The only option we have is to delete the project and recreate but this is incredibly frustrating. Any thoughts?

 

Thanks,

 

J

  • April 12, 2009
  • Like
  • 0

We have an after update and insert, trigger on Opportunities which fetches a valude from an account field and updates back on opportunity. It works perfectly fine when any opportunity recorde is created or updated from UI. However the trigger is not getting fired when an opportunity record is updated using excel connector.

Can some one please throw some light on this. Thanks. 

  • April 12, 2009
  • Like
  • 0

Hello Everyone. I am very new to SalesForce development and would like to ask some questions regarding Triggers.

 

My company has a need to capture duplicate leads and process them by merging information.

 

After reading through documentation, I thought trigger would be the best way to do this.

 

To test the process, i created a custom object and wrote "before insert" trigger against it.

This trigger essentially searches for record based on email address and if record exists, it updates the visit count. However, I failed on this matter since after it processes the new record, it STILL inserts the duplicate record.

 

I've tried to use both before insert, after insert events.

My thought was, before insert, merge the record and after insert, delete the newly created record.

This also failed since I can NOT perform DML against trigger.new records.

 

Has anyone faced this type of issue before and if so, how did you resolve this?

 

Any assistance would be greatly appriciated.

 

thank you.