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

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 6
    Replies
Having an issue creating a List object from a string value.  The selectedObject value is coming over as a string value.  Trying to convert the string value so that it can be used as the object in  a list or a Map

Class
private Sobject selectedStringSobject;

selectedObject = 'CustomObject__c'
selectedStringSobject =Util.getSobjectFromString(selectedObject);

List<selectedStringSobject> newrecords = new List<selectedStringSobject>()

Util
public static SObject getSobjectFromString(String stringObject) {
        Map<String, Schema.SObjectType> obj = Schema.getGlobalDescribe(); 
        Schema.SObjectType so = obj.get(stringObject);
        
        Sobject newObject = so.newSobject();
        return newObject;
    }

error is : Invalid type: selectedStringSobject






 
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

Hi every body I am creating a LWC that display a form with info from other object. The fields that I want to display from this objects are a Formula and a Lookup field but the Lookup field I want the text of this field not the lookup.
From the apex class y bring the data of the Id that i pass to this method and then I query with this Id and bring some text fields, formula fields and lookup fields.
But the problem is when I try to display de lookup fomula (only the Name not the posibility to modify this field) the info does not appear and the same happend to the Formula.
Can anybody help me? I cant find examples.
Having an issue creating a List object from a string value.  The selectedObject value is coming over as a string value.  Trying to convert the string value so that it can be used as the object in  a list or a Map

Class
private Sobject selectedStringSobject;

selectedObject = 'CustomObject__c'
selectedStringSobject =Util.getSobjectFromString(selectedObject);

List<selectedStringSobject> newrecords = new List<selectedStringSobject>()

Util
public static SObject getSobjectFromString(String stringObject) {
        Map<String, Schema.SObjectType> obj = Schema.getGlobalDescribe(); 
        Schema.SObjectType so = obj.get(stringObject);
        
        Sobject newObject = so.newSobject();
        return newObject;
    }

error is : Invalid type: selectedStringSobject






 
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?
Having an issue creating a List object from a string value.  The selectedObject value is coming over as a string value.  Trying to convert the string value so that it can be used as the object in  a list or a Map

Class
private Sobject selectedStringSobject;

selectedObject = 'CustomObject__c'
selectedStringSobject =Util.getSobjectFromString(selectedObject);

List<selectedStringSobject> newrecords = new List<selectedStringSobject>()

Util
public static SObject getSobjectFromString(String stringObject) {
        Map<String, Schema.SObjectType> obj = Schema.getGlobalDescribe(); 
        Schema.SObjectType so = obj.get(stringObject);
        
        Sobject newObject = so.newSobject();
        return newObject;
    }

error is : Invalid type: selectedStringSobject