• dillip nayak 3
  • NEWBIE
  • 4 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 15
    Replies
How to Get Content Type if content type is blank in attchment object.Is there any method that help to get content type with using Name Field of attchment object.


Thanks
 
HI All

I have created one visualforce page with standard controller account and extension opertunity.I have insert that page over standard layout account section.I have facing one issue it showing Edit,Delete Button as stanadrd controller .I need to hide that button only my visualforce page that inherit from stanadard controller.
How to Get Content Type if content type is blank in attchment object.Is there any method that help to get content type with using Name Field of attchment object.


Thanks
 
Hi all,
I am trying to write a SOQL but could not make it right.
Parent object Policy__c, child object Fact_Finder__c. Lookup relationship between the 2.
What I try to achieve is for all Policy that do not have a Fact Finder (id=null) or one but dated for more than 3 years (Date__c < LAST_N_YEARS:3) update the field on Policy, FactFinderDue = true.
Here is my code:
global class UpdatePolicywhenFactFinderisDue implements Schedulable { 
    
    global void execute(SchedulableContext ct) { 
        
        List<Policy__c> policylist = [Select Id, Name, Status__c, (Select Id, Date__c From Facts_Finder__r where Date__c < LAST_N_YEARS:3 or Id = null ) From Policy__c where Status__c='Current'];
        
        for (Policy__c po :policylist){
            po.FactFinderDue__c = true;    
        }
        update policylist; 
    }   
}
Thank you in advance for your help.
Sylvie

 
Hi ,

I have implemented the below code. But problem is when i am deleting the child record (Patient Record )then i am getting the error.

Validation Errors While Saving Record(s)
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger UpdateDoctor caused an unexpected exception, contact your administrator: UpdateDoctor: execution of BeforeDelete caused by: System.NullPointerException: Attempt to de-reference a null object: Class.UpdatedoctorInfo.updatedoctor: line 10, column 1". 

Apex Class:
-----------------
public Class UpdatedoctorInfo
{
  public void updatedoctor (List<Patient__C> patients)
     {
     Map<String, Patient__C> patientcodeMap= new Map<String, Patient__C>();
     for(Patient__c p: patients)
        {
             if (p.Doctor_Code__C != Null )
            {
            patientcodeMap.put(p.Doctor_Code__C ,p);
            }
              }
     List<Doctor__C> doctorToUpdate= new List<Doctor__C>();
     List<Doctor__C> doctorList = new List<Doctor__C>([SELECT id,Doctor_Code__C  FROM Doctor__C WHERE Doctor_Code__C IN :patientcodeMap.KeySet()]);
     System.debug('***********' +doctorList);
     for(Doctor__C c: doctorList )
        {
            Patient__C obj = patientcodeMap.get(c.Doctor_Code__C );
             if(obj.Doctor__C == NULL)
            {
            system.debug('doctor id' +obj.Id);
            obj.Doctor__C = c.Id;
            }
          else
            {
              
            }
            doctorToUpdate.add(c);
            update doctorToUpdate;
        }
     Map<Id, Doctor__c> opportunityMap = new Map<Id, Doctor__c>();
         for (Patient__C ps : patients)
        {
            Doctor__c opp = new Doctor__c(Id = ps.Doctor__C);
            opp.Jan_Revenue_Value__c = 0;
            opp.Feb_Revenue__c = 0;
            opp.Mar_Revenue__c = 0;
            opp.May_Revenue__c = 0;
            opp.Apr_Revenue__c = 0;
            opp.Jun_Revenue__c = 0;
            opp.Jul_Revenue__c = 0;
            opp.Aug_Revenue__c = 0;
            opp.Sep_Revenue__c = 0;
            opp.Oct_Revenue__c = 0;
            opp.Nov_Revenue__c = 0;
            opp.Dec_Revenue__c = 0;
             opportunityMap.put(ps.Doctor__C, opp);
        }
         List<Patient__c> pat =  [select id,Doctor__C ,Patient_Revenue__c,CreatedDate from Patient__C where Doctor__C in :opportunityMap.keySet()];
         for (Patient__C ps : pat)
        {
            Doctor__c opp = opportunityMap.get(ps.Doctor__c);
            if(ps.CreatedDate.month() == 1)
             {
           if (ps.Patient_Revenue__c != null )
             {
              opp.Jan_Revenue_Value__c += ps.Patient_Revenue__c;
             }
             }
             if(ps.CreatedDate.month() == 2)
             {
           if (ps.Patient_Revenue__c != null )
             {
              opp.Feb_Revenue__c += ps.Patient_Revenue__c;
             }
             }
              if(ps.CreatedDate.month() == 3)
             {
           if (ps.Patient_Revenue__c != null )
             {
              opp.Mar_Revenue__c += ps.Patient_Revenue__c;
             }
             }
              if(ps.CreatedDate.month() == 4)
             {
            if (ps.Patient_Revenue__c != null )
             {
              opp.Apr_Revenue__c += ps.Patient_Revenue__c;
             }
             }
              if(ps.CreatedDate.month() == 5)
             {
          if (ps.Patient_Revenue__c != null )
             {
              opp.May_Revenue__c += ps.Patient_Revenue__c;
             }
             }
             if(ps.CreatedDate.month() == 6)
             {
           if (ps.Patient_Revenue__c != null )
             {
              opp.Jun_Revenue__c += ps.Patient_Revenue__c;
             }
             }
             if(ps.CreatedDate.month() == 7)
             {
            if (ps.Patient_Revenue__c != null )
             {
              opp.Jul_Revenue__c += ps.Patient_Revenue__c;
             }
             }
         if(ps.CreatedDate.month() == 8)
             {
         if (ps.Patient_Revenue__c != null )
             {
              opp.Aug_Revenue__c += ps.Patient_Revenue__c;
             }
             }
          if(ps.CreatedDate.month() == 9)
             {
          if (ps.Patient_Revenue__c != null )
             {
              opp.Sep_Revenue__c += ps.Patient_Revenue__c;
             }
             }
           if(ps.CreatedDate.month() == 10)
             {
           if (ps.Patient_Revenue__c != null )
             {
              opp.Oct_Revenue__c += ps.Patient_Revenue__c;
             }
             }
             if(ps.CreatedDate.month() == 11)
             {
             if (ps.Patient_Revenue__c != null )
             {
              opp.Nov_Revenue__c += ps.Patient_Revenue__c;
             }
             }
             if(ps.CreatedDate.month() == 12)
             {
              if (ps.Patient_Revenue__c != null )
             {
              opp.Dec_Revenue__c += ps.Patient_Revenue__c;
             }
             } }
  update opportunityMap.values();
   }}

Apex Trigger:
--------------------------
trigger UpdateDoctor  on Patient__c (before insert, before update, after insert, before delete,after update, after delete, after undelete ) {
    list<Patient__C> patients = trigger.new;
    UpdatedoctorInfo my = new UpdatedoctorInfo();
    my.updatedoctor(patients); }

Thanks for your help!
 
How to Get Content Type if content type is blank in attchment object.Is there any method that help to get content type with using Name Field of attchment object.


Thanks
 
Hi everyone

Can you please tell how to lean step by step integration in salesforce .

Regards
Raj

 
I have a image hyperlink in site.com where I am trying to make the end of the URL the value of a custom field in the User Object. 

The idea is that the code looks up the custom field from the current User - there is a custom user field which displays the salesforce id. 
The code I am using is - 

<a href="/samplesite/Advisor_Profile?id={!CurremtUser.salesforceid__c}"><img src="https://ap1.salesforce.com/resource/1436458247000/FS1C" height="35" width="164"> 
    
salesforceid__c holds the Salesforce Contact ID. Once it's working, it would create a link like this -    /samplesite/Advisor_Profile?id=348432934234djf  (salesforce id on the end)

I must be doing something wrong within the code - when I test it the URL just keeps the custom field name - https://sitepreview.ap1.force.com/samplesite/Advisor_Profile?id={!User.salesforceid__c}

Any help would be appreciated
Hi all,
I trying to upload attachment to salesforce account rest api using asp.net

We have followed the steps given in following link but couldn't succeed.
http://danlb.blogspot.in/2012/06/salesforce-rest-api-file-upload.html

please help me on this
hello
      i need to transfer bulk ok sql data to the salesforce custome filds if anybuddy having solution please help me out 
Hi,
 
I want to create a formula field which returns true or false value by comparing one date (that date will be picklist) with system date. Please anyone help me.
Hi Friends,
 Am trying to create a Trigger on Account object but am getting the Error as : Loop variable must be of type Account at line 4 column 14
 Can anyone give me a solution to the following code

 trigger accTrigger on Account(After Insert) {
 
 set<string> names  =  new set<string>();
 for(account acc : trigger.new) {
  }
}

Are there any websites which are already integrated with salesforce ?

Quick and corresponding response much appreciated .