• Devid John
  • NEWBIE
  • 30 Points
  • Member since 2018

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
what is wrong with this code? It says - "Arithmetic expressions must use numeric arguments (4:43)",
  Please help.
trigger AutoPopAccPerDate on Billing__c(before insert, before update) {
  for (Billing__c billing : Trigger.new) {
    if (billing.Accounting_Date__c == null) {
      billing.Accounting_Date__c = Billing__c.Billing_Date__c + 30; 
    }
  }
}

 
This below code is working perfect with 10 mb but when I try to upload more than 10mb file then it throws an error.
private string TOKEN = 'access_token_of_dropbox_app';//
string folderPathWithFileName;
for(ContentVersion contentVersionRec : [SELECT PathOnClient, VersionData FROM contentversion
										   WHERE contentdocumentId IN : contentDocumentIdSet){
	folderPathWithFileName = '/Root/'+PathOnClient;//PathOnClient contains file name with extension like imagefile.png
	system.debug('###folderPathWithFileName=>'+folderPathWithFileName);
	Http http = new Http();
	HttpRequest httpReq = new HttpRequest();
	httpReq.setEndpoint('https://content.dropboxapi.com/2/files/upload');
	httpReq.setMethod('POST');
	httpReq.setHeader('Authorization','Bearer ' + TOKEN);
	httpReq.setHeader('Content-Type','application/octet-stream');
	httpReq.setHeader('Dropbox-API-Arg','{"path":"'+folderPath+'","mode":{".tag":"add"}}');
	httpReq.setBodyAsBlob(contentVersionRec.VersionData);
	HttpResponse httpResponse = http.send(httpReq);
	System.debug('res###' + httpResponse);
	System.debug('res.getBody()###'+httpResponse.getBody());
	if (httpResponse.getStatusCode() == 200) {
		System.debug('##Congratulations File Uploaded successfully :) =>'+httpResponse.getBody());
	}else{
		//Handle code here when file not uploaded. 
	}
}

The error is : System.CalloutException: Exceeded max size limit of 12000000 with request size 12001280

I know(limit while sending http request) reason of this error but there should be a way to send more than 10mb file. Actually I need to upload up to 100 mb file from http request(Salesoforce) to dropbox.

If anyone have any idea please help.

I have enabled 'Campaign Influence" in my org and using 
Primary Campaign Source Model as default model and trying to get how this default model works to populate campaign influence records.

To undestand this I have created trigger on CampaignInfluence because after enabling Campaign Influence setting when we populate primary campaign source lookup on opportunity then it automatically create  CampaignInfluence records based on auto association configurations.

trigger CampaignInfluenceInsert on CampaignInfluence (before insert,after insert,before update,after update, before delete,after delete, after undelete) {
    system.debug('@@@@@CampaignInfluenceInsert=>');
   

I just want to that how this default "Primary Campaign Source Model" works to populate campaign influence records because we have to use  different behaviours that determines for the assignment of campaign influence so we can use more influence rather than using a primary influence

This below code is working perfect with 10 mb but when I try to upload more than 10mb file then it throws an error.
private string TOKEN = 'access_token_of_dropbox_app';//
string folderPathWithFileName;
for(ContentVersion contentVersionRec : [SELECT PathOnClient, VersionData FROM contentversion
										   WHERE contentdocumentId IN : contentDocumentIdSet){
	folderPathWithFileName = '/Root/'+PathOnClient;//PathOnClient contains file name with extension like imagefile.png
	system.debug('###folderPathWithFileName=>'+folderPathWithFileName);
	Http http = new Http();
	HttpRequest httpReq = new HttpRequest();
	httpReq.setEndpoint('https://content.dropboxapi.com/2/files/upload');
	httpReq.setMethod('POST');
	httpReq.setHeader('Authorization','Bearer ' + TOKEN);
	httpReq.setHeader('Content-Type','application/octet-stream');
	httpReq.setHeader('Dropbox-API-Arg','{"path":"'+folderPath+'","mode":{".tag":"add"}}');
	httpReq.setBodyAsBlob(contentVersionRec.VersionData);
	HttpResponse httpResponse = http.send(httpReq);
	System.debug('res###' + httpResponse);
	System.debug('res.getBody()###'+httpResponse.getBody());
	if (httpResponse.getStatusCode() == 200) {
		System.debug('##Congratulations File Uploaded successfully :) =>'+httpResponse.getBody());
	}else{
		//Handle code here when file not uploaded. 
	}
}

The error is : System.CalloutException: Exceeded max size limit of 12000000 with request size 12001280

I know(limit while sending http request) reason of this error but there should be a way to send more than 10mb file. Actually I need to upload up to 100 mb file from http request(Salesoforce) to dropbox.

If anyone have any idea please help.
what is wrong with this code? It says - "Arithmetic expressions must use numeric arguments (4:43)",
  Please help.
trigger AutoPopAccPerDate on Billing__c(before insert, before update) {
  for (Billing__c billing : Trigger.new) {
    if (billing.Accounting_Date__c == null) {
      billing.Accounting_Date__c = Billing__c.Billing_Date__c + 30; 
    }
  }
}

 
I created a lightning:datatable to show a number of records and need to add pagination to it.  The table has sorting which is a requirement and must be done on the client side.  Is there a way to add pagination to a lightning datatable?