• DJ 367
  • NEWBIE
  • 150 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 64
    Questions
  • 56
    Replies
Hi ,

I am trying to pass value from child component to GrandChild. I am getting the value in Parent but not in GrandParent. In GrandParent I am able to alert anything but when I alert the value from child component then it not printing, it says " Name is  : undefined".

Here is my code --

<!--- Child Component bubblePhseChld-->
<!--- Child Component bubblePhseChld--> 
<template>
    <!-- Bubbule Phase example-->
    <div class="slds-m-around_small">
        <lightning-button label="Child Button"
                          variant="brand"
                          onclick={handleChildEvent}>
                        </lightning-button>
    </div>
</template>

----------

import { LightningElement,api } from 'lwc';

export default class BubblePhseChld extends LightningElement {
    @api Name = "James";
    @api Age = 22;
    @api Country = "India";

    handleChildEvent(event){

        const selectedEvent  = new  CustomEvent("condidate",
            {
                bubbles : true,
                composed : true
            }
        
        );

        this.dispatchEvent(selectedEvent);
            

    }
}

Parent Cmp
 
<!-- Parent Component: bubblePhseParent -->

<template>
    <div oncondidate={handleParentEvent}> 
        <c-bubble-phse-chld ></c-bubble-phse-chld>
    </div>
</template>

------------
import { LightningElement } from 'lwc';

export default class BubblePhseParent extends LightningElement {

    handleParentEvent(event){
        alert('Hi Im in Parent');
        alert(' Name is  : ' + event.target.Name);
        alert(' Age is  : ' + event.target.Age);
        alert(' country is  : ' + event.target.Country);
    }
}

GrandParent
 
<!-- bubblePhseGrandParent -->

<template>
    <div oncondidate={handleGrandEvent}>
             <c-bubble-phse-parent ></c-bubble-phse-parent> 
          
    </div>
</template>

------
import { LightningElement } from 'lwc';

export default class BubblePhseGrandParent extends LightningElement {

    handleGrandEvent(event){
        alert('Hi Im in Grand Parent');
        alert(' Name is  : ' + event.target.Name);
        alert(' Age is  : ' + event.target.Age);
        alert(' country is  : ' + event.target.Country);
    } 

}

​​​​​​​
Hello Everyone,
I am working on one of the requirment where I am uploading files into salesforce and sending it to external server . While I cross verify in external server , I am able to open only text fomrat other than .txt none other format is opening and (point-2) another thing is if file size is more than 5 MB it is faling to send to external server . Need help if someone has ever faced similer challage.
Thanks.
Hello All,

While I am encoding string it works file but while I am encidung list of string it throwing above error. Any suggestions? thanks
 
String bodyEncoded = EncodingUtil.base64Encode(Blob.valueOf(StrBody));
       (this is working fine)

        List<string> bodyEncoded = EncodingUtil.base64Encode(Blob.valueOf(lstStrBody));
       (This is throwing error)

 
Hello All,

Any way to fix this. Thanks
 
global class TEstLog implements Database.Batchable<sobject> {   
    
    global Database.QueryLocator start(Database.BatchableContext bc){
        return Database.getQueryLocator('Select Id,Document_Process_Date__c,Workspace__c,CreatedBy.Name,Folder_Name__c,CreatedDate,CreatedById from FileImporter__c where  CreatedDate = today and Doc_Status__c != null');

    } 

    global void execute(Database.BatchableContext BC, list<Sobject> obj){  
        List<File_Importer_Log_Entry__c> lstLogEntry = new List<File_Importer_Log_Entry__c>();
        
        system.debug('lstFileImpor******' + obj); 
        for(Sobject o : obj){
            FileImporter__c  M = (FileImporter__c ) o;
            File_Importer_Log_Entry__c ML = new File_Importer_Log_Entry__c();
            ML.created_by__c = M.CreatedBy.Name;
            ML.Document_Process_Date__c = M.Document_Process_Date__c;
            ML.WorkspaceId__c = M.Workspace__c;
            ML.Workspace_Name__c = M.Folder_Name__c; 
            ML.Created_Date__c = M.CreatedDate;
            lstLogEntry.add(ML);
        }
        system.debug('lstLogEntry*******' + lstLogEntry);
        
        try{
            insert lstLogEntry;
			
        //List<blob> lstBody;
        Blob body;
        for(File_Importer_Log_Entry__c objLog : lstLogEntry){
             body = Blob.valueOf('Created By:'+objLog.created_by__c+'/n'+'Document Process Date :'+objLog.Document_Process_Date__c+'/n'+'WorkspaceId :'+objLog.WorkspaceId__c+'/n'+'Workspace Name'+objLog.Workspace_Name__c+'/n'+'Created Date :'+objLog.Created_Date__c);
            //lstBody.add(body);
        }
        
			system.debug('******body :' + body);
			String loginToken = MSOP_iManage_Service.getLoginToken();
			String targetUrl = 'https://test.com/api/v1/folders/folderName/documents';
			HttpRequest req = new HttpRequest();
			req.setEndpoint(targetUrl);
			req.setHeader('x-auth-token', loginToken);
			req.setHeader('Content-Type', 'application/json');
			req.setMethod('POST'); 
			req.setBodyAsBlob(Body);  
			//req.setBody(Body);
			Http http = new Http();
			HttpResponse res = http.send(req);
			system.debug('**********res : ' + res);  
        }catch(DmlException e){
            system.debug('***Error while inserting log entry - BatchName:FileImpoLog :' + e.getMessage());
        }
  
    }
    
    global void finish(Database.BatchableContext BC){                     

    }
}

 
Hello All,

I am querying record from one object and inserting to the other object but record is not getting inserted into another object. Can someone help me pls. Thanks

here is my code:
global class FileImpoLog implements Database.Batchable<sObject>{   
    global Database.QueryLocator start(Database.BatchableContext bc){
        date d=system.today();            
        return Database.getQueryLocator([Select Document_Process_Date__c,Workspace__c,Folder_Name__c,CreatedDate,CreatedById from Importer_Submit__c ]);      
    } 

    global void execute(Database.BatchableContext BC, list<Importer_Submit__c> lstFileImpor){  
        system.debug('lstFileImpor******' + lstFileImpor);
        List<Importer_Log_Entry__c> lstLogEntry = new List<Importer_Log_Entry__c>();
        for(Importer_Submit__c M : lstFileImpor){
            Importer_Log_Entry__c ML = new Importer_Log_Entry__c();
            ML.created_by__c = string.valueof(M.CreatedBy);
            ML.Document_Process_Date__c = M.Document_Process_Date__c;
            ML.Workspace_Id__c = M.Workspace__c;
            ML.Workspace_Name__c = M.Folder_Name__c;
            ML.Created_Date__c = M.CreatedDate;
        lstLogEntry.add(ML);
        }
        system.debug('lstLogEntry*******' + lstLogEntry);
        
            insert lstLogEntry;
    }
    
    global void finish(Database.BatchableContext BC){                 

    }
}

 
Hello All,

I am writting trigger on ContentDocumentLink but while uploading file I am getting below error. need help please.

User-added image
 
trigger tesDocUpload on ContentDocumentLink (before insert) {
	List<string> strIds = trigger.newmap.keyset() ;
	 List<ContentDocumentLink> lstContDoc= [Select Id,ContentDocumentId From ContentDocumentLink where LinkedEntityId IN: strIds ];
	
		for(ContentDocumentLink cd : lstContDoc){
			if(lstContDoc.size() > 3){
				cd.addError('Only 3 files can be uploaded!');
			}
		}
}

 
Hello All,
I am querying 'ContentDocumentLink'  in javascript visualforce and I am getting above error any way to fix this. Thanks

Here I am getting proper id value(MyId) as well.
var Content ="Select Id,ContentDocumentId From ContentDocumentLink where LinkedEntityId="  + "'MyId'" ;
			var ContentQuery = sforce.connection.query(Content);
			var records = ContentQuery.getArray('ContentQuery');

 
Hello All,

I have a urgent requirment where I need to store file of 50 MB. <apex:inputFile> does not support this much large file, I tried with the below link but I am not able to write code. 
https://hub.appirio.com/tech-blog/upload-a-file-as-large-as-2gb-in-salesforce-using-a-visualforce-page

can someone please help me to achieve this. Thanks in advance.
Hello All,

I have an email id lets say abc@gmail.com, My requirment is whenever any email is send to abc@gmail.com it should record into email object or any custom object with the attachment. This is urgent , can someone please help me.

Thanks
Hi,

I am sending a large attachment from salesforce to an external system. While sending the attachments I am facing some issue, I am not able to send attachments size is greater than 12 MB, is there any possibility to send the attachments 12 MB?

Please let me know how to achieve this.

Thanks,
Vijay

hi all,

 

I have a list of String and want to convert to Blob data type, so which API method can help me to do this? I only know the Encodingutil.base64Decode(String) method, but each String in my List contains a large numbers of characters, if i append Strings the limitation exception has been raised. Please, help me!!!