• Sadhu
  • NEWBIE
  • 10 Points
  • Member since 2011

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

Wish you a happy new year...

On case, I've 2 lookups. One on Product and another one on Asset. I want to add a lookup filter on Product lookup, so that I could see only those Products which have the same Group as Product family of selected Asset.

But, I'm not able to get Product family of Asset, while putting the criteria.

Can anyone help me to achive this?

Thanks in advance...
  • January 02, 2015
  • Like
  • 1
Hi all,

Wish you a happy new year...

On case, I've 2 lookups. One on Product and another one on Asset. I want to add a lookup filter on Product lookup, so that I could see only those Products which have the same Group as Product family of selected Asset.

But, I'm not able to get Product family of Asset, while putting the criteria.

Can anyone help me to achive this?

Thanks in advance...
  • January 02, 2015
  • Like
  • 1

Hi All,
I am badly stuck at a point where I need help from the Community.


I have visualforce email template with custom vf component. The email is send using apex code by a guest user. I get below error while whenever guest user tries to send email using a site page -

INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []

public static void sendSurveyNotification(list<Feedback_Survey__c> feedbacks) {
        //try {           
        	if(feedbacks!=null && feedbacks.size()> 0) {               
                //Fetching the email template
                Id emt_notify;
                Id emt_completed;
                list<EmailTemplate> emts = [Select Id, Name, DeveloperName From EmailTemplate where DeveloperName 
                                            IN ('C_SAT_Survey_Request_Notification','C_SAT_Survey_Completed_Notification') LIMIT 2];
                
                if(emts[0].DeveloperName == 'C_SAT_Survey_Request_Notification') {
                    emt_notify = emts[0].id;
                    emt_completed = emts[1].id;
                }
                else {
                    emt_notify = emts[1].id;
                    emt_completed = emts[0].id;
                }
                list<Messaging.SingleEmailMessage> messages = new list<Messaging.SingleEmailMessage>();
                
                for(Feedback_Survey__c fbk: feedbacks) {
                    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                   	if(fbk.C_SAT_Status__c == 'Initiated')
                    	mail.setTemplateId(emt_notify);
                    else
                        mail.setTemplateId(emt_completed);
                    
                    mail.setTargetObjectId(UserInfo.getUserId());
                    System.debug('Taget Object Id==>'+UserInfo.getUserId());
                    mail.setWhatId(fbk.Id);
                    System.debug('fbk id==>'+fbk.id);
                    mail.setTreatTargetObjectAsRecipient(false);
                    list<String> ccaddresses = new list<String>{(String)fbk.Transaction_Manager_Email__c, (String)fbk.Survey_Requester_Email__c};
                    mail.setCcAddresses(ccaddresses);
                    mail.setToAddresses(new list<String>{(String)fbk.Real_Estate_Manager_Email__c});
                    mail.setOrgWideEmailAddressId(system.label.Org_Wide_TM_Support);
                    System.debug('Org Wide Address==>'+system.label.Org_Wide_TM_Support);
                    mail.setSaveAsActivity(false);
                    messages.add(mail);
                }
                Messaging.sendEmail(messages);
            }
        /*}
        Catch(Exception e) {
            System.debug('Error ==>' +e.getMessage());
            System.debug('Line Number ==>' +e.getLineNumber());
            System.debug('Cause ==>'+e.getCause());
            System.debug('Cause ==>'+e.getStackTraceString());
        }*/
    }

Thanks in Advance...!!
Hi all,

Wish you a happy new year...

On case, I've 2 lookups. One on Product and another one on Asset. I want to add a lookup filter on Product lookup, so that I could see only those Products which have the same Group as Product family of selected Asset.

But, I'm not able to get Product family of Asset, while putting the criteria.

Can anyone help me to achive this?

Thanks in advance...
  • January 02, 2015
  • Like
  • 1

Based on the business requirement I have to make text as a link in trigger and then I wanna retrieve/print that value in a standard page.

 

eg. string link = '<a href=/'+ accId +'>'+accName+ '</a>'

 

Please share your thoughts.

  • April 22, 2013
  • Like
  • 0

Hi,


I am trying to insert a pipe symbol in a string for using the google chart apis. Unfortunately, SFDC is replacing the | symbol with &#124;
Is there a way that we can have a string which includes the | symbol?
 
Doing system.debug('|'); in the developer console displays the output as
USER_DEBUG|[1]|DEBUG|&#124;
 
Any help is appreciated.

Hi,

 

Had to spend time and think about this formula for reporting, so here you are, in case you ever need it.  It does not consider national holidays, and the calculations are based purely on days of the week.

 

Comments:

First, it takes the number of weeks betwen the two dates, and multiplies it by 5 (number of business days per week).

Then, it adds the remainder of the time period divided by 7.

Then, it subtracts 2 from the result (for Saturday and Sunday) if the time period included an extra weekend in it.

 

 

5*FLOOR((Delivery_Date__c-Ship_Date__c)/7)+MOD(Delivery_Date__c-Ship_Date__c,7)-
IF(
  CASE(MOD(Ship_Date__c-DATE(1900,1,7),7),
    1,1,
    2,2,
    3,3,
    4,4,
    5,5,
    6,6,
    0,7,
    0)
  <
  CASE(MOD(Delivery_Date__c-DATE(1900,1,7),7),
    1,1,
    2,2,
    3,3,
    4,4,
    5,5,
    6,6,
    0,7,
    0),
  0,2)

I created a custom object 'Incentive'. This custom object has got a master-detail relationship with accounts.

On the object there are 3 fields (contact 1, 2 & 3) with a lookup relationship to contacts.

 

I would like to set a lookup filter criteria on these 3 fields so that the users can only choose between contacts of the specified account.

 

Is this possible? If yes, can someone help me out with this?

 

 

Thanks in advance!

 

 

  • September 27, 2010
  • Like
  • 0
Is there a way to set a filter at developement time for a lookup that the user can't change to control the list of items displayed in the lookup