• Syed Insha Jawaid 2
  • SMARTIE
  • 752 Points
  • Member since 2018

  • Chatter
    Feed
  • 24
    Best Answers
  • 0
    Likes Received
  • 6
    Likes Given
  • 1
    Questions
  • 197
    Replies
public class testingarryfuction {

   public StateInfodetails StateInfodetailswraper{get;set;}
   public string Stateidselected{get;set;}
   public boolean isSelected{get;set;}
    public  testingarryfuction (){
    
    
    
    string teststring ='{ "sucess":1,"data":{"Stateidselected":"2","StateInfodetails":{"stateName": "Andrapradesh","value": "apx" ,"rating":5},"isSelected":true}}';
    Map<String, Object> maptest =   (Map<String, Object>) JSON.deserializeUntyped(teststring);
    system.debug('mapped and deserialized data is::'+maptest);
         
           
      Object ob = (Object)maptest.get('data');    
       system.debug('get data is::'+ob);
       
     String srlze  = System.JSON.serialize(ob); 
      system.debug('again deserailized is ::'+srlze );
      
       StateInfodetailswraper = (StateInfodetails)System.JSON.deserialize(srlze,StateInfodetails.class);
     system.debug('deserilize using the wrapperclass::::::'+StateInfodetailswraper );
      system.debug(StateInfodetailswraper.stateName);
    }
    
    
     //this is a wrapper class 
     public class StateInfodetails{
     public string stateName{get;set;}
     public string  value{get;set;}
     public integer rating{get;set;}
    
   }

   
   
   
  
}

After debugging , iam getting the value as: NULL...!

Can anyone have a solution to serialize it .. thank you ...!
I am trying to call the flow through an apex class I created to attach the files to the Account object using Conga Template. This is the apex class I had created for the same.
@RemoteAction
public class FileAttachment{

    @InvocableMethod
    public static void file(List<Id> presId) {
        
        Set<Id> presc = new Set<Id>();
        presc.addAll(presId);
        
        sendReq(presc);
        
    }
    
    @future(callout=true)
    public static void sendReq(Set<Id> medId) {
        
        HealthCloudGA__EhrMedicationPrescription__c m = [SELECT Id,HealthCloudGA__Prescriber__c,HealthCloudGA__Account__c 
                                                         FROM HealthCloudGA__EhrMedicationPrescription__c
                                                         WHERE Id IN :medId];  
        
        Account a = [SELECT Id,FirstName,LastName FROM Account WHERE Id = :m.HealthCloudGA__Account__c];
        
        String sessId = UserInfo.getSessionId();
        String servUrl = Url.getSalesforceBaseUrl().toExternalForm()+'/services/Soap/u/29.0/'+UserInfo.getOrganizationId();
        
        String url2 = 'https://www.appextremes.com/apps/conga/pm.aspx'+
            '?sessionId='+sessId+
            '&serverUrl='+EncodingUtil.urlEncode(servUrl, 'UTF-8')+
            '&id='+m.Id+
            '&TemplateId=a2n0i0000000U09AAE'+
            '&QueryId=[Account]a2f0i00000003cN%3Fpv0%3D'+m.HealthCloudGA__Account__c+','+
            '[Dosage]a2f0i00000003by%3Fpv0%3D'+m.Id+','+
            '[DoctorLicense]a2f0i00000003cX%3Fpv0%3D'+m.HealthCloudGA__Prescriber__c+
            '&SC0=1'+
            '&SC1=SalesforceFile'+
            '&DS7=1'+
            //'&OFN=Prescription+'+a.LastName+'+'+
            '&AttachmentParentId='+m.HealthCloudGA__Account__c+
            '&DefaultPDF=1&APIMode=1';
        
        
        System.debug(url2);
        
        Http http = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url2);
        req.setMethod('GET');
        req.setTimeout(60000);
        
        // Send the request, and return a response
        HttpResponse res = http.send(req);
        System.debug(res);
        
        
        //return res.getStatus() + ' => ' + res.getBody();
        
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'wade08@gmail.com'};

        semail.setToAddresses(toAddresses); 
        semail.setSubject('Single Email message Example'); 
        semail.setPlainTextBody('Hello!!!!!!!!!!This is a test email to test single email message program '+url2); 
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail}); 
    }
}



And I executed this in the anonymous window:
System.debug(''+FileAttachment.sendReq('a0z0i000000630vAAA'));




I am getting this error:
Line: 1, Column: 32
Method does not exist or incorrect signature: void sendReq(String) from the type FileAttachment
 
  • December 02, 2019
  • Like
  • 0
Hello,

I'd really appreciate some help. Our instance migration is happening this weekend. I've tried using Eclipse with Force.com IDE to find our hard-coded references, and have followed the instructions here https://help.salesforce.com/articleView?id=000230820&language=en_US&type=1
however, every time I search, I get zero results. Where am I going wrong??

I really need some help. I don't understand why this is happening when I've followed the instructions?

Thanks
Hello,

I am sending an email from the apex code, the email is getting attached to th accounts but the attachments are not geting attached to the email.
Attachments section is null
I have made an @invocableMethod , And I grab some values like Queue ID and Record ID form my Custom Object (QueueDistroHelper__c) . 
All I want to do is Get all users who are in  the Queue (I grab the queue ID from custom field on the Custom object) . And then show all that users on  a field called Queue_Members__c on same Custom object . 
I am not able to add the results to custom field 
Here is my code 
 
global class lookUpAccountAnnotation {
public class inputValues{
        @InvocableVariable(label='Queue ID' required=true)
        public string QueueId;
        @InvocableVariable(label='Record Id' required=true)
        public Id recordid;
       
    }
   @InvocableMethod
    public static void deletePackageLicense(List<inputValues> inputs){
    
      for (inputValues i : inputs)
   {
      List<QueueDistroHelper__c> getcurrentobject =  [SELECT Queue_Members__c FROM QueueDistroHelper__c WHERE Id=:i.recordid  LIMIT 1];
      List<User> users =  [SELECT
                    id,name
                FROM
                    user
                WHERE
                    id IN ( SELECT userOrGroupId FROM groupmember WHERE groupId = :i.QueueID )
                    AND
                    isActive = true
                ORDER BY
                    firstName];
      for (User test : users ){
     //Add User.name in Queue_Members__c
      }
      }
   }
}

So all I want to do is add the test.name to  Queue_Members__c
Hello,  we are going to start to restrict some objects sharing, and we found that we cannot create the __share custom metadata for the objects, as per the documentation, salesforce creates them when the sharing of the objet is changed from public.

Our concer is that we have a metadata repository to store all our project metadata, and to use it to deploy at our different orgs (Dev, Int, Pre) prior to deploy to prod, but so far, we are not able to find the metadata type to be used with ANT to download this custom metadata named "...__shared"
Not sure if is because this is not available, or if it has a different metadata type. We just want to generate the __share, extract it with ANT from one Sandbox, and upload to a different one with ANT (if this is not possible, almost to get it from the sandbox and store it at our repository)
Here I have written code for lightning component. I have needed that when error occures then button should not call action 

<aura:component controller="ContactsController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">
    <aura:attribute name="conInfo" type="contact" default="{'sobjectType':'contact','LastName':'','firstName':''}"/>
    <!-- CREATE NEW Contact -->
    <div aria-labelledby="newconform" style="display:flex;justify-content:center;">
        <!-- BOXED AREA -->
        <fieldset class="slds-box slds-theme--default" style="width:40%;">
        
            
            <form class="slds-form--stacked">          
                <lightning:input  aura:id="conform" label="First Name"
                                 name="VSMfname"
                                 value="{!v.conInfo.firstName}"
                                 messageWhenValueMissing="First Name is Required."
                                 required="true"/> 
                <lightning:input aura:id="conform" label="Last Name"
                                 name="VSMlname"                            
                                 value="{!v.conInfo.lastName}"
                                 messageWhenValueMissing="Last Name is Required."
                                 required="true"/>
                <lightning:input aura:id="conform" label="Email"
                                 name="VSMemail"                            
                                 value="{!v.conInfo.email}"
                                 messageWhenValueMissing="Email is Required."
                                 required="true"/>
                  <lightning:input aura:id="conform" label="Phone"
                                 name="VSMphone"                            
                                 value="{!v.conInfo.phone}"
                                 messageWhenValueMissing="Phone is Required."  
                                 required="true"/>
                   <lightning:input aura:id="conform" label="Street"
                                 name="VSMstreet"                            
                                 value="{!v.conInfo.MailingStreet}"
                                 messageWhenValueMissing="Street is Required."    
                                 required="true"/>
                   <lightning:input aura:id="conform" label="City"
                                 name="VSMcity"                            
                                 value="{!v.conInfo.MailingCity}"
                                 messageWhenValueMissing="City is Required."    
                                 required="true"/>
                 <lightning:input aura:id="conform" label="State"
                                 name="VSMstate"                            
                                 value="{!v.conInfo.MailingState}"
                                 messageWhenValueMissing="State is Required."  
                                 required="true"/>
                        <lightning:input aura:id="conform" label="Country"
                                 name="VSMcountry"                            
                                 value="{!v.conInfo.MailingCountry}"
                                 messageWhenValueMissing="Country is Required."         
                                 required="true"/>
                <lightning:button label="Next" 
                                  class="slds-m-top--medium"
                                  variant="brand"
                                  onclick="{!c.clickCreate}"/>
            </form>
            <!-- / CREATE Contact -->
            
        </fieldset>
        <!-- / BOXED AREA -->
    </div>
    
    
</aura:component>
I'm braindead today and can't figure out the simplest of things.  

I have a custom object called VRNA__Policy__c.  
This object has a lookup relationship to ACCOUNT that's called VRNA__Issuing_Carrier__c.
I need to get the email address from the ACCOUNT lookup (VRNA__Issuing_Carrier__c) that's on the Policy record. 

This basic query works fine, but doesn't get the email address:
[SELECT VRNA__Issuing_Carrier__c FROM VRNA__Policy__c WHERE VRNA__Account__c =: Id AND RecordTypeID = '012f4000000giyZ']

I've tried:
[SELECT VRNA__Issuing_Carrier__c.email__c FROM VRNA__Policy__c WHERE VRNA__Account__c =: Id AND RecordTypeID = '012f4000000giyZ']

Shouldn't that work?  I'm getting an error that it doesn't understand the relationship.   
Hello,

I created a flow and a button to launch it.
The flow was debuged and works perfectly. But when I try to launch it using a custom button I receive an error:

"We can't launch this flow because of a variable error. Send this error message to your admin. The value 19/12/2019 is being provided for variable TermEndDate but isn't compatible with the variable's data type (Date)...
As you can see the value is Date type. I doubled checked that the field referenced is indeed Date type.

Can anyone please direct me to how to solve this?

Thanks,
Tal
Hi,

I have a question about campaign influence. 

So I know that if a contact is added to an opportunity that any campaign that was associated to the contact before the contact is associated with the opportunity will be added to the opportunity. My question is if that contact is added to another campaign before the opportunity closes will the newly added campaign be added to the opportunity. 

If the answer is no, is there a way to create a trigger that will do it for me?

Thanks,
Edward
Hi all,
Need help in trigger,

Whenever a Contact is updated and only if any of the values for the below fields changed(Oldmap and NewMap values.)

Member Id
Preferred language
Phone

For all the contacts verified against Opportunity Contact roles with IsPrimary = true. Then fetch all the Opportunities and update the values for corresponding 3 fields in Opportunity record.

Costco Member Id
Preferred language
Phone
One day we could access our partner community with no problem, the next we are getting a blank screen when logging in, and the error above when in the builder.  I am at a loss.  I have not done any special coding, and I am not getting the help I need to resolve my issue.  Help!
Hello,

I have below error when i run the ANt retrive command
Buildfile: C:\Users\Gyra\Music\apache-ant-1.9.4\bin\build.xml

FTOQ_test:
[sf:retrieve] Note: use ant -verbose to get more information on the failure

BUILD FAILED
C:\Users\Gyra\Music\apache-ant-1.9.4\bin\build.xml:14: Failed to login: Failed
 to send request to https://test.salesforce.com/services/Soap/u/38.0

Total time: 23 seconds
 
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>teestper</members>
        <name>ApexClass</name>
    </types>
    <version>38.0</version>
</Package>

any suggestions ?
Need to understand what this lines of Trigger actually means as I'm new to Triggers.
if(salesAreaMatched)
							{
                                if(Trigger.isInsert)
								{ 
								opportunity.CurrencyISOCode = accountSalesArea.CurrencyISOCode; 
								}
                                opportunity.Account_Sales_Area_TI__c = accountSalesArea.Id;
                                opportunity.INCO_Term__c = accountSalesArea.Incoterms__c;
                                if(!String.isBlank(accountSalesArea.Price_List__c))
                                opportunity.Price_List__c = accountSalesArea.Price_List__c;
                                
                                if(Trigger.isInsert && Trigger.isBefore && opportunity.Payment_Term__c == null)
                                {
                                    opportunity.Payment_Term__c = accountSalesArea.Payment_Terms__c;
                                }
                                else if(Trigger.isUpdate && Trigger.isBefore)
                                {
                                    Opportunity tempOpty = (Opportunity)Trigger.oldMap.get(opportunity.Id);
                                    if(tempOpty.Sales_Area__c != null && tempOpty.Sales_Area__c != opportunity.Sales_Area__c && tempOpty.Payment_Term__c == opportunity.Payment_Term__c)
                                    {
                                        opportunity.Payment_Term__c = accountSalesArea.Payment_Terms__c;
                                    }
                                }
                                //opportunity.Payment_Term__c = accountSalesArea.Payment_Terms__c;
                                opportunity.INCO_Term_Location__c = accountSalesArea.Incoterms_2__c;
                                break;
                            }

 
Hello All,
how to retrieve record id from map using custom filed.
List<String> lststringid =  new List<String>();
                for(Servicing_Error__c se : lstservicingerror)
                {
                    if(se.Fastrack_Work_Order__c != null)
                    {
                         lststringid.add(se.Fastrack_Work_Order__c) ;  
                    }   
                }
                Map<id,workOrder> mapWorkOrder = new Map<id,workOrder>([Select id,FAStrackIdentifier__c from WorkOrder where FAStrackIdentifier__c IN:lststringid]); 
                
                System.debug('Keyset'+mapWorkOrder);
                
                for(Servicing_Error__c se2:lstservicingerror)
                {
                    if(Se2.Fastrack_Work_Order__c != null)
                    {
                        System.debug('mapWorkOrder.get(se2.Fastrack_Work_Order__c).id'+mapWorkOrder.get(se2.Fastrack_Work_Order__c).id);
                         se2.Fastrack_Work_Order__c = mapWorkOrder.get(se2.Fastrack_Work_Order__c).id; 
                    }
                }


I am getting below error:
System.StringException: Invalid id: 23982178: External entry point
Hi All,

I am trying to output a date type of yyyy-MM-dd, not as a string. I can create the correctly formatted string and insert that into a set.
currentDate = Date.today().toStartofMonth(); // Outputs 2018-12-01 00:00:00

firstDayOfCurrentMonth = currentDate.addMonths(i).toStartofMonth();

String currentDateString = String.valueOf(firstDayOfCurrentMonth).removeEnd(' 00:00:00'); // Outputs 2018-12-01 as a string

However, the issue is converting that string back into the Date type using either .valueOf or .parse
Date.valueOf(currentDateString);
// Outputs 2018-12-01 00:00:00

Date.valueOf(currentDateString.removeEnd(' 00:00:00'))
// Outputs 2018-12-01 00:00:00

Date.parse(currentDateString)
// Throws error with Invalid Date : 2018-12-01

My question is, how can I convert the correctly formatted string back into the Date type?

Many thanks!!
 
Hi all,
How to add multiple charts for reports? Please help me.
Thanks 
Manju
Hi,
Created a datatable to update the multiple records but this is not supported on the Mobile. 

So I  am iterating a record edit form and want to change the status of selected records to active.
How can i get this done.
Thanks
Hello,
I have custom object Location__c and custom field on Account.SAP_BP_ID__c. The custom Object Location__c has fields AccountID__c and SAP_ID__c. Location__c will be populated via API in back ground. Location__c.AccountID__c has lookup relationship with Account. I need a trigger to update the AccountID__C on Location__c object with Account.ID whenever a new location is created. 
Update Location__c.AccountID__c where Location__c.SAP_BPID__c = Account.SAP_ID__c
and Location__c.AccountID__c has lookup relationship with Account (sorry to repeat)

Thanks
Dinesh
  • December 15, 2018
  • Like
  • 0
Hi 
Is it possible to get back the metadat of a deleted scratch org?
Hello,
I try to show a child list on the contact page.
A contact has several vehicles. I want to select one and make some further processing. So I created a related list on the contact page. There you can now click on the vehicle that you want to choose and it opens vehicle-object-detail-page. There I want to have an flow that grabs somehow the ContactID from the contact. With the contact ID I can work further.
But when I start the flow at the vehicle-object-detail-page it only grabs the RecordID of the vehicle. I cant filter in the flow SELECT Name, E-Mail FROM Contact WHERE RecordID = Contact.Vehicle.ID
Can someone help me?
public class testingarryfuction {

   public StateInfodetails StateInfodetailswraper{get;set;}
   public string Stateidselected{get;set;}
   public boolean isSelected{get;set;}
    public  testingarryfuction (){
    
    
    
    string teststring ='{ "sucess":1,"data":{"Stateidselected":"2","StateInfodetails":{"stateName": "Andrapradesh","value": "apx" ,"rating":5},"isSelected":true}}';
    Map<String, Object> maptest =   (Map<String, Object>) JSON.deserializeUntyped(teststring);
    system.debug('mapped and deserialized data is::'+maptest);
         
           
      Object ob = (Object)maptest.get('data');    
       system.debug('get data is::'+ob);
       
     String srlze  = System.JSON.serialize(ob); 
      system.debug('again deserailized is ::'+srlze );
      
       StateInfodetailswraper = (StateInfodetails)System.JSON.deserialize(srlze,StateInfodetails.class);
     system.debug('deserilize using the wrapperclass::::::'+StateInfodetailswraper );
      system.debug(StateInfodetailswraper.stateName);
    }
    
    
     //this is a wrapper class 
     public class StateInfodetails{
     public string stateName{get;set;}
     public string  value{get;set;}
     public integer rating{get;set;}
    
   }

   
   
   
  
}

After debugging , iam getting the value as: NULL...!

Can anyone have a solution to serialize it .. thank you ...!
I have successfully integrated my two salesforce org using named credentials.
But I want to navigate to a VF Page of a target org from a VF page of source org without asking for credentails.
 
Hi Guys, Is it possible to embed iframes in lightning component.please let me know any blogs with sample code.
Can anyone help me with the below code to select products from the existing products list. I am getting error ''
Error: Compile Error: Missing '<EOF>' at 'public' at line 83 column 5    
Apex Code

global class ProductSearchPopupController {
    
    public String query {get; set;}
    public List<PricebookEntry__c> products {get; set;}
    public List<wrapProduct> wrapProductList {get; set;}
    public List<PricebookEntry__c> selectedProduct{get;set;}
    public List<QuoteLineitem__c> quoteLineList{get;set;}
    public List<wrapProduct> selectedWrapperList{get;set;}
    public Boolean normalList{get;set;}
    public Boolean selectedList{get;set;}
    public Boolean block{get;set;}
    public Boolean block1{get;set;}
    public Boolean block2{get;set;}
    public String SalesPrice {get; set;}
    public integer Discount {get; set;}
    public String Quantity {get; set;}
    public String ServiceDate {get; set;}
    Id recordId;
    
    
    public ProductSearchPopupController(ApexPages.StandardController controller){
        recordId = controller.getId();
        SalesPrice='';
        Discount=0;
        Quantity='';
        ServiceDate='';
        system.debug('recordId '+recordId);
        wrapProductList = new List<wrapProduct>();
        selectedWrapperList = new List<wrapProduct>();
        normalList = true;
        selectedList = false;
        block = true;
        block1 = false;
        block2 = false;
    }
    public PageReference runQuery(){
        if(Test.isRunningTest()){
            query='Test';
        }
        system.debug('this query '+query);
        if(query == null || query == ''){
            system.debug('query '+query);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Info,'Please enter the product to be searched'));
            return null;
        }
        
        List<List<PricebookEntry__c>> searchResults=[FIND :query IN ALL FIELDS RETURNING PricebookEntry__c (id, Name, ProductCode__c, Product2Id__r.Product_Description__c,UnitPrice__c, UseStandardPrice__c)];
        system.debug('searchResults '+searchResults[0].size());
        System.debug('searchResults  result ' + searchResults[0]);       
        System.debug('oth  result ' + SearchResults[0]);
        if(searchResults[0]!=null){
            for(PricebookEntry__c a: searchResults[0]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapProductList.add(new wrapProduct(a));
                block = true;   block1 = true;   block2 = false;
            }
        }
        return null;
    }
    public void processSelected() {
    selectedProducts = new List<Product2__c>();
 
        for(wrapProducts wrapProductObj : wrapAccountList) {
            if(wrapProductObj.selected == true) {
                selectedAccounts.add(wrapProductObj.acc);
            }
        }
    }
 
 
    // This is our wrapper/container class. A container class is a class, a data structure, or an abstract data type whose instances are collections of other objects. In this example a wrapper class contains both the standard salesforce object Account and a Boolean value
    public class wrapProducts {
        public Product2__c acc {get; set;}
        public Boolean selected {get; set;}
 
        //This is the contructor method. When we create a new wrapAccount object we pass a Account that is set to the acc property. We also set the selected value to false
        public wrapProduct(Products a) {
            acc = a;
            selected = false;
        }
    }
}
    public PageReference ProceedWithSelectedToNextPage(){
        selectedWrapperList = new List<wrapProduct>();
        normalList = false;
        selectedList = true;
        for(wrapProduct selectedWrapObj: wrapProductList){
            system.debug('selectedWrapObj.selected  ---------'+selectedWrapObj.selected);
            if(selectedWrapObj.selected == true)
                selectedWrapperList.add(selectedWrapObj);
        }
        system.debug('selectedWrapperList size ---------'+selectedWrapperList.size());
        PageReference pageRef = new PageReference('/apex/AccountOpportunityTwoPage');
        pageRef.setRedirect(false);
        return pageRef;
    }
    
 
      
    public void processSelected() {
        selectedProduct = new List<PricebookEntry__c>();
        for(wrapProduct wrapProductObj : wrapProductList) {
            if(wrapProductObj.selected == true) {
                selectedProduct.add(wrapProductObj.acc);
                block = false;  block1 = false;  block2 = true;
                
            }
        }
    }
    
    public void GoBack() {
        block = true;
        block1 = true;
        block2 = false;
    }
    
    global   class wrapProduct {
        public PricebookEntry__c acc {get;set;}
        public Boolean selected {get;set;}
        public wrapProduct(PricebookEntry__c p) {
            this.acc = p;
            this.selected = false;
        }
    }
    
    public pagereference saveproduct(){
        List<QuoteLineitem__c> quoteLineList = new  List<QuoteLineitem__c>();
        if(Test.isRunningTest()){
            insertTestData();
        }
        if(!selectedProduct.isEmpty()){
            for(PricebookEntry__c sp:selectedProduct){
                system.debug('sp '+sp);
                QuoteLineitem__c qli = new QuoteLineitem__c();
                qli.QuotesId__c = recordId;
                qli.ListPrice__c = sp.UnitPrice__c;
                qli.UnitPrice__c = sp.UnitPrice__c;
                qli.Product2Id__c = sp.Product2Id__c;    
                if(Discount!=0 || Discount!=null){
                    qli.Discount__c = Discount;
                }
                quoteLineList.add(qli);
            }
            
            if(quoteLineList.size()>0){
                insert quoteLineList;
                PageReference pageRef = new PageReference('https://proseraa.lightning.force.com/lightning/r/Quotes__c/'+recordId+'/view');
                pageRef.setRedirect(true);
                return pageRef;
            }
        }
        return null;
    }
    public void insertTestData(){
        Product2__c testProduct = new Product2__c();
            testProduct.Name='Test product';
            insert testProduct;
            PricebookEntry__c testpbe = new PricebookEntry__c();
                testpbe.Name='Test PriceBookEntry';
                testpbe.UnitPrice__c =123;
                testpbe.Product2Id__c=testProduct.Id;
                insert testpbe;
            selectedProduct.add(testpbe);
    }
}

VF Page

<apex:page standardController="Quotes__c" extensions="ProductSearchPopupController" showHeader="false" sidebar="false" lightningStylesheets="true">
   
    <apex:form id="form" >
        <apex:pageMessages ></apex:pageMessages>
        <apex:messages />
        <div style="width 100%">
            <apex:pageBlock title="Add Products" id="block" rendered="{!block}"> 
                <centre>
                    <div align="center"  >
                   <apex:pageBlockSection columns="1" id="section" > 
                        Enter the product to be added and select Go<br/>
                        
                        <apex:inputText value="{!query}" id="query" style="width: 1200px; height: 40px;"/> 
                    </apex:pageBlockSection> 
                  </div>
                </centre>
                <right>
                <apex:commandButton value="Go" action="{!runQuery}" style="align: right:100px;border-style:solid;
                     color:white; position:relative;background-color:rgba(13, 112, 165, 1);"/>
                <apex:commandButton value="Cancel" action="{!cancel}" style="float: centre:200px ;border-style:solid;
                     color:rgb(21, 137, 238); background-color:white;" />
                      </right>
            </apex:pageBlock>
                
            <apex:pageBlock id="block1" rendered="{!block1}" >
                <apex:pageBlockSection columns="1">
                    <apex:pageBlockTable value="{!wrapProductList}" var="accWrap">
                        <apex:column >
                            <apex:facet name="header">
                                <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                            </apex:facet>
                            <apex:inputCheckbox value="{!accWrap.selected}" id="inputId"/>
                        </apex:column>
                        <apex:column headerValue="Name">
                            <apex:outputLink value="#">{!accWrap.acc.Name}</apex:outputLink>       
                        </apex:column>
                        <apex:column headerValue="Product Code">
                            <apex:outputText value="{!accWrap.acc.ProductCode__c}"  />       
                        </apex:column>
                        <apex:column headerValue="Product Description">
                            <apex:outputText value="{!accWrap.acc.Product2Id__r.Product_Description__c}"  />       
                        </apex:column>
                        <apex:column headerValue="Unit Price">
                            <apex:outputText value="{!accWrap.acc.UnitPrice__c}"  />  
                        </apex:column>
                        <apex:column headerValue="Standard Price">
                            <apex:outputText value="{!accWrap.acc.UseStandardPrice__c}"  />  
                        </apex:column>
                    </apex:pageBlockTable>  
                    <apex:commandButton value="Next"   action="{!processSelected}" style="float: right;border-style:solid;
                     color:white; background-color:rgba(13, 112, 165, 1);align-items: right;justify-content:right;"/>  
                </apex:pageBlockSection>
            </apex:pageBlock>
        </div>
        <div>
            <apex:pageBlock id="block2" rendered="{!block2}" >
                <apex:pageblockSection title="All Products" collapsible="false" columns="3">
                    <apex:pageBlockTable value="{!selectedProduct}" var="c" id="table2" title="Selected Products">
                        <apex:column value="{!c.Name}" headerValue="Product Name"/>
                        <apex:column headerValue="Sales Price">
                            <apex:inputText value="{!c.UnitPrice__c}" id="UnitPrice" /> 
                        </apex:column>
                        <apex:column headerValue="Discount">
                            <apex:inputText value="{!discount}" id="discount" /> 
                        </apex:column>
                        <apex:column headerValue="Quantity">
                            <apex:inputText value="{!quantity}" id="quantity" /> 
                        </apex:column>
                    </apex:pageBlockTable>  
                </apex:pageblockSection>
                <apex:commandButton action="{!GoBack}" value="Back" style="border-style:solid;
                     color:white; background-color:rgba(13, 112, 165, 1);"/>
                <apex:commandButton action="{!saveproduct}" value="Save" style="float: right;border-style:solid;
                     color:white; background-color:rgba(13, 112, 165, 1);"/>
                <apex:commandButton value="Cancel" oncomplete="doRedirect()" style="float: right;border-style:solid;
                     color:rgb(21, 137, 238); background-color:white;"/>           
            </apex:pageBlock>
            </div>
           
        
    </apex:form>
</apex:page>
I am trying to call the flow through an apex class I created to attach the files to the Account object using Conga Template. This is the apex class I had created for the same.
@RemoteAction
public class FileAttachment{

    @InvocableMethod
    public static void file(List<Id> presId) {
        
        Set<Id> presc = new Set<Id>();
        presc.addAll(presId);
        
        sendReq(presc);
        
    }
    
    @future(callout=true)
    public static void sendReq(Set<Id> medId) {
        
        HealthCloudGA__EhrMedicationPrescription__c m = [SELECT Id,HealthCloudGA__Prescriber__c,HealthCloudGA__Account__c 
                                                         FROM HealthCloudGA__EhrMedicationPrescription__c
                                                         WHERE Id IN :medId];  
        
        Account a = [SELECT Id,FirstName,LastName FROM Account WHERE Id = :m.HealthCloudGA__Account__c];
        
        String sessId = UserInfo.getSessionId();
        String servUrl = Url.getSalesforceBaseUrl().toExternalForm()+'/services/Soap/u/29.0/'+UserInfo.getOrganizationId();
        
        String url2 = 'https://www.appextremes.com/apps/conga/pm.aspx'+
            '?sessionId='+sessId+
            '&serverUrl='+EncodingUtil.urlEncode(servUrl, 'UTF-8')+
            '&id='+m.Id+
            '&TemplateId=a2n0i0000000U09AAE'+
            '&QueryId=[Account]a2f0i00000003cN%3Fpv0%3D'+m.HealthCloudGA__Account__c+','+
            '[Dosage]a2f0i00000003by%3Fpv0%3D'+m.Id+','+
            '[DoctorLicense]a2f0i00000003cX%3Fpv0%3D'+m.HealthCloudGA__Prescriber__c+
            '&SC0=1'+
            '&SC1=SalesforceFile'+
            '&DS7=1'+
            //'&OFN=Prescription+'+a.LastName+'+'+
            '&AttachmentParentId='+m.HealthCloudGA__Account__c+
            '&DefaultPDF=1&APIMode=1';
        
        
        System.debug(url2);
        
        Http http = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url2);
        req.setMethod('GET');
        req.setTimeout(60000);
        
        // Send the request, and return a response
        HttpResponse res = http.send(req);
        System.debug(res);
        
        
        //return res.getStatus() + ' => ' + res.getBody();
        
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'wade08@gmail.com'};

        semail.setToAddresses(toAddresses); 
        semail.setSubject('Single Email message Example'); 
        semail.setPlainTextBody('Hello!!!!!!!!!!This is a test email to test single email message program '+url2); 
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail}); 
    }
}



And I executed this in the anonymous window:
System.debug(''+FileAttachment.sendReq('a0z0i000000630vAAA'));




I am getting this error:
Line: 1, Column: 32
Method does not exist or incorrect signature: void sendReq(String) from the type FileAttachment
 
  • December 02, 2019
  • Like
  • 0
I am trying to send email from custom button through apex class, I am getting below error.
"Unknown Exception: an email can't have more than one sender:[from Address] "

any one can help me on this error.
Hi All,
       i have a trigger on Account which is giving me error:-Trigger_Account: execution of BeforeUpdate caused by: System.DmlException: Update failed. First exception on row 1 with id 0010o00002cFEGpAAO; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 0010o00002cFEGp) is currently in trigger Trigger_Account, therefore it cannot recursively update itself: [] Class.AccountTriggerHelper.getCredebilityOfParentAcc: line 73, column 1 Trigger.Trigger_Account: line 24, column 1
       *******
       trigger Trigger_Account on Account (before insert, before update, 
                                    before delete, after insert, 
                                    after update, after delete) {
                                         
    AccountTriggerHelper.newAccount = trigger.new;
    AccountTriggerHelper.oldAccount = trigger.old;
    AccountTriggerHelper.newMapAccount = trigger.newMap;
    AccountTriggerHelper.oldMapAccount = trigger.oldMap;         
                                        
                                        if(!AccountTriggerHelper.runTrigger) {
                                            return;
                                        }

                                        if(Trigger.IsBefore){
                                            if(Trigger.IsInsert){
                                                AccountTriggerHelper.updateOppAmountOnAccount();
                                                AccountTriggerHelper.getCredebilityOfParentAcc();
                                            }
                                        } 
                                        
                                        if(Trigger.IsBefore){
                                            if(Trigger.IsUpdate){
                                                AccountTriggerHelper.updateOppAmountOnAccount();
                                                AccountTriggerHelper.getCredebilityOfParentAcc();
                                            }
                                        } 
        
}
Account trigger helper:-
public class AccountTriggerHelper {
    
    public static List<Account> newAccount = new List<Account>();
    public static List<Account> oldAccount = new List<Account>();
    public static Map<Id, Account> newMapAccount = new Map<Id, Account>();
    public static Map<Id, Account> oldMapAccount = new Map<Id, Account>();
    
    public static boolean runTrigger = True;
    
    public static Map<ID,List<Opportunity>> MapAccIdToOpp = New Map<ID,List<Opportunity>>();
    
    public static void  updateOppAmountOnAccount(){
        
        Set<id> accids = new Set<id>();
        for(Account acc : newAccount){
            accids.add(acc.id);
        }
        
        for(Id accid : accids){
            List<Opportunity> Listopp = MapAccIdToOpp.get(accid);
            System.debug('List'+ MapAccIdToOpp.get(accid));
            MapAccIdToOpp.put(accid, Listopp);
            System.debug('MapAccidtoOpp'+MapAccIdToOpp);
        }
        
        List<Account> AccountListToUpdate = new List<Account>();
        
        for(Account acc : newAccount){
            Decimal Amount = 0;
            
            for(Opportunity opp :  [SELECT id ,Name,StageName,Amount FROM Opportunity WHERE AccountId =: acc.id] ){
                if(opp.StageName == 'Closed Won' || opp.StageName == 'Closed Lost'){
                    Amount = Amount + opp.Amount;
                    System.debug('AmountIfupdate'+Amount);
                }
                
                if(opp.StageName != 'Closed Won' && opp.StageName != 'Closed Lost'){
                    Amount  = Amount + (opp.Amount)*0.25;
                     System.debug('Amountelseupdate'+Amount);
                }
                
                acc.Opportunity_Amount__c = Amount;
                System.debug('Amountupdate'+acc.Opportunity_Amount__c);
                AccountListToUpdate.add(acc);
            }
            
            System.debug('acctoupdate'+AccountListToUpdate);
        }        
        
    }
    public static void getCredebilityOfParentAcc(){
        List<Account> accListToUpdate = new List<Account>();
        Integer Point = 0;
        Map<Account,Decimal> MapAccToAmount = new Map<Account,Decimal>();
        for(Account acc : [SELECT id ,Name,Opportunity_Amount__c  
                          FROM Account 
                          WHERE Parentid = null 
                          AND Opportunity_Amount__c <> null 
                          ORDER BY Opportunity_Amount__c desc]){
            MapAccToAmount.put(acc,acc.Opportunity_Amount__c);
            system.debug('mapAmount'+MapAccToAmount);
                              
        }
        for(Account acc : MapAccToAmount.keyset()){
            Point = Point+1;
             System.debug('point'+Point);
            acc.RankOfAccount__c = Point;
            accListToUpdate.add(acc);
        }
        System.debug('point'+  accListToUpdate);
        
            runTrigger = false;
            Update accListToUpdate;
            runTrigger = true;
         
         
    }
    
}
How to solve this issue? Any suggestions?
We currently have a custom report in Salesforce that we would like to schedule using a custom SOQL query to retrieve the same dataset that is retrieved using the custom report.
 
The custom report retrieves all the CPE Location records with or without Inventory Asset records.
 
We want to write a custom SOQL that performs the same function of retrieving all CPE Location with or without Inventory Assets. However, the SQOL query below in this email only retrieves ~63,136 records.
Could you assist me on why the SOQL query and the custom report are retrieving different datasets?

I am using the following custom objects for my SOQL query: CPE_Location__c and Inventory_Asset__c. The Inventory_Asset__c object has a custom field CPE_Location__c that is a look up to the CPE_Location__c object. There is no relationship to INventory_Asset__c object from CPE_Location__c object.

Here is the SOQL query that will replace the custom report mentioned above:

SELECT CPE_Location__r.CPE_Location_Record__c,CPE_Location__r.Name,CPE_Location__r.Account__r.Name,CPE_Location__r.CPE_Location_Type__c,CPE_Location__r.Virtual_Type__c,
CPE_Location__r.Legacy_Company__c,CPE_Location__r.Splice_Complete_Date__c,CPE_Location__r.On_Net_Date__c,CPE_Location__r.Location_Name__r.Name,CPE_Location__r.Location_Address__c,
CPE_Location__r.Location_City__c,CPE_Location__r.Location_State__c,CPE_Location__r.Location_Zip__c,CPE_Location__r.Latitude__c,CPE_Location__r.Longitude__c,CPE_Location__r.CPE_Location_Coordinates__c,
CPE_Location__r.CPE_Location_URL__c,
Inventory_Asset__c.Asset_Number__c,Inventory_Asset__c.Name,Inventory_Asset__c.Condition__c,
Inventory_Date__c,Scan_Date__c,Inventory_Product_Details__c,Placed_in_Service_Date__c,PO_Number__c,Project__c,RFID_Tag__c,RMA_Number__c,
Serial_Number__c,Vendor__c,Warranty__c,Treatment__c
from Inventory_Asset__c where 
CPE_Location__r.Division__c != 'Uniti Leasing' AND
CPE_Location__r.CPE_Location_Type__c != 'Virtual' AND
ORDER BY CPE_Location__r.CPE_Location_Status__c ASC

Thank you in advance.

Arvind Mahadevan.
So when ever the users manager changes i need to update all the opportunities that are associated with that user how do i accomplish this. I used process builder but it is not updating the records
  • April 22, 2019
  • Like
  • 0
hello everyone,
We have a Lightning Web Component with 3 Comboboxes. I built out the first one using the code from the Lighting Web Component resource page and it works great. I then copied and pasted the code (while changing the value names and labels as to not cause an error)  but the two new Combo Boxes arent working. when selecting a value the ComboBox returns a null value rather than the initial ' ' value and doesnt select the value I wanted to select. 
I need to create Multiple Child Records from Parent Related List but i get the Error: "URL No Longer Exists" but the data saved in the database. Also, it seem that the Parent Id does not populate autonmatically so, i have to add it manually. I want to notice that I add the child page as a related list of the parent. The Parent Obejct is Devery__c, the child is Item_Distributed__c Here is my code:
public class AddOrderItem {

    public String Delivery { get; set; }
Id DeliveryId;
public List<Item_Distributed__c> listOrderItem {get;set;}
public Integer rowNum{get;set;}

public AddOrderItem(ApexPages.StandardController controller){
   Id OrderItemId = ApexPages.currentPage().getParameters().get('OrderItemId');
    DeliveryId=ApexPages.currentPage().getParameters().get('DeliveryId');
    listOrderItem = new List<Item_Distributed__c>();
    listOrderItem.add(new Item_Distributed__c());

}

public pagereference insertOrderItem(){
    insert listOrderItem;
    Pagereference page=new pagereference('/'+DeliveryId);
    Return page;
}

public void insertRow(){
    listOrderItem.add(new Item_Distributed__c());
}

public void delRow(){
    rowNum = 
Integer.valueof(apexpages.currentpage().getparameters().get('index'));
    listOrderItem.remove(rowNum);
}
}

//VF Page

<apex:page StandardController="Delivery__c"  Extensions="AddOrderItem" showHeader="false" sidebar="false" >
<apex:form >
    <apex:variable var="rowNum" value="{!0}" />
    <apex:pageBlock >
        <apex:variable var="rowNum" value="{!0}" />
        <apex:PageBlockTable value="{!listOrderItem}" var="int">
        <apex:facet name="footer">
            <apex:commandLink value="Add" action="{!insertRow}"/>
            </apex:facet>
            <apex:column headerValue="Quantity">
                <apex:inputField value="{!int.Quantity__c}"/>                                      
            </apex:column>
            <apex:column headerValue="Product">
            <apex:inputField value="{!int.Product__c}"/> 
            </apex:column>
         <apex:column headerValue="Product">
            <apex:inputField value="{!int.Delivery__c}"/> 
            </apex:column>  
             <apex:column headerValue="Delete">
            <apex:commandLink style="font-size:15px; font-weight:bold; text-align:center;color:red;" value="X" action="{!delRow}">
                <apex:param value="{!rowNum}" name="index"/>
                </apex:commandLink>
                <apex:variable var="rowNum" value="{!rowNum+1}"/>
            </apex:column>
        </apex:PageBlockTable>
    <apex:pageBlockButtons >
        <apex:commandButton value="Save" action="{!insertOrderItem}"/>
        </apex:pageBlockButtons>
    </apex:pageBlock>

  </apex:form>
</apex:page>

User-added image
Hi Everyone,

Please help me on fixing this error in my test class.

@istest
    public static void processMap(){
     String s = '{"insurances":[{"insurancepolicyholdercountrycode":"USA","insuranceplanname":"ARROHEALTH","insurancetype":"Other","insurancepolicyholderlastname":"WHITE","insurancephone":"(855) 651-1890","insuredentitytypeid":1,"relationshiptoinsuredid":1,"insuranceid":"22928","casepolicytypename":"Contracts","insurancepolicyholder":"SKYLAR WHITE","relationshiptoinsured":"Self","eligibilitystatus":"Unverified","insurancepolicyholderfirstname":"SKYLAR","insurancepackageid":455702,"insurancepolicyholdersex":"F","insurancepolicyholdercountryiso3166":"US","ircname":"Corporate Billing"}],"count":7}';
      Account a = new Account(Name = 'Test'+  Date.Today());
        insert a;
        
        Map<Account,String> m_aS = new Map<account,String>();
        m_as.put(a,s);
        
        Eligibility.processresponseMap(m_as);
        
    }

Class: 
@TestVisible
    private static Map<Account, List<Insurance_eligibility__c>> processresponseMap(Map<Account, String> m_accountResponse){
        
       Map<Account, List<Insurance_eligibility__c>> m_accountsToInsurances = new Map<Account, List<Insurance_eligibility__c>>();
        
        for(Account a: m_accountResponse.keyset()){
           if(m_accountResponse.get(a) != null){
               string response =  m_accountResponse.get(a);
               EligibilityWrapper ew = new EligibilityWrapper().parse(response);
               //Parse the wrapper/response for this account and generate the eligibility records
               if(ew != null){
                   List<Insurance_eligibility__c>  l_tempIe = Eligibility.createEligibilityRecords(a, ew);
                   Account aUpdated = updateEligibilityOnAccount(a, l_tempIe);
                   m_accountsToInsurances.put(aUpdated,l_tempIe);
               }
            }
        }
        return m_accountsToInsurances;
    }

Appreciate your quick response.
Thank you!
Hi I need write the wrapper class for displaying the list of file documents in Vf page for case object. on click of selecting the checkbok  of the particular file record on the VF page, email has to send along with the file document(file frome file object) attached with the emaile. note:I am not refereing notes and attachment 
Two same checkbox fields used in Account and in  Account related VF page but in vf page the checkbox field is disabled. It is enabled in Account page. But the requirement is in Vf page page it should be enabled. 

i've removed the disabled = true, but if i check box the value and tried to save the record it is not saving the value. I think i'm missing some where else, couldyou please help me in this requirement.
Hi Team,

I have 2 created custom field start date and end date ..
if opportunity stage is created . start date need to be createddate+5 and end date need to be created date +30
If  opportunity stage is created . start date need to be createddate+10 an end date need to be created date +40
If opportunity stage is created . start date need to be createddate+15 and end date need to be created date +50
Opportunity stages contains
Created
Contacted 
Sent for approval.

Need to design these using floflofs
We would like to see which records have an attachment attached from the list view.  To do this, we created a checkbox field HasAttachment, default unchecked, and the following trigger.  If the Expense custom object record has an attachment, then the HasAttachment field should update to TRUE.  We tested this trigger through 'Upload File' under the Notes and Attachments related list, however, the HasAttachment field remains unchecked.
 
trigger AttachmentonExpense on Attachment (after insert) 
{
Set setParentId = new Set();
List Expenselst = new List();

for(Attachment att: Trigger.new)
{
setParentId.add(att.ParentId);
}

Expenselst = [select Id , HasAttachment__c from Expense__c where Id IN :setParentId];

For(Expense__c e : Expenselst)
{
e.HasAttachment__c = True;
}

update Expenselst;
}

 
Hi ,

we are writting Batchapex and schedule apex programs in developer console and we are executing this batch apex and scheduleapex programs using Debug(open Execute Anonymous window).
But in real time project where we can Execute this programs please tell me answer if you know.

Thanks
Surender
 
Certified Salesforce Admin & Developer with hands-on experience in Apex classes, triggers, visual force pages & lighting concepts. Looking for contract/ full-time job. Ready to join immediately and relocate anywhere in the United States. Authorized to work for any employer in the USA. 
Please reach out to me at mahidhar.akarapu@gmail.com.
 
We're looking for a Salesforce developer to oversee the development and administration of our Salesforce instance.
Ideally, you're an independent Salesforce contractor who can contribute about 20h/week on a long term basis, enjoy working remotely and collaborate well with distributed team.
  • Salesforce Admin and Dev certified
  • Minimum 3 years of Salesforce application development
  • Experience with integration of systems and 3rd party apps within Salesforce
  • Experience with Marketo a plus
  • Knowledge of SFDC governor limits and guidelines
  • Experience working in an Agile or SCRUM environment
  • Ability to communicate technical recommendations to non-technical stakeholders 
  • Able to work remotely within PST business hours.
The role will involve:
  • Developing customized solutions with the Salesforce platform to support critical business functions
  • Managing daily support and maintenance of internal Salesforce instance, and conduct longer-term improvement operations to ensure compatibility with evolving mission requirements
  • Communicating with project managers, clients and other developers to design cohesive project strategies and ensure effective collaboration throughout all phases of development, testing and deployment
  • Maintaining a flexible and proactive work environment, to facilitate a quick response to changing project requirements and customer objectives
  • Interacting with clients, managers and end users as necessary to analyse project objectives and capability requirements, including specifications for user interfaces, customized applications and interactions with internal Salesforce instances

The successful candidate will have experience in the following key areas:
  • APEX Experience
  • Visualforce and Salesforce.com platform experience]
  • SQL experience
  • Experience developing customer -facing user interfaces
  • C# or Node.js development experience on cloud platforms
  • Understanding of JSON and XML Schema Documents
  • Unit and integration testing

If you have experience with Salesforce development standard capabilities SFDC then this will be highly desirable.
Looking for qualified Salesforce Developer: https://bit.ly/2OWJ2jt 

Great culture, fast-paced environment with a chance to make a real impact!  Higher education experience is a plus.  
Hi Everyone :)

I am working with multiple companies that are looking for Salesforce Developers in Berlin and Munich.
 
One company is an award-winning E-Commerce company who are looking for mid-level and senior developers to help build a unique solution for their global management software. They provide opportunities to enhance knowledge on how to create UI components, programs and APIs using the latest platform features including lightning.
 
The company provides complete relocation support including accommodation, documentation, and visa sponsorship (if required).
 
The right candidate can earn up to €80,000 here, based on languages, seniority and experience.
If you are open to hearing more, let me know and we can connect

adam.slade@darwinrecruitment.com
https://www.linkedin.com/in/adammichaelslade/ 
Salesfroce Developer position in Atlanta with an excellent organization.

Short term Contract:  https://jobs.crelate.com/portal/perspectivetalent/job/jylxidbscej-335516

Permenent Role with little to no travel : https://jobs.crelate.com/portal/perspectivetalent/job/aoqeogoxqc1-441892
Excellent work / life balance - 35 hour work week
Free medical and dental
8% contribution to 401K
Family oriented work environment