• VeMan1542
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 10
    Replies
The code on the Tutorial page for this topic in the Developer's Guide results in rather odd behavior. I'm trying to learn Visualforce from the ground up and all has been well until this page. Here's the code:

<apex:page standardController="Account">
<apex:pageBlock title="Hello {!$User.FirstName}!">
You are displaying contacts from the {!account.name} account.
Click a contact's name to view his or her details.
</apex:pageBlock>
<apex:pageBlock title="Contacts">
<apex:form>
<apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4" border="1">
<apex:column>
<apex:commandLink>
{!contact.Name}
<apex:param name="cid" value="{!contact.id}"/>
</apex:commandLink>
</apex:column>
</apex:dataTable>
</apex:form>
</apex:pageBlock>
<apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="false" title="false"/>
</apex:page>
According to the tutorial, "

After saving this markup, refresh your browser with the id query string parameter but without the cid parameter in the URL. Initially the contact detail page is not rendered, but when you click a contact name the page renders the appropriate detail view."

However, refreshing the page using just the id query string parameter does render the Contact Detail page.

Also, in this case I have two contacts in the form section. Clicking on the other contact still renders the page with the first contact. I've copied this code into my page verbatim, and it's not working as advertised. I sent a message to the Developer's Guide writers with no response. Am I copying and pasting the code incorrectly, or is there a glitch in the example??

Thanks in advance

I am trying to deploy an APEX trigger and class using ANT. I've done this before and gotten it to work, which is why I'm puzzled as to why it's not working now.
 
The error message I'm getting is:
 
Target "LeadCleaner2" does not exist in the project "LeadCleaner2".
 
I've created a build.xml file in which the project is called "LeadCleaner2", and which references a class called "LeadCleaner2.apex" in my Classes folder, as well as the "LeadCleaner2.tgr" trigger in the Triggers folder. My Build.xml file reads:
 

<project name="LeadCleaner2" basedir="." xmlns:sf="antlib:com.salesforce">

<property file="build.properties"/>

<property environment="env"/>

<!-- Deploy to server -->

<target name="deploy">

<sf:compileAndTest username="${sf.username}" password="${sf.password}" server="${sf.serverurl}" apiversion="12.0"

baseDir=".">

<runTests>

<class>LeadCleaner2</class>

</runTests>

</sf:compileAndTest>

</target>

<!-- Cleans up above. (Deletes can be combined with compiles.) -->

<target name="delete">

<sf:compileAndTest username="${sf.username}" password="${sf.password}" server="${sf.serverurl}" apiversion="12.0">

<deleteClass>LeadCleaner2</deleteClass>

<deleteTrigger>LeadCleaner2</deleteTrigger>

</sf:compileAndTest>

</target>

</project>

 

What am I doing wrong, and how is it the LeadCleaner project in the build.xml file doesn't reference the LeadCleaner2 class and trigger?

I have to do a lot of work with Salesforce data in Excel which is case-sensitivity challenged. I understand how to derive the 18 character ID from a 15 character ID, but I can't do that for hundreds or thousands of records one-by-one. I saw some posting about a plugin for Excel in the subject title which discussed a function called "GetID18". I thought the posting implied that this was an Excel plugin, but I can't find anything else about it.
 
Is this part of the Excel Connector? Where do I get the Excel Connector- it's not listed on the App Exchange. IS there is ANY kind of solution for this problem available anywhere? Please, somebody, let me know.
 
VeMan 
We have a problem with sales people not adding a Contact to the Contact Role in Opportunities after an Opp has significantly progressed. As I am apparently unable to access the Contact Role section of an Opportunity using a Workflow or a Validation Rule (please correct me if I am wrong), it made sense to use an Apex trigger to update the Opportunity StageName to the term used for a 20% Probability.
 
The idea is to check for both newly created opportunities and edited existing opportunities:
              
 
 
 
trigger ContactRoleCheck on Opportunity (after insert, after update) {

 for(Opportunity newOpp : Trigger.New){
 if (newOpp.RecordTypeID == '012500000009EaPAAU'){
   if((newOpp.Probability > 20) && (newOpp.ContactID == null)) {
    newOpp.StageName = 'Research';}}
 else if (newOpp.RecordTypeID == '012500000009EbhAAE'){
   if((newOpp.Probability > 20) &&  (newOpp.ContactID == null)) {
    newOpp.StageName = 'Qualified Lead';}}
 
 for(Opportunity oldOpp : Trigger.Old){
 if (oldOpp.RecordTypeID == '012500000009EaPAAU'){
   if((oldOpp.Probability > 20) &&  (oldOpp.ContactID == null)) {
    oldOpp.StageName = 'Research';}}
 else if (oldOpp.RecordTypeID == '012500000009EbhAAE'){
   if((oldOpp.Probability > 20) &&  (oldOpp.ContactID == null)) {
    oldOpp.StageName = 'Qualified Lead';}}
  }
 }
}
I'm attempting to write atrigger that will check the Case Origin to se if it's Web2Case, and, if so, remove the ContactID from the Contact field  (or the Contact Name, but as it's a lookup field I believe I should use the ID#).
 
We have two sets of contact records, one is used exclusively for Support Cases, the other for Sales Activity. When a Case comes in from the web, occasionally the only record with a matching email may be a sales prospect, which then gets attached to the case. We are trying to prevent this, and the web2case settings and configuration doesn't allow us to prevent this activity.
 
So, I hope someone can tell me what I'm doing wrong. My understanding is that a 'before insert' trigger acts upon the pending sObject, so I don't have to create it with a Trigger.new call. Is that right? Here is what I've got so far:
 
trigger Web2CaseContact on Case (before insert) {
    if(Case.Origin = 'Web2Case') {
    Case.ContactID = "";
  }
}
 
This gives me an error message: Compile Error: Invalid field for upsert, must be an External Id custom or standard indexed field: ContactID at line 3 column 5
 
I feel like I'm close, but that I'm still using the wrong case field references, or something. Any help so I can understand this better would be appreciated!
 
VeMan
 
 
I keep getting an error message at step 7 of the instructions which reads: Apex Toolkit for Eclipse (8.1.0.200710161138) requires plug-in "org.eclipse.wst.sse.core".

I was able to download an update for Eclipse that contained this plugin, and added it from the zip file in my download folder to the plugins folder where Eclipse has been installed, but it's still not reading it, even after restarting Eclipse.

The Toolkit is unsupported by Salesforce, so I may be SOL, but any help from you folks would be great.

By the way, I only have access to the Callisto site, not Europa (or at least it doesn't appear as a selection).

Thanks

VM
We are using our Assets object as the primary reference for the support contracts on our products. Basically a new asset gets created by the Support group upon receipt from the finance system of a new support contract related to one of our products. So there are lots of custom fields for support start dates and end dates, PO numbers, etc..., all of which woudl be useful for creating a new renewal opportunity based on our Renewal Opportunity record type.

I was wondering if there is an easy way to create a "Create Renewal" button on the asset that would put all of the relevant information into the appropriate fields in a new Opportunity record, as opposed to extracting the Assets to Excel and inserting the information as new Renewal Opportunities?

Thanks
I am trying to deploy an APEX trigger and class using ANT. I've done this before and gotten it to work, which is why I'm puzzled as to why it's not working now.
 
The error message I'm getting is:
 
Target "LeadCleaner2" does not exist in the project "LeadCleaner2".
 
I've created a build.xml file in which the project is called "LeadCleaner2", and which references a class called "LeadCleaner2.apex" in my Classes folder, as well as the "LeadCleaner2.tgr" trigger in the Triggers folder. My Build.xml file reads:
 

<project name="LeadCleaner2" basedir="." xmlns:sf="antlib:com.salesforce">

<property file="build.properties"/>

<property environment="env"/>

<!-- Deploy to server -->

<target name="deploy">

<sf:compileAndTest username="${sf.username}" password="${sf.password}" server="${sf.serverurl}" apiversion="12.0"

baseDir=".">

<runTests>

<class>LeadCleaner2</class>

</runTests>

</sf:compileAndTest>

</target>

<!-- Cleans up above. (Deletes can be combined with compiles.) -->

<target name="delete">

<sf:compileAndTest username="${sf.username}" password="${sf.password}" server="${sf.serverurl}" apiversion="12.0">

<deleteClass>LeadCleaner2</deleteClass>

<deleteTrigger>LeadCleaner2</deleteTrigger>

</sf:compileAndTest>

</target>

</project>

 

What am I doing wrong, and how is it the LeadCleaner project in the build.xml file doesn't reference the LeadCleaner2 class and trigger?

I have to do a lot of work with Salesforce data in Excel which is case-sensitivity challenged. I understand how to derive the 18 character ID from a 15 character ID, but I can't do that for hundreds or thousands of records one-by-one. I saw some posting about a plugin for Excel in the subject title which discussed a function called "GetID18". I thought the posting implied that this was an Excel plugin, but I can't find anything else about it.
 
Is this part of the Excel Connector? Where do I get the Excel Connector- it's not listed on the App Exchange. IS there is ANY kind of solution for this problem available anywhere? Please, somebody, let me know.
 
VeMan 
We have a problem with sales people not adding a Contact to the Contact Role in Opportunities after an Opp has significantly progressed. As I am apparently unable to access the Contact Role section of an Opportunity using a Workflow or a Validation Rule (please correct me if I am wrong), it made sense to use an Apex trigger to update the Opportunity StageName to the term used for a 20% Probability.
 
The idea is to check for both newly created opportunities and edited existing opportunities:
              
 
 
 
trigger ContactRoleCheck on Opportunity (after insert, after update) {

 for(Opportunity newOpp : Trigger.New){
 if (newOpp.RecordTypeID == '012500000009EaPAAU'){
   if((newOpp.Probability > 20) && (newOpp.ContactID == null)) {
    newOpp.StageName = 'Research';}}
 else if (newOpp.RecordTypeID == '012500000009EbhAAE'){
   if((newOpp.Probability > 20) &&  (newOpp.ContactID == null)) {
    newOpp.StageName = 'Qualified Lead';}}
 
 for(Opportunity oldOpp : Trigger.Old){
 if (oldOpp.RecordTypeID == '012500000009EaPAAU'){
   if((oldOpp.Probability > 20) &&  (oldOpp.ContactID == null)) {
    oldOpp.StageName = 'Research';}}
 else if (oldOpp.RecordTypeID == '012500000009EbhAAE'){
   if((oldOpp.Probability > 20) &&  (oldOpp.ContactID == null)) {
    oldOpp.StageName = 'Qualified Lead';}}
  }
 }
}
I'm attempting to write atrigger that will check the Case Origin to se if it's Web2Case, and, if so, remove the ContactID from the Contact field  (or the Contact Name, but as it's a lookup field I believe I should use the ID#).
 
We have two sets of contact records, one is used exclusively for Support Cases, the other for Sales Activity. When a Case comes in from the web, occasionally the only record with a matching email may be a sales prospect, which then gets attached to the case. We are trying to prevent this, and the web2case settings and configuration doesn't allow us to prevent this activity.
 
So, I hope someone can tell me what I'm doing wrong. My understanding is that a 'before insert' trigger acts upon the pending sObject, so I don't have to create it with a Trigger.new call. Is that right? Here is what I've got so far:
 
trigger Web2CaseContact on Case (before insert) {
    if(Case.Origin = 'Web2Case') {
    Case.ContactID = "";
  }
}
 
This gives me an error message: Compile Error: Invalid field for upsert, must be an External Id custom or standard indexed field: ContactID at line 3 column 5
 
I feel like I'm close, but that I'm still using the wrong case field references, or something. Any help so I can understand this better would be appreciated!
 
VeMan
 
 
I am creating an email to send as a follow up to an opportunity.  I have the opportunity name, date and user info already. I am trying to add the opportunity's contact in the email merge.
 
I go to the opportunity and select create email and then pick my template. I want the contact to merge into the email. Right now the contact is viewed in the opportunity through contact roles.
 
Any thoughts??? Please help!
 
I keep getting an error message at step 7 of the instructions which reads: Apex Toolkit for Eclipse (8.1.0.200710161138) requires plug-in "org.eclipse.wst.sse.core".

I was able to download an update for Eclipse that contained this plugin, and added it from the zip file in my download folder to the plugins folder where Eclipse has been installed, but it's still not reading it, even after restarting Eclipse.

The Toolkit is unsupported by Salesforce, so I may be SOL, but any help from you folks would be great.

By the way, I only have access to the Callisto site, not Europa (or at least it doesn't appear as a selection).

Thanks

VM
We are using our Assets object as the primary reference for the support contracts on our products. Basically a new asset gets created by the Support group upon receipt from the finance system of a new support contract related to one of our products. So there are lots of custom fields for support start dates and end dates, PO numbers, etc..., all of which woudl be useful for creating a new renewal opportunity based on our Renewal Opportunity record type.

I was wondering if there is an easy way to create a "Create Renewal" button on the asset that would put all of the relevant information into the appropriate fields in a new Opportunity record, as opposed to extracting the Assets to Excel and inserting the information as new Renewal Opportunities?

Thanks