• sumanth v 18
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 11
    Replies
Does anyone share sample code on below requirement. 

I'm having an issue where we're getting multiple cases opened via one email thread. I know what the issue is, but I'm wondering if there are any best practices or something that can be put in place that help avoid this issue. Here is what happened:

1. Customer emailed Sales Tech directly. They go back and forth on email.
2. At some point our support email address is added to the cc field.
3. Everytime they reply all a new case is added.
I know this is because the thread ID is missing. Technically Sales Tech should wait for the email that a new case is received (which includes the Thread ID) and reply all to that (since it includes the contact)... then if they go back and forth on that it will track to one case.
Is there anything else that can be done/put in place in these cases? We don't have them often - but when they occur they are a pain. 
how to convert date to Integer?
Object__C obj = new Object__c;
if(obj .Start_Date__c - obj .End_Date__c < 7){
            obj.eCPM__c = 7777; //[Number field with decimal 6]
        }
 
Opportunity opp = [select id,(select id,Test__c,Name,from Vendor_Groups__r) from opportunity where id =: oppid];

system.debug('@@@@Check1'+opp.Vendor_Groups__r);   No compile error
system.debug('@@@@Check1'+opp.Vendor_Groups__r.
Test__c);   Compile error as shown below
Error: Compile Error: A non foreign key field cannot be referenced in a path expression: Vendor_Groups__r
 
Is it possible to get Parent and associated child records in export excel fucntionality? 
I am trying to fetch converstion rate in Billingmonth [Custom Object] batch job
[Converstion rate- Currency Exchange]
      Map<String, DatedConversionRate> conversionRates = new Map<String, DatedConversionRate>();
      set < string > ISOCodes = new set < string > ();    
      String dtStr;
      Date dt;    
for (sObject Oppline: scope) {
    opportunitylineitem op = (opportunitylineitem) Oppline;  
    Lineid.add(op.LineId__c);
    ISOCodes.add(op.CurrencyIsoCode);
    } 
dtStr =system.today().year()+ '-'+ system.today().month()+ '-'+'01';
       dt = Date.valueof(dtStr);
              
       if (ISOCodes.size() > 0) {
        for (DatedConversionRate ex: [Select id, StartDate, ConversionRate, IsoCode from DatedConversionRate where StartDate >= : dt and IsoCode IN: ISOCodes]) {
       system.debug('@@@DateKey-->' + string.ValueOf(ex.StartDate.month()) + string.ValueOf(ex.StartDate.year()));
       conversionRates.put(string.ValueOf(ex.StartDate.month()) + string.ValueOf(ex.StartDate.year()), ex);
            system.debug('@@@@@@@@'+conversionRates+bm.Placement_Line_ID__c);
            }
       }
       String str;
       str = String.ValueOf(system.today().month()) + String.ValueOf(system.today().year());
       system.debug('@@@@@@@@123'+conversionRates);
       
       bm.Conversion_Rate__c = conversionRates.get(str).ConversionRate; [I am getting null pointer exception in this line.]
 
I tried with this peace of code, whenever i change value alert appears but even reloading the page alert appears which shouldn't. How to skip alert on reloading the page.

<apex:page standardController="Case" rendered="{!Case.Stage__c = 'Pending'}">
<script type="text/javascript">
window.alert("Static Content");
</script>
</apex:page>


Also i tried in putting stage condition in action attribute but it is throwing Content cannot be displayed: SObject row was retrieved via SOQL without querying the requested field: Case.Stage__c [No Apex class associated to this page]
<apex:page standardController="Case" Action="{!Case.Stage__c = 'Pending'}">
<script type="text/javascript">
window.alert("Static Content");
</script>
</apex:page>



 
Does anyone share sample code on below requirement. 

I'm having an issue where we're getting multiple cases opened via one email thread. I know what the issue is, but I'm wondering if there are any best practices or something that can be put in place that help avoid this issue. Here is what happened:

1. Customer emailed Sales Tech directly. They go back and forth on email.
2. At some point our support email address is added to the cc field.
3. Everytime they reply all a new case is added.
I know this is because the thread ID is missing. Technically Sales Tech should wait for the email that a new case is received (which includes the Thread ID) and reply all to that (since it includes the contact)... then if they go back and forth on that it will track to one case.
Is there anything else that can be done/put in place in these cases? We don't have them often - but when they occur they are a pain. 
how to convert date to Integer?
Object__C obj = new Object__c;
if(obj .Start_Date__c - obj .End_Date__c < 7){
            obj.eCPM__c = 7777; //[Number field with decimal 6]
        }
 
Is it possible to get Parent and associated child records in export excel fucntionality? 
I tried with this peace of code, whenever i change value alert appears but even reloading the page alert appears which shouldn't. How to skip alert on reloading the page.

<apex:page standardController="Case" rendered="{!Case.Stage__c = 'Pending'}">
<script type="text/javascript">
window.alert("Static Content");
</script>
</apex:page>


Also i tried in putting stage condition in action attribute but it is throwing Content cannot be displayed: SObject row was retrieved via SOQL without querying the requested field: Case.Stage__c [No Apex class associated to this page]
<apex:page standardController="Case" Action="{!Case.Stage__c = 'Pending'}">
<script type="text/javascript">
window.alert("Static Content");
</script>
</apex:page>