• laxmi narayan 11
  • NEWBIE
  • 60 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 18
    Replies
Hi there,

I have integration stuff. In this i callout to external api and get data in response. This is my code.

public class covidIntegrationCallout {
    public static HttpResponse makeCovidIntegrationCallout() {
        Http ht = new Http();
        HttpRequest request = new HttpRequest();
request.setEndpoint('https://api.covid19india.org/state_district_wise.json');
        request.setMethod('GET'); 
        HttpResponse res = ht.send(request);
        System.debug('========='+res);
        System.debug('========='+res.getBody());
        List<Covid19__c> upsertState = new List<Covid19__c>();  
        Map<String,Object> results = (Map<String,Object>) JSON.deserializeUntyped(res.getBody());
         System.debug('----------'+results);   
        Map<String,Object> tempst = (Map<String,Object>)(results.get('State Unassigned'));
        for(Object lst:tempst.keySet()){ 
            system.debug('************'+lst); 
        }
return res;
    }
}

help me to map json data to salesforce custom object Covid19__c.

any help appriciated!

Thanks in Advance

Hi there,

I have a richtext area field on account object in which I stores signature.
Usecase :- 
when I signed from the public URL which is in my email. This image saved in the Account object, Richtext area field. After signing pdf an email comes up, In this email, I have received pdf attachment. In this pdf, the signature is not showing.

Signature image saved in Richtext area field but not showing on attachment which is in email.

public URL - Force.com Site URLUser-added image

any help would be appreciated!
Thanks 
LN

Hi there, 
I have an object Campaign_Follow_Up_Stage__c, On this object, I have a Campaign Lookup.
On Campaign_Follow_Up_Stage__c object, there are some record which status is "completed", If the status of any of these records 
changes, supposed I changed the status of one record  "Completed" to "Planned" then Campaign status field changed 
the value "In-progress".
* If all records status is completed then-campaign status field value is Completed.
* If all records status is Planned then-campaign status field value is In-progress.
* If all records status is Draft then-campaign status field value is Planned.
* If one of it's record status is planned then-campaign status field value is In-progress.
* If one of it's record status is Draft then-campaign status field value is planned.


trigger updateCampaignStatus on Campaign_Follow_Up_Stage__c (after Update,after insert) {
//list<Campaign_Follow_Up_Stage__c> cList = new list<Campaign_Follow_Up_Stage__c>(); 
    set<Id> campIds = new set<Id>();   
        for(Campaign_Follow_Up_Stage__c c : trigger.new){  
          campIds.add(c.Campaign__c);  
        }     
   List<Campaign> cmList = new List<Campaign>();
    for(Campaign cam:[SELECT Id,(SELECT Id,Name,status__c ,Campaign__c FROM Campaign_Follow_Up_Stages__r order by Name) FROM Campaign WHERE Id IN :campIds]){
        for(Campaign_Follow_Up_Stage__c c:cam.Campaign_Follow_Up_Stages__r){
             if(c.status__c == 'Completed'){
                 cam.status ='Completed';
             }
             if(c.status__c =='Planned'){
                 cam.status ='In Progress';
             }
             if(c.status__c =='Draft'){
                 cam.status ='Planned';
             }
             cmList.add(cam);
        }
    }
     update cmList;
}


Any help appreciated

Thanks 
L.N
Hi there,

I have a object Campaign_Follow_Up_Stage__c ,on this object i have a Campaign Lookup.
* On Campaign_Follow_Up_Stage__c object, i have a status field, when i insert or update record,if status = "Planned" , It changed the Campaign Field status into "In-Progress",If if status = "Draft" , It changed the Campaign Field status into "Planned" and if status = "Compelete" , It changed the Campaign Field status into "Compelete".

I wrote this:-
trigger updateCampaignStatus on Campaign_Follow_Up_Stage__c (after Update,after insert) {
    set<Id> campIds = new set<Id>(); 
        for(Campaign_Follow_Up_Stage__c c : trigger.new){ 
         if(c.Status__c == 'Planned'){
            campIds.add(c.id);
        }     
    }
    List<Campaign> cmList = [SELECT id, status FROM Campaign WHERE id In :campIds];
     for(Campaign cm : cmList){
         cm.status = 'In Progress';
     }
     update cmList;
}



Any help appreciated!

Thanks
L.N



 
Hi there,

When I click on convert button from lightning, this error occur:-

ConvertLead failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Converted objects can only be owned by users. If the lead is not owned by a user, you must specify a user for the Owner field.: [OwnerId]

Please let me how to fix this problem

Thanks 
LN
Hi there,

I need to add list of lead in campaign member.
here is my code.

public class leadUtil {
public static void addInCampaign(List<Lead> leads){
        Campaign c = [Select id from Campaign limit 1];
        for(lead l:leads){ 
        CampaignMember mem = new CampaignMember (campaignid=c.id, leadid=l.id);  
        insert mem; 
        }
    }
}

Thanks
L.N
Hi there,

Is any one can help me, How can i integrate spreadsheet with salesforce using rest api.

Thanks 
Laxmi narayan

When I do payment It will save the Transaction in Stripe Account, I want to show that simialr Transaction or Payment in Salesforce using Custom Object Invoices, any help appreciated.

Thanks in advance!!! :) 

Hi there,

Any body know about, how to integrate salesforce CTI with Avaya

Any help apriciated!

Thanks
Laxmi

Hi there,

I want to make a custom lightning button on account object for send email to account email address.
Case: when i open a record and click on this lightning button, email send to this account record.

Thanks 
 L.N
Hi there,

I have Picklist field Membership_Level__c which have some values like Child Free and another picklist field Membership_Type__c which also have some value like GP and Dental.

Add a validation rule not to allow to add Free Child to GP and Dental.
I did this:
IF(AND(ISPICKVAL(Membership_Type__c,'MHC GP'), 
NOT(ISBLANK(Membership_Level__c,'Child Free'))), true, false)

Please assist
LN
hi there,

I need to update the date Data type field in salesforce using javascript code.

{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")} 
sforce.connection.sessionId = "{!$Api.Session_ID}"; 
var record = new sforce.SObject("Account"); 
var currentDate = new Date(); 
var date = currentDate.getDate(); 
var month = currentDate.getMonth(); 
var year = currentDate.getFullYear(); 
var monthDateYear = (month+1) + "/" + date + "/" + year; 
record.Membership_Change_Dates__c = new Date(monthDateYear);
sforce.connection.update([record]);


It returns DateTime, not date.

please assist!

Thanks 
LN 
Hi there,

I am getting this error at the time of running test class at the below line.
      list<User> users = (list<User>) JSON.deserialize(newUsersJson, List<User>.class);
Error: malformed json exception.expected [ in salesforce at the begning of the list/set
any help can be appreciable.

Thanks
 
Hi there,

Anybody can help me to remove this unusal space. showing in this image.
This is visualforc page
User-added image 
Thanks!
Hi there,

* I am creating a report which shows dupilate records on account object.
* For this I create a formula field (Number) which count is default 1 in formula.
* I went through this report i have duplicate and triplate account but there is a problem its shows me single count 1 record also. How can i remove 1 record count from this report
User-added image
Hi there,
I have an custom object and has field State__c, When State__c value will Booked. Email Send on associated account. Account is lookup on this Custom Object. Here is my Code:


trigger EmailToPatient on Proposed_Appointment__c (after insert,after update) {
    list<Account> acconts2Update = new list<Account>();
    List<Messaging.SingleEmailMessage> allMails = new List<Messaging.SingleEmailMessage>();
        for(aqthc__Proposed_Appointment__c pro :[SELECT Id,Patient__r.Name,
                                   Patient__r.PersonMobilePhone,Patient__r.PersonEmail,Patient__r.FirstName,Patient__r.LastName,patient__r.id,
                                   aqthc__State__c,Patient__c FROM aqthc__Proposed_Appointment__c
                                   WHERE Id IN: trigger.newMap.keySet()]){
            //Account acc = new Account();
            if(pro.aqthc__State__c == 'Booked'){
             Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
             list<String> toAddresses = new list <string>{pro.Patient__r.PersonEmail};
             mail.setToAddresses(toAddresses);
             system.debug('==========='+toAddresses);
             mail.setTemplateId('00X1U000000uRqr');
             mail.setWhatId(pro.id);
             mail.setBccSender(false);
             mail.setUseSignature(false);
             mail.setReplyTo('Laxminarayan.sfdc@gmail.com');
             mail.setSenderDisplayName('My service');
             mail.setSaveAsActivity(false);
             allMails.add(mail);
       }   
       //acconts2Update.add(acc);
   }
}

Thanks

Hi there,

When i created a user in salesforce, it will create a record on another object with same name. How do i write a trigger for it.

 

Hi there, i have an error while click on save button.

"System.NullPointerException: Attempt to de-reference a null object
Error is in expression '{!upload}' in component <apex:commandButton> in page aqthc:booking_funnel_settings: Class.aqthc.FileUploadController.upload: line 31, column 1".



<apex:page controller="FileUploadController">
  <apex:sectionHeader title="Visualforce Example" subtitle="File Upload Example"/>
 
  <apex:form enctype="multipart/form-data">
    <apex:pageMessages />
    <apex:pageBlock title="Upload a File">
 
      <apex:pageBlockButtons >
        <apex:commandButton action="{!upload}" value="Save"/>
      </apex:pageBlockButtons>
 
      <apex:pageBlockSection showHeader="false" columns="2" id="block1">
 
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="File Name" for="fileName"/>
          <apex:inputText value="{!document.name}" id="fileName"/>
        </apex:pageBlockSectionItem>
 
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="File" for="file"/>
          <apex:inputFile value="{!document.body}" filename="{!document.name}" id="file"/>
        </apex:pageBlockSectionItem>
 
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="Description" for="description"/>
          <apex:inputTextarea value="{!document.description}" id="description"/>
        </apex:pageBlockSectionItem>
 
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="Keywords" for="keywords"/>
          <apex:inputText value="{!document.keywords}" id="keywords"/>
        </apex:pageBlockSectionItem>
        
        <form action="/action_page.php">
        Select your favorite color:
            <input style="margin-left: 1px;" type="color" name="favcolor" value="#ff0000"/>
            <input style="margin-left: 30px;" type="submit"/>
        </form>
 
      </apex:pageBlockSection>
 
    </apex:pageBlock>
  </apex:form>
</apex:page>
===============================================================
public with sharing class FileUploadController {
 public List<aqthc__Healthcare_Settings__c> objHSList {get;set;}
  public Document document {
    get {
      if (document == null)
        document = new Document();
      return document;
    }
    set;
  }
 
  public PageReference upload() {
 
    document.AuthorId = UserInfo.getUserId();
    document.FolderId = UserInfo.getUserId(); // put it in running user's folder
 
    try {
      insert document;
    } catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
      return null;
    } finally {
      document.body = null; // clears the viewstate
      document = new Document();
    }
    ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'File uploaded successfully'));
    aqthc__Healthcare_Settings__c objHc = new aqthc__Healthcare_Settings__c();
        objHc.Name = document.name;
        //objHc.aqthc__Background_Color__c = document  ;
        //objHc.aqthc__Background_Image_URL__c = document.FolderId;
        objHSList.add(objHc);
       insert objHSList;
    return null;
  } 
}

Please help!
Thanks
Hi, All
how can I use a static resource image using jquery in visual force page?
Hi there,

I have a object Campaign_Follow_Up_Stage__c ,on this object i have a Campaign Lookup.
* On Campaign_Follow_Up_Stage__c object, i have a status field, when i insert or update record,if status = "Planned" , It changed the Campaign Field status into "In-Progress",If if status = "Draft" , It changed the Campaign Field status into "Planned" and if status = "Compelete" , It changed the Campaign Field status into "Compelete".

I wrote this:-
trigger updateCampaignStatus on Campaign_Follow_Up_Stage__c (after Update,after insert) {
    set<Id> campIds = new set<Id>(); 
        for(Campaign_Follow_Up_Stage__c c : trigger.new){ 
         if(c.Status__c == 'Planned'){
            campIds.add(c.id);
        }     
    }
    List<Campaign> cmList = [SELECT id, status FROM Campaign WHERE id In :campIds];
     for(Campaign cm : cmList){
         cm.status = 'In Progress';
     }
     update cmList;
}



Any help appreciated!

Thanks
L.N



 
Hi there,

Is any one can help me, How can i integrate spreadsheet with salesforce using rest api.

Thanks 
Laxmi narayan
Hi there,

I want to make a custom lightning button on account object for send email to account email address.
Case: when i open a record and click on this lightning button, email send to this account record.

Thanks 
 L.N
Hi there,

I have Picklist field Membership_Level__c which have some values like Child Free and another picklist field Membership_Type__c which also have some value like GP and Dental.

Add a validation rule not to allow to add Free Child to GP and Dental.
I did this:
IF(AND(ISPICKVAL(Membership_Type__c,'MHC GP'), 
NOT(ISBLANK(Membership_Level__c,'Child Free'))), true, false)

Please assist
LN
hi there,

I need to update the date Data type field in salesforce using javascript code.

{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")} 
sforce.connection.sessionId = "{!$Api.Session_ID}"; 
var record = new sforce.SObject("Account"); 
var currentDate = new Date(); 
var date = currentDate.getDate(); 
var month = currentDate.getMonth(); 
var year = currentDate.getFullYear(); 
var monthDateYear = (month+1) + "/" + date + "/" + year; 
record.Membership_Change_Dates__c = new Date(monthDateYear);
sforce.connection.update([record]);


It returns DateTime, not date.

please assist!

Thanks 
LN 
Hi team ,
Could you please help me linkedin integration with examples and class ,

need to integrate linkedin and salesforce integration
  • July 26, 2019
  • Like
  • 0
Hi there,

Anybody can help me to remove this unusal space. showing in this image.
This is visualforc page
User-added image 
Thanks!
Hi there,

* I am creating a report which shows dupilate records on account object.
* For this I create a formula field (Number) which count is default 1 in formula.
* I went through this report i have duplicate and triplate account but there is a problem its shows me single count 1 record also. How can i remove 1 record count from this report
User-added image
Hi there,
I have an custom object and has field State__c, When State__c value will Booked. Email Send on associated account. Account is lookup on this Custom Object. Here is my Code:


trigger EmailToPatient on Proposed_Appointment__c (after insert,after update) {
    list<Account> acconts2Update = new list<Account>();
    List<Messaging.SingleEmailMessage> allMails = new List<Messaging.SingleEmailMessage>();
        for(aqthc__Proposed_Appointment__c pro :[SELECT Id,Patient__r.Name,
                                   Patient__r.PersonMobilePhone,Patient__r.PersonEmail,Patient__r.FirstName,Patient__r.LastName,patient__r.id,
                                   aqthc__State__c,Patient__c FROM aqthc__Proposed_Appointment__c
                                   WHERE Id IN: trigger.newMap.keySet()]){
            //Account acc = new Account();
            if(pro.aqthc__State__c == 'Booked'){
             Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
             list<String> toAddresses = new list <string>{pro.Patient__r.PersonEmail};
             mail.setToAddresses(toAddresses);
             system.debug('==========='+toAddresses);
             mail.setTemplateId('00X1U000000uRqr');
             mail.setWhatId(pro.id);
             mail.setBccSender(false);
             mail.setUseSignature(false);
             mail.setReplyTo('Laxminarayan.sfdc@gmail.com');
             mail.setSenderDisplayName('My service');
             mail.setSaveAsActivity(false);
             allMails.add(mail);
       }   
       //acconts2Update.add(acc);
   }
}

Thanks

Hi there,

When i created a user in salesforce, it will create a record on another object with same name. How do i write a trigger for it.

 

Hi there, i have an error while click on save button.

"System.NullPointerException: Attempt to de-reference a null object
Error is in expression '{!upload}' in component <apex:commandButton> in page aqthc:booking_funnel_settings: Class.aqthc.FileUploadController.upload: line 31, column 1".



<apex:page controller="FileUploadController">
  <apex:sectionHeader title="Visualforce Example" subtitle="File Upload Example"/>
 
  <apex:form enctype="multipart/form-data">
    <apex:pageMessages />
    <apex:pageBlock title="Upload a File">
 
      <apex:pageBlockButtons >
        <apex:commandButton action="{!upload}" value="Save"/>
      </apex:pageBlockButtons>
 
      <apex:pageBlockSection showHeader="false" columns="2" id="block1">
 
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="File Name" for="fileName"/>
          <apex:inputText value="{!document.name}" id="fileName"/>
        </apex:pageBlockSectionItem>
 
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="File" for="file"/>
          <apex:inputFile value="{!document.body}" filename="{!document.name}" id="file"/>
        </apex:pageBlockSectionItem>
 
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="Description" for="description"/>
          <apex:inputTextarea value="{!document.description}" id="description"/>
        </apex:pageBlockSectionItem>
 
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="Keywords" for="keywords"/>
          <apex:inputText value="{!document.keywords}" id="keywords"/>
        </apex:pageBlockSectionItem>
        
        <form action="/action_page.php">
        Select your favorite color:
            <input style="margin-left: 1px;" type="color" name="favcolor" value="#ff0000"/>
            <input style="margin-left: 30px;" type="submit"/>
        </form>
 
      </apex:pageBlockSection>
 
    </apex:pageBlock>
  </apex:form>
</apex:page>
===============================================================
public with sharing class FileUploadController {
 public List<aqthc__Healthcare_Settings__c> objHSList {get;set;}
  public Document document {
    get {
      if (document == null)
        document = new Document();
      return document;
    }
    set;
  }
 
  public PageReference upload() {
 
    document.AuthorId = UserInfo.getUserId();
    document.FolderId = UserInfo.getUserId(); // put it in running user's folder
 
    try {
      insert document;
    } catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
      return null;
    } finally {
      document.body = null; // clears the viewstate
      document = new Document();
    }
    ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'File uploaded successfully'));
    aqthc__Healthcare_Settings__c objHc = new aqthc__Healthcare_Settings__c();
        objHc.Name = document.name;
        //objHc.aqthc__Background_Color__c = document  ;
        //objHc.aqthc__Background_Image_URL__c = document.FolderId;
        objHSList.add(objHc);
       insert objHSList;
    return null;
  } 
}

Please help!
Thanks
Hello, 

Since 2 days, I can't launch Eclipse. 
I receive this error message.



User-added image
Here's the log..

I don't get it. 

User-added image

Any Idea ? 

Nathan