• RDM1961
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 8
    Replies
I have 2 Account Assignment Rules Defined in This Territory
if I active both of them, there will be no account assigned to the territory.
if I active only 1 of them, it works fine.
the rule is very simple. just city code equels certain number (there are a lot of numbers in one territory and no rules, so it needs to be added 1 by 1)
it seems one territory only accepts one rule....
But I want to run multiple rules in one territory without creating child territory. Does anyone know how to do it?
Hello,
First I should mention I have very little VF/APEX experience. I've done a lot of configuration but little/no development.

We have a need to display a list of attachments related to a custom object in read-only mode. Users need to be able to edit some fields on the parent object but not have the ability to add/delete attachments. I tried to do this by adding a visual force page on our standard page. 

Visualforce Page:
<apex:page standardController="Customer_Support__c"> +
<style type="text/css">
.actionColumn {display:none; visibility:hidden}
</style>
<apex:relatedList list="CombinedAttachments">
<apex:facet name="header"><center><b></b></center></apex:facet>
</apex:relatedList>
</apex:page>
 
This works but has a couple major issues:
  1. The inserted page does not auto-size or allow scrolling so if there are a lot of attachments not all are visible.
  2. Clicking an attachment link opens the attachment detail page inside of the inserted page with obviously poor results.
​​User-added image

User-added image

After a little research, I see that I can't use 'open in new tab' functionality with 'apex:relatedlist'. I thought about creating a custom controller but found it's then not available when customizing a page. 

How can I include a view only list of attachments that works without moving to all Visualforce pages? 

Thanks,
Rick


 
 
 
  • September 14, 2018
  • Like
  • 0

Is it possible for a custom button to create a new record only if certain conditions are met and provide an error message if the conditions are not met?

 

I want to place the button on a related list on the account page and only allow a new record on non-Partner Portal accounts. Would be great if anyone has some code that might get me started. 

 

Thanks,

Rick

Trying to create a trigger to prevent new child records being inserted if the field Event Status on it's parent is one of three values. Starting with just one of the values to keep it simple. Here's what I have so far.

 

trigger CSProductBeforeSave on CS_Product__c (before insert) 
{

    for (CS_Product__c q: trigger.new)
    
        IF(q.Customer_Support__c.Event_Status__c == 'Open Complaint') 
        
            {
            q.addError('Cannot add records to PECs with Open Complaints status');
           
           }
}

 

 

ErrorError: Compile Error: Invalid foreign key relationship: CS_Product__c.Customer_Support__c at line 6 column 12

 

CS_Product__c is a child to Customer_Support__c.

 

Any guidance would be appreciated!.

 

Rick

 


  • September 01, 2011
  • Like
  • 0

Any thoughts on how I could shorten this code?  Currently compiles at about 15,000 charactors.

Thanks,

Rick

 

 

IF(AND(Implant_Date__c > Patient__r.Implanting_Center__r.Last_JC_Cert_Date__c ,
                 OR(CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'A'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'B'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'C'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'D'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'E'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'F'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'G'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'H'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'I'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'J'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'K'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'L'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'M'),
                        CONTAINS(Text(LVAD_Model__c)  &  ' ' & Text(RVAD_Model__c), 'N')
                         )
                  ),1,0
       )

 

 

I'm attempting my first visualforce email template (actually my first visual force anything).  We have a custom object "Customer_Support__c" which has a child object "CS_Product__c". When I try to reference the child object to insert a table of related records I get the error ErrorError: Invalid field CS_Product__c for SObject Customer_Support__c.

 

Code is below. Any guidance on where I've gone wrong would be greatly appreciated.

 

Thanks,

Rick


 

 

<messaging:emailTemplate subject="subject" 
      recipientType="User" 
      relatedToType="Customer_Support__c"
      replyTo="Richard.Methe@company.com">
<messaging:htmlEmailBody >
      <p> Dear {!relatedTo.Contact__c},</p>
      <p> Company has received communication regarding the event described below and we have logged this within our complaint system. If you have any questions or have any further information regarding this event, please contact us either  by calling (999) 999-9999 ext. 2205 or send an email to our Customer Affairs team in xxx at CustomerAffairs@Company.com.</p> 
    <p>Replacement Product is shipping on Sales Order number {!RelatedTo.Sales_Order_Number__c}.</p>
    
     <b><u>Complaint Acknowledgement:</u></b>
     <br>Ref #: {!RelatedTo.Name}</br>
     Created by: {!RelatedTo.CreatedBy}
     <br>Account: {!relatedTo.Account__c}</br>
     Communicated via: {!RelatedTo.Communicated_Via__c}
     <br>Date Communicated: {!relatedTo.Date_Communicated__c}</br>
     <p><b>Event Details:</b></p>
     Event Date: {!RelatedTo.Event_Date__c}
     <br>Patient Initials: {!relatedTo.Patient_Initials__c}</br>
     DOB: {!relatedTo.DOB__c}
     <br>Implant Date: {!relatedTo.Implant_Date__c}</br>
    <b>Event Description:</b>
    <br>{!relatedTo.Event_Summary__c}</br>
    <b>Product</b>
<table border="0" >
    <tr>
        <th>Part Number</th><th>Description</th><th>Lot Number</th><th>Serial Number</th>
    </tr>
    <apex:repeat var="cx" value="{!relatedTo.CS_Product__c}">
        <tr>
            <td>{!cx.Part_Number__c}</td>
            <td>{!cx.Description__c}</td>
            <td>{!cx.Lot_Number__c}</td>
            <td>{!cx.Serial_Number__c}</td>
        </tr>
    </apex:repeat>
</table> 
<b>Product Return:</b>
<br>If you have not already done so, please return the product to our {!relatedTo.Return_To__c} facilities at your earliest convenience. Be sure to include the reference number  {!RelatedTo.Name} on the outside of all packages. </br>
<br><b>Address:</b> </br>
Corporation
<br>Returned Product Analysis </br>
2433 4th Avenue
<br>sometown, WI 51803</br> 
(999) 999-9999ext. 2360  
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

 

 

 

 

 

 

 

 

I'm trying to do an update in salesforce using Informatica.  The source object has multiple date fields which I'm trying to compare to select records. I get a Malformed Query error when attempting to run the update.

The query statement that informatica generates is below.

 

SOSQL [Select Discharge_Date__c, Implant_Date__c, Patient__c From Implant__c Where ((((Implant_Date__c > Pts_last_fu_date__c) or (Discharge_Date__c > Pts_last_fu_date__c)) and Patient__c = 'a0630000007ewCc')) LIMIT 10]

  

Any help would be appreciated,

 

Thanks,

Rick

I call a flow from a hyperlink formula field on a Lead that looks like this:

HYPERLINK("/apex/ExploratoryCall?varLeadID="& Id , "Qualify" , "_self")

 My VF page looks like:

<apex:page standardController="Lead">
    <
    <flow:interview name="LogExploratoryCall" finishLocation="{URLFOR('/{!Lead.Id}')}"/>
    <apex:param name="varLeadID" value="{!Lead.Id}"/>
    <apex:param name="varLeadType" value="{!Lead.Type__c}"/>
    <apex:param name="varSectorInterest" value="{!Lead.Sector_Interest__c}"/>
</apex:page>

 I have tried various configurations for the URLFOR finishLocation such as using varLeadID, $Action.Lead.View, Lead.ID, etc. all to no avail. The above has me the closest, finishing with the following error:

Invalid Page Redirection
The page you attempted to access has been blocked due to a redirection to an outside website or an improperly coded link or button. Please contact your salesforce.com Administrator for assistance. 

Click here to return to the previous page.

 I've gone through the boards and various web posts but cannot see how to pass the Lead ID into the URLFOR. Should I use something instead of URLFOR? Do I really need a custom controller for this? I'm hoping to keep it simple and not require that. 

 

Any assistance greatly appreciated. 

 

Gail

  • December 05, 2012
  • Like
  • 0

Is it possible for a custom button to create a new record only if certain conditions are met and provide an error message if the conditions are not met?

 

I want to place the button on a related list on the account page and only allow a new record on non-Partner Portal accounts. Would be great if anyone has some code that might get me started. 

 

Thanks,

Rick

Trying to create a trigger to prevent new child records being inserted if the field Event Status on it's parent is one of three values. Starting with just one of the values to keep it simple. Here's what I have so far.

 

trigger CSProductBeforeSave on CS_Product__c (before insert) 
{

    for (CS_Product__c q: trigger.new)
    
        IF(q.Customer_Support__c.Event_Status__c == 'Open Complaint') 
        
            {
            q.addError('Cannot add records to PECs with Open Complaints status');
           
           }
}

 

 

ErrorError: Compile Error: Invalid foreign key relationship: CS_Product__c.Customer_Support__c at line 6 column 12

 

CS_Product__c is a child to Customer_Support__c.

 

Any guidance would be appreciated!.

 

Rick

 


  • September 01, 2011
  • Like
  • 0

 

I'm attempting my first visualforce email template (actually my first visual force anything).  We have a custom object "Customer_Support__c" which has a child object "CS_Product__c". When I try to reference the child object to insert a table of related records I get the error ErrorError: Invalid field CS_Product__c for SObject Customer_Support__c.

 

Code is below. Any guidance on where I've gone wrong would be greatly appreciated.

 

Thanks,

Rick


 

 

<messaging:emailTemplate subject="subject" 
      recipientType="User" 
      relatedToType="Customer_Support__c"
      replyTo="Richard.Methe@company.com">
<messaging:htmlEmailBody >
      <p> Dear {!relatedTo.Contact__c},</p>
      <p> Company has received communication regarding the event described below and we have logged this within our complaint system. If you have any questions or have any further information regarding this event, please contact us either  by calling (999) 999-9999 ext. 2205 or send an email to our Customer Affairs team in xxx at CustomerAffairs@Company.com.</p> 
    <p>Replacement Product is shipping on Sales Order number {!RelatedTo.Sales_Order_Number__c}.</p>
    
     <b><u>Complaint Acknowledgement:</u></b>
     <br>Ref #: {!RelatedTo.Name}</br>
     Created by: {!RelatedTo.CreatedBy}
     <br>Account: {!relatedTo.Account__c}</br>
     Communicated via: {!RelatedTo.Communicated_Via__c}
     <br>Date Communicated: {!relatedTo.Date_Communicated__c}</br>
     <p><b>Event Details:</b></p>
     Event Date: {!RelatedTo.Event_Date__c}
     <br>Patient Initials: {!relatedTo.Patient_Initials__c}</br>
     DOB: {!relatedTo.DOB__c}
     <br>Implant Date: {!relatedTo.Implant_Date__c}</br>
    <b>Event Description:</b>
    <br>{!relatedTo.Event_Summary__c}</br>
    <b>Product</b>
<table border="0" >
    <tr>
        <th>Part Number</th><th>Description</th><th>Lot Number</th><th>Serial Number</th>
    </tr>
    <apex:repeat var="cx" value="{!relatedTo.CS_Product__c}">
        <tr>
            <td>{!cx.Part_Number__c}</td>
            <td>{!cx.Description__c}</td>
            <td>{!cx.Lot_Number__c}</td>
            <td>{!cx.Serial_Number__c}</td>
        </tr>
    </apex:repeat>
</table> 
<b>Product Return:</b>
<br>If you have not already done so, please return the product to our {!relatedTo.Return_To__c} facilities at your earliest convenience. Be sure to include the reference number  {!RelatedTo.Name} on the outside of all packages. </br>
<br><b>Address:</b> </br>
Corporation
<br>Returned Product Analysis </br>
2433 4th Avenue
<br>sometown, WI 51803</br> 
(999) 999-9999ext. 2360  
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

 

 

 

 

 

 

 

 

Hi,

 

I hope somebody could make a suggestion for me? I work at a telecoms company and I have created an area within the "Accounts" section in order for me to upload our customers call minutes.

 

In order to do this, I created a couple of objects one being CMM (Customer Month Minutes), and the other being Month.

 

My problem is that when I upload the minutes into salesforce, I have to assign the unique number to each minute record for each customer. Let me give you an example:

 

To create a new month I need to import 2010-08 against every customer UID, eg:

 

Account ID                              Month

xx0011998Uidd00x               2010-08

yy11228866Vl11zz                2010-08

ll661144qq7789yz                2010-08

xx0011998Uidd00x               2010-08

yy11228866Vl11zz                2010-08

ll661144qq7789yz                2010-08

 

This means each month record for each account now has a UID of it's own - example below:

 

Account ID                              Month                  Month ID

xx0011998Uidd00x               2010-08              zzzzzz1111122222

yy11228866Vl11zz                2010-08              zzzzzxxxx22221111

ll661144qq7789yz                2010-08              0000rrrzzz0000111

xx0011998Uidd00x               2010-08             778899qqq999q9q

yy11228866Vl11zz                2010-08             3131313qqqq3333

ll661144qq7789yz                2010-08             161658623858584

 

This means when up loading the minutes onto the customer account, I must map the Month ID, and the Account ID, etc etc etc.

 

What I would like to do is just upload the customer month minutes against a month, rather than a UID which is created per account. EG below:

 

Account ID                                Minute Type                          Day                     Month

11222zzz1100ydu                   Inbound                                01                       August

11222zzz1100ydu                   Inbound                                02                       August

11222zzz1100ydu                   Inbound                                03                       August

11222zzz1100ydu                   Inbound                                04                       August

11222zzz1100ydu                   Inbound                                05                       August

11222zzz1100ydu                   Outbound                             01                       August

11222zzz1100ydu                   Outbound                             02                       August

11222zzz1100ydu                   Outbound                             03                       August

11222zzz1100ydu                   Outbound                             04                       August

11222zzz1100ydu                   Outbound                             05                       August

zzx5574575yyd0o                     Inbound                                01                       August

zzx5574575yyd0o                     Inbound                                02                       August

zzx5574575yyd0o                     Inbound                                03                       August

zzx5574575yyd0o                     Inbound                                04                       August

zzx5574575yyd0o                     Inbound                                05                       August

zzx5574575yyd0o                     Outbound                             01                       August

zzx5574575yyd0o                     Outbound                             02                       August

zzx5574575yyd0o                     Outbound                             03                       August

zzx5574575yyd0o                     Outbound                             04                       August

zzx5574575yyd0o                     Outbound                             05                       August

 

Does anyone have any suggestions please??

 

Thanks for looking , best regards,

Justin

 

 

 

I have 2 Account Assignment Rules Defined in This Territory
if I active both of them, there will be no account assigned to the territory.
if I active only 1 of them, it works fine.
the rule is very simple. just city code equels certain number (there are a lot of numbers in one territory and no rules, so it needs to be added 1 by 1)
it seems one territory only accepts one rule....
But I want to run multiple rules in one territory without creating child territory. Does anyone know how to do it?