• Shweta Alwani
  • NEWBIE
  • 80 Points
  • Member since 2015
  • Salesforce Developer
  • Metacube Software Pvt. Ltd.

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 16
    Replies
The flow should call apex class to create new record. The field values are given in flow screen, the class should get the values to create record. I'm having trouble in passing the flow variable to class. How to use the flow input values in apex class. Can anyone help me out in this please.
The flow should call apex class to create new record. The field values are given in flow screen, the class should get the values to create record. I'm having trouble in passing the flow variable to class. How to use the flow input values in apex class. Can anyone help me out in this please.
Hi All,

I have case record which has been created by sys admin, in the case record user A has created task and it is assigned to User B. Now user A trying to edit the task record which he has been created. user A is getting error message as Insufficient privileges.

OWD sharing on Activities object has been set for private. if i change this to Controlled by parent user A able to edit the record. 

Is there any possibility without changing OWD sharing, can we give edit permission to user A.

Thanks,
Anil Kumar

The setup:
1. Org contains a custom object called objectX__c
2. A packaged app also contains a custom object called objectX__c but Salesforce automatically added a namespace there i.e. `someapp__.objectX__c`
3. The org has a custom lookup field on the account that looks to objectX__c, i.e. `Account.lookup_objectX__c`
4. The package app tries to run a query as `select id, lookup_objectX__r.some_field__c from Account`
5. This error occurs 

No such column 'some_field__c' on entity 'someapp__objectX__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

This error should not be happening because the lookup field is setup correctly to look at the non-namespaced object, but Salesforce is looking at the namespaced object which then fail.

i am getting the error when i try to insert multiple records from data loader. It is working for single record.
User-added image
error is in <apex:outputPanel rendered="{!IF(finance__c.Income__c >=0,true,false)}"/> in <outputpanel> component .

I am trying to first check null values for the field to void the error,but i am stuck

1. first not sure whether we can check two if condition in output panel
2. <apex:outputText value=" to " rendered="{!IF(ISBLANK(finance__c.Income__c) , false , true)}" adding this line before  <apex:outputPanel rendered="{!IF(finance__c.Income__c >=0,true,false)}"/> but no luck

please help me with the solution
 
Hi All,
​         i want to create a trigger on Account to count number of opportinty and contact relateed to Account.
How to do it?
Any suggestion?
Hello,
We have a three level approval process for customer cases. I want to send an automated email to the customer when the case is approved for each step. The case record has a look up field to contact. When I add the recipients as the related contact, it still wouldn't send any email. Is there any workaround to do it? May be in workflow?
We are using a lightning component as quick action on a record, with a flow embedded in it. Now when someone open this quick action it sometimes give an error. Any help is appreciated. 

.cmp
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
    <ltng:require styles="{!$Resource.modalCSS}" />
	<aura:handler name="init" value="{!this}" action="{!c.init}" />
    <lightning:flow aura:id="flowData" onstatuschange="{!c.handleStatusChange}" />
</aura:component>
controller
({
    init : function (component) {
        // Find the component whose aura:id is "flowData"
        var flow = component.find("flowData");
        // In that component, start your flow. Reference the flow's Unique Name.
        var inputVariables = [
            { name : "recordId", type : "String", value: component.get("v.recordId") }
        ];
		// Start flow
        flow.startFlow("Teamwear_Internal_Flow",inputVariables);
    },
    handleStatusChange : function (component, event) {
        //Check if flow is finished
        if(event.getParam("status") === "FINISHED") {
            //redirect to record to force refresh
            var sobjectEvent=$A.get("e.force:navigateToSObject");
            sobjectEvent.setParams({
                "recordId": component.get("v.recordId")
            });
            sobjectEvent.fire();
        }
    }
})
Error:
lightning component with flow error

 
Hi All,

I am very new to Integration part. In my requirement fetching the data from third-party tool and displaying the records in my salesforce org. But i am getting Unexpected token 'Public'. at line 208 column 8. Please find the snippet below.
public class Getdata {

  
       @Auraenabled
    public Static list<wrapperclass> getDatalist(){
   
    HTTPRequest req = new HTTPRequest();
	String endpoint ='*******';
	req.setMethod('GET');
	 req.setEndpoint(endpoint);
     req.setTimeout(20000);   
	 String username = '*********';
	 String password = '*********';	
        
	// initialize the variables 
     String systemcode ='';
	Blob headerValue = Blob.valueOf(username + ':' + password);
    req.setHeader('Content-Type', 'application/json');
    req.setHeader('Authorization', 'Basic **********');
	
           
            HTTP h = new HTTP();
            HttpResponse resp = new HttpResponse();   
    		resp = h.send(req);
			system.debug('*************'+resp.getbody());
          //  return JSON.serialize(resp.getBody());
        
        list<string> Ids = new list<string> ();
        // Deseralise the response body
         JSONParser  parser1 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser1.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser1.getCurrentToken() == JSONToken.FIELD_NAME) && (parser1.getText() =='id')){
                parser1.nextToken();
                  //Get the list of Id's
                  Ids.add(parser1.getText());
                }
            }
        
        list<string> systemcodes = new list<string>();
         JSONParser  parser2 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser2.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser2.getCurrentToken() == JSONToken.FIELD_NAME) && (parser2.getText() =='systemcode')){
                parser2.nextToken();
                  //Get the list of Id's
                  systemcodes.add(parser2.getText());
                }
            }
        list<string> equipnumbers = new list<string>();
         JSONParser  parser3 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser3.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser3.getCurrentToken() == JSONToken.FIELD_NAME) && (parser3.getText() =='equipmentnumber')){
                parser3.nextToken();
                  //Get the list of Id's
                  equipnumbers.add(parser3.getText());
                }
            }
        
        list<string> srns = new list<string>();
         JSONParser  parser4 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser4.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser4.getCurrentToken() == JSONToken.FIELD_NAME) && (parser4.getText() =='srn')){
                parser4.nextToken();
                  //Get the list of Id's
                  srns.add(parser4.getText());
                }
            }
        
        list<string> relfrmevents = new list<string>();
         JSONParser  parser5 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser5.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser5.getCurrentToken() == JSONToken.FIELD_NAME) && (parser5.getText() =='releasefromevents')){
                parser5.nextToken();
                  //Get the list of Id's
                  relfrmevents.add(parser5.getText());
                }
            }
        
          list<Datetime> dailydates = new list<Datetime>();
         JSONParser  parser6 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser6.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser6.getCurrentToken() == JSONToken.FIELD_NAME) && (parser6.getText() =='dailystatsdate')){
                parser6.nextToken();
                  //Get the list of Id's
                  dailydates.add(parser6.getDateTimeValue());
                }
            }
        
        list<Boolean> Logdownloaded = new list<Boolean>();
         JSONParser  parser7 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser7.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser7.getCurrentToken() == JSONToken.FIELD_NAME) && (parser7.getText() =='iislogfiledownloaded')){
                parser7.nextToken();
                  //Get the list of Id's
                  Logdownloaded.add(parser7.getBooleanValue());
                }
            }
        
        list<Boolean> isabnormalres = new list<Boolean>();
         JSONParser  parser8 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser8.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser8.getCurrentToken() == JSONToken.FIELD_NAME) && (parser8.getText() =='isabnormalrestart')){
                parser8.nextToken();
                  //Get the list of Id's
                  isabnormalres.add(parser8.getBooleanValue());
                }
            }
        
        list<Boolean> isserviceengonsite = new list<Boolean>();
         JSONParser  parser9 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser9.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser9.getCurrentToken() == JSONToken.FIELD_NAME) && (parser9.getText() =='isserviceengineeronsite')){
                parser9.nextToken();
                  //Get the list of Id's
                  isserviceengonsite.add(parser9.getBooleanValue());
                }
            }
        
         list<Datetime> importtimestamp = new list<Datetime>();
         JSONParser  parser10 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser10.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser10.getCurrentToken() == JSONToken.FIELD_NAME) && (parser10.getText() =='importtimestamputc')){
                parser10.nextToken();
                  //Get the list of Id's
                  importtimestamp.add(parser10.getDatetimeValue());
                }
            }
        
        list<String> impversion = new list<String>();
         JSONParser  parser11 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser11.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser11.getCurrentToken() == JSONToken.FIELD_NAME) && (parser11.getText() =='importversion')){
                parser11.nextToken();
                  //Get the list of Id's
                  impversion.add(parser11.getText());
                }
            }
        
         list<String> fileids = new list<String>();
         JSONParser  parser12 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser12.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser12.getCurrentToken() == JSONToken.FIELD_NAME) && (parser12.getText() =='fileid')){
                parser12.nextToken();
                  //Get the list of Id's
                  fileids.add(parser12.getText());
                }
            }
        
         list<String> batchids = new list<String>();
         JSONParser  parser13 = JSON.createParser(resp.getbody());
        system.debug('Enter Parsing#####');
        while (parser13.nextToken() != null) {
          // system.debug('#####',+parser.getCurrentToken());
                if ((parser13.getCurrentToken() == JSONToken.FIELD_NAME) && (parser13.getText() =='batchid')){
                parser13.nextToken();
                  //Get the list of Id's
                  batchids.add(parser13.getText());
                }
            }
			
        lstWI = new list <wrapperclass>();
        for(integer i=0;i<Ids.size();i++ ){
            objWI = new wrapperclass();
            objWI.id = Ids[i];
            objWI.systemcode = systemcodes[i];
             objWI.equipmentnumber = equipnumbers[i];
             objWI.srn = srns[i];
             objWI.releasefromevents = relfrmevents[i];
             objWI.dailystatsdate = dailydates[i];
             objWI.islogfiledownloaded = Logdownloaded[i];
             objWI.isabnormalrestart = isabnormalres[i];
             objWI.isserviceengineeronsite = isserviceengonsite[i];
            objWI.importtimestamputc = importtimestamp[i];
            objWI.importversion = impversion[i];
            objWI.fileid = fileids[i];
            objWI.batchid = batchids[i];
            lstWI.add(objWI);	
        }
         
       // Getting the error here 
        Public class wrapperclass{
             @AuraEnabled
        Public wrapperclass objWI {get;set;}
           @AuraEnabled
        Public list <wrapperclass> lstWI{get;set;}
            @AuraEnabled
            public string id{get;set;}
            @AuraEnabled
            public string systemcode{get;set;}
            @AuraEnabled
            public string equipmentnumber{get;set;}
            @AuraEnabled
            public string srn{get;set;}
            @AuraEnabled
            public string releasefromevents{get;set;}
            @AuraEnabled
            public Datetime dailystatsdate{get;set;}
            @AuraEnabled
            public Boolean iislogfiledownloaded{get;set;}
            @AuraEnabled
            public Boolean isabnormalrestart{get;set;}
            @AuraEnabled
            public Boolean isserviceengineeronsite{get;set;}
            @AuraEnabled
            public Datetime importtimestamputc{get;set;}
            @AuraEnabled
            public string importversion{get;set;}
            @AuraEnabled
            public string fileid{get;set;}
            @AuraEnabled
            public string batchid{get;set;}
            
            
            
        }
        return lstWI;
    }

}

Please help me with this.

Adv Thanks,
VSK98 
  • July 23, 2018
  • Like
  • 0
Convert a Lead to an Opportunity using triger
Hi guys given two fields on the lead object:
FieldA__c
FieldB__c
 
I need to write a trigger to convert from Lead to opportunity every time a user fill out those two fields. Can anyone help me with the trigger?
 
Thanks in advance!