• Vasu_v
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 3
    Replies
Hi All,
We are using custom site to upload the file and we have the feature to preview the file after uploading the file.
and our security team detected that from Burfsuite we can get the base64 image id and using that id in online we can decode to image and can see the actual image.
does anyone is there any way to prevent this issue
below is code that we are currently converting image into base64 

Blob imgData = [SELECT Id, Body, ContentType, BodyLength FROM Attachment WHERE Id=:attachmentId].Body;
        String base64 = EncodingUtil.base64Encode(imgData);       
        return base64;
 
  • November 10, 2022
  • Like
  • 0
Hi Team,

I have the existing angular form , I want display them in salesforce.
I have uploaded the angular files in static resuorces and written below component but i'm not getting the results.
<aura:component access="global" implements="flexipage:availableForAllPageTypes" >
      <lightning:container aura:id="AngularApp"
                             src="{!$Resource.AngularTest + '/index.html'}" /> 
</aura:component>

Getting this error in console : 
Access to XMLHttpRequest at 'https:proxy?_=1608281927787' 
(redirected from 'https:services/proxy?_=1608281927787') 
from origin 'https:venky.lightning.force.com' 
has been blocked by CORS policy: Response to preflight request doesn't pass 
access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Anyone have any idea how to disply the angular forms in SFDC lightning, Angular files uploaded in SFDC static resource
  • December 18, 2020
  • Like
  • 0
Hi ,

I'm trying to fetch data from fitbit to salesforce.
I have followed below link,I'm able to display data from my one ,the details provided on authentication.
http://www.auraforce.ca/2015/09/salesforce-lightning-and-fitbit.html

But what i have to do is, we have around 1000 customer each have there own fibit account, 
We are storing secreate key and token in one object for each user, can any one tell me how to send request to Fitbit by each user detiails and get the data from Fibit and display in sfdc.


Thanks.
 
Hi All,

I am trying to update contact field value from campaign member when ever campaign member (CURD) operation.
Details are Like we have a custom button in opportunity it will display list of contacts and parent and child campaigns.Like below screen.
So when we ever we click subscribe get the value of parent campaign and update in contact, I have written code but its not working as expected can any one suggest or help me where i am doing wrong.

User-added image

Apex Code.
/*
* This is handler class to update contact ,Entitile doc group from parent campain 
*/
public class ContactEntitledDocGroup1Test 
{
    public static void getContactServices(Set<Id> conIds,set<Id> campaignmemberId,set<Id> childcampaignId)
    {
        List<CampaignMember> camMemberList = new List<CampaignMember>();
        List<CampaignMember> ListcamMember = new List<CampaignMember>();
        List<CampaignMember> ListAllcamMember = new List<CampaignMember>();
        List<Campaign> childCamList = new List<Campaign>();
        List<Campaign> parentCamList = new List<Campaign>();
        List<Contact> contactList =new List<Contact>();
         List<Contact> selectedcontactList =new List<Contact>();
        Map<id,Contact>  UpdateCon=new  Map<id,Contact> ();
        set<id> parentId = new set<id>();
        set<id> campparentId = new set<id>();
        set<id> childId = new set<id>();
        set<id> childcampId = new set<id>();
        set<id> contactIds = new set<id>();
        map<id,set<id>> conCampMap= new map<id,set<id>>();
        map<id,map<id,set<id>>> campaignMap = new map<id,map<id,set<id>>>();
        Map<id,Map<id,Map<set<Id>,Set<ID>>>> allids=new Map<id,Map<id,Map<set<Id>,Set<ID>>>>();
        Map<set<Id>,Set<ID>> cmpcontactid=new Map<set<Id>,Set<ID>>();
        Set<Id> cmmid=new Set<Id>();
        Map<id,Map<set<Id>,Set<ID>>> childcmpcmmcontactid=new Map<id,Map<set<Id>,Set<ID>>>();
        Set<String> rixmlSet = new Set<String>();
         Set<Id> allChildcmpainIds=new Set<Id>();
        
         Set<Id> selectedcontactids=new Set<Id>();
        Map<Id,Set<Id>> contactcampaignId=new Map<Id,Set<Id>>();
        
         system.debug('************* campaignmemberId'+campaignmemberId);
         
         Map<Id,Set<Id>> parentchildmap=new Map<id,Set<Id>>();
        if(campaignmemberId != null && !campaignmemberId.isEmpty())
        {
            camMemberList = [Select id,CampaignId,Campaign.ParentId,ContactId,Paid_Service__c from campaignmember where id=:campaignmemberId and paid_service__c =true];
        }
        system.debug('************* camMemberList '+camMemberList );
        for(CampaignMember cam : camMemberList)
        {
            if(cam.ContactId != null && cam.Campaign.ParentId != null)
            {
                set<id> campnId = new set<id>();
                parentId.add(cam.Campaign.ParentId);
                childId.add(cam.CampaignId);
                contactIds.add(cam.ContactId);
                conCampMap.put(cam.ContactId, campnId);
                if(conCampMap.containsKey(cam.ContactId))
                {
                    conCampMap.get(cam.ContactId).add(cam.CampaignId);
                }
            }
        }
        System.debug('>>>>>>>>>>>>>>>>>>>>>>>>>'+conCampMap);
        if(!parentId.isEmpty() && parentId != null)
        {
            parentCamList = [Select id,RIXML_Code__c,Service_Reports__c from campaign where id =:parentId and RIXML_Code__c != null];
            for(Campaign par:parentCamList)
            {
            campparentId.add(par.id);
            
            }
        }
         System.debug('>>>>>>>>>>>>>>>>>>>>>>>>> parentCamList '+parentCamList );
        if(!childId.isEmpty() && childId != null)
        {
            childCamList = [Select id,ParentId,parent.RIXML_Code__c,parent.Service_Reports__c from campaign where parentid =:parentId];
        }
        if(childCamList !=null)
        {
            
      System.debug(' childCamList'+childCamList);
        for(campaign cms:childCamList)
        {
            if(cms.parentID !=null && cms.Parent.Rixml_Code__c !=null)
            {
                allChildcmpainIds.add(cms.Id);
            }
        }
             System.debug(' allChildcmpainIds'+allChildcmpainIds);
            if(allChildcmpainIds !=null)
            {
                ListAllcamMember=[Select id,CampaignId,Campaign.ParentId,ContactId,Paid_Service__c from campaignmember where Campaignid=:allChildcmpainIds and paid_service__c =true];
            }
        }
        
        if(!contactIds.isEmpty() && contactIds != null)
        {
            contactList = [select id,Entitled_Document_Groups_Last_Updated__c,Entitled_Document_Groups__c from contact where id =:contactIds];
        }
         System.debug(' ListAllcamMember'+ListAllcamMember);
        System.debug('>>>>>>>>>>>>>>>>>>>>>>>>> childCamList '+childCamList );
      
        for(contact con : contactList)
        {
        for(Campaign cm: childCamList)
        {
            for(CampaignMember cam : ListAllcamMember)
            {
                set<id> campnId = new set<id>();
                 
                    conCampMap.put(cam.ContactId, campnId);
                     System.debug('>>>>>>>>>>>>>>>>>>>>>>>>> conCampMap'+conCampMap);
                    if(conCampMap.containsKey(cam.ContactId))
                    {
                        conCampMap.get(cam.ContactId).add(cam.CampaignId);
                        System.debug('>>>>>>>>>>>>>>>>>>>>>>>>> conCampMap'+conCampMap);
                    }
                     
                 
                    
                if(cm.ParentId != null)
                {
               // parentchildmap.put(cm.ParentId,campnId);
               /* if(!parentchildmap.containsKey(cm.ParentId))
                {
                parentchildmap.put(cm.ParentId,new set<id>());
                }
                 parentchildmap.get(cm.ParentId).add(cm.id); */
                 if(con.id == cam.ContactId && cam.campaignid==cm.id)
                {        
                    if(!contactcampaignId.containsKey(con.Id))
                    {
                          contactcampaignId.put(con.Id,new set<id>());
                    }
                     contactcampaignId.get(con.Id).add(cam.campaignid);
                    
                      //  contactcampaignId.put(con.Id,allChildcmpainIds );
                 if(!parentchildmap.containsKey(cam.Campaign.ParentId))
                {
                parentchildmap.put(cam.Campaign.ParentId,new set<id>());
                    selectedcontactids.add(cam.contactID);
                    
                }
                 parentchildmap.get(cam.campaign.ParentId).add(cam.campaignid);
                 }
                    
                    childcampId.add(cm.id);
                    campaignMap.put(cm.ParentId,conCampMap);
                }
            }
        }
        }
         if(!selectedcontactids.isEmpty() && selectedcontactids != null)
        {
            selectedcontactList = [select id,Entitled_Document_Groups_Last_Updated__c,Entitled_Document_Groups__c from contact where id =:selectedcontactids];
        }
         System.debug(' parentchildmap>>>>>>>>>>>>>>>>>>>>>>>>> selectedcontactList'+selectedcontactList);
          System.debug(' parentchildmap>>>>>>>>>>>>>>>>>>>>>>>>> parentchildmap'+parentchildmap);
          System.debug('>>>>>>>>>>>>>>>>>>>>>>>>> campaignMap'+campaignMap);
        System.debug('>>>>>>>>>>>>>>>>>>>>>>>>> childcampId'+childcampId); 
        for(campaign cmps:parentCamList)
        {
        for(contact con:selectedcontactList)
        {
            for(id conid:contactcampaignId.keyset())
            {
                
           
        for(id parent:parentchildmap.keyset())
        {
        integer mapValue = Integer.ValueOf(parentchildmap.get(parent).Size());
        //set<id>str= parentchildmap.get(parent);
        System.Debug('%%%%%%%%%%%%%%%%%%% '+mapValue);
        System.Debug('%%%%%%%%%%%%%parent%%%%%% '+parent);
        System.Debug('%%%%%%%%%%%%%parent%%%%%% '+cmps.id);
         System.Debug('%%%%%%%%%%%%%parent%%%%%% '+cmps.Service_Reports__c);
          System.Debug('%%%%%%%%%%%%%parent%%%%%% '+parentchildmap.get(parent).Size());
        if(cmps.id == parent && cmps.Service_Reports__c == parentchildmap.get(parent).Size())
        {
          rixmlSet.add(cmps.RIXML_Code__c);
         String sourceStr = '';
                                Set<String> str=new set<String>();
                                rixmlSet.add(con.Entitled_Document_Groups__c);  
                                System.debug('&*&*&*&*&*&*&*&*'+rixmlset);
                                for(String s:rixmlSet) 
                                {
                                    //  sourceStr += (sourceStr==''?'':',') + s; 
                                    if(s!=null)
                                    {
                                        sourceStr += s;
                                        str.add(s);
                                        sourceStr += ',';
                                    }
                                    system.debug('$%$%$%$%$%$%$%$ sourceStr '+sourceStr );
                                }
                                
                                set<string> memberIds = new set<string>();
                                for (String str1:sourceStr.split(','))
                                {
                                    memberIds.add(str1);
                                    
                                }
                                
                                // System.debug('%^%^%^%^%^%^%^%%%^%^%'+memberIds.remove(null));
                                String uniquemembers = JSON.serialize(memberIds).replaceAll('["\\[\\]]','');               
                                //system.debug(members);
                                system.debug(uniquemembers);
                                
                                con.Entitled_Document_Groups__c=uniquemembers;
                                con.Entitled_Document_Groups_Last_Updated__c=system.today(); 
                                UpdateCon.put(con.id,con);
        }
        }
        }
        }
        }
        
        if(UpdateCon !=null)
        {
            Database.update(UpdateCon.values(),false);
        }
    }
}

Advance thanks for your help.

Thanks.
  • December 13, 2017
  • Like
  • 0
Hi Folks,

I have one requirement , 1 parent Campaign (Field have one Check box same value will be updated in contact) , 5 child campaign, and for each five campaign we can add multiple cmapaign members, In campaign member we have a contact field, I need to update the contact (One check box field to true).
If and only if This contact is added to all Child Campaign (In this case 5 child campaign ,)
if contact is not added to any child campaign no update is required in contact.
Can any one sugget me how to identify either contact is added to all child campaigns(basically throgh campaign memners)


Thanks.
 
  • December 11, 2017
  • Like
  • 0
Hi All,

I have requirement I need to create Funnel Dashboard using Visualforce page chart,I am not able to find any Funnel type component in Visualforce chart,can any one help me how to implement funnel visualforce  Chart in salesforce,
(With out creating report directly i have to implement Funnel type Dashboard in Visualforce Chart)

Thanks for your inputs.
  • October 06, 2016
  • Like
  • 0
Hi Team,

I have the existing angular form , I want display them in salesforce.
I have uploaded the angular files in static resuorces and written below component but i'm not getting the results.
<aura:component access="global" implements="flexipage:availableForAllPageTypes" >
      <lightning:container aura:id="AngularApp"
                             src="{!$Resource.AngularTest + '/index.html'}" /> 
</aura:component>

Getting this error in console : 
Access to XMLHttpRequest at 'https:proxy?_=1608281927787' 
(redirected from 'https:services/proxy?_=1608281927787') 
from origin 'https:venky.lightning.force.com' 
has been blocked by CORS policy: Response to preflight request doesn't pass 
access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Anyone have any idea how to disply the angular forms in SFDC lightning, Angular files uploaded in SFDC static resource
  • December 18, 2020
  • Like
  • 0
Hi All,

I have requirement I need to create Funnel Dashboard using Visualforce page chart,I am not able to find any Funnel type component in Visualforce chart,can any one help me how to implement funnel visualforce  Chart in salesforce,
(With out creating report directly i have to implement Funnel type Dashboard in Visualforce Chart)

Thanks for your inputs.
  • October 06, 2016
  • Like
  • 0
Hello,

I'm trying to access a csv document in my Document sObject via apex (in order to parse the csv). I know how to parse CSV one I get the data (there are many articles on that part), but I'm not sure how to grab the document from the documents sObject in the first place!

How do I reference the CSV document (in sObject Document) from Apex?

I did see that a URL is returned from the following query:
​SELECT body From Document WHERE name = 'myCSV'
That returns something like:
/services/data/v32.0/sobjects/Document/00000UptFER/Body
Do I need to point the parser to that address?



Thank you!