• McCubo
  • NEWBIE
  • 35 Points
  • Member since 2022


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 13
    Replies
Hello Everyone,

I had small query

Example 1 :
i have a string = Mom, Dad, Son, Daughter
i want a string = Mom, Dad, Son & Daughter

Example 2 :
i have a string = Mom, Dad, Son
i want a string = Mom, Dad & Son

Please help me to provide a solution for this.

Thanks,
Azar Khasim.
Hello All,
I have a SF Site with an aura component where I need the user to be able to click a link which downloads the file and then opens it.  I have the file.  I can either use it as a static resource or upload it to SF and use the link from the file.  Right now when the use clicks the link it just opens the file.  You then need to download the file and manually open the downloaded file. Is there a way to download the file on click and have it open after download?
Thank you,
P
  • April 12, 2022
  • Like
  • 0
Hi All, Could you please help to provide logic to create the Visualforce page that shows the table for the all products with edit capability as shown in the below OOTB functionality page. Here I want below OOTB functionality in visualforce page.

User-added image
  • April 11, 2022
  • Like
  • 0
here is my code:
public with sharing class contactController {
    @AuraEnabled(cacheable=true)
    public static List<Contact> getContacts(String accId) {
        return [
            SELECT AccountId, Id, FirstName, LastName, Title, Phone, Email
            FROM Contact
            WHERE AccountId = :accId
             
           ];
       
    }
}


it will not working for updating multiple record on table.
Hi all,
My requirement is when opportunity is closed won and product family is 'recurring' then 12 child record shouls be inserted according to closed date. here is my code which is not inserted record.
////code

trigger ArrOpptrigger3 on Opportunity (after insert,after update) {
     if(trigger.isInsert||trigger.isAfter){
     
//list<opportunityLineItem> olilist= new list<OpportunityLineItem>();
list<ARRCalcualateOpportunity__c> Arropplist= new list<ARRCalcualateOpportunity__c>();
   // List<PriceBookEntry> priceBookList = [SELECT Id, Product2Id, Product2.Id, Product2.Name,product2.family 
    //FROM PriceBookEntry WHERE Product2.Family ='software Recurring' LIMIT 1];

    //OpportunityLineItem oli= New OpportunityLineItem();

    for(opportunity op:Trigger.New){
        if(Op.StageName == 'closed Won')  
        {
    for(OpportunityLineItem Oli:[select Id,Name,Product2Id,Product2.Family from 
                                 OpportunityLineItem where OpportunityId=:op.Id])
          
            {
    if(oli.product2.family == 'software Recurring__c')
    {
        ARRCalcualateOpportunity__c arrOpp = new ARRCalcualateOpportunity__c();
      //  arropp.Id = op.ID;
       arropp.name = op.Name;
      // arropp.OppArrAccount__c = op.AccountId;
    arropp.ownerId = op.OwnerId; 
     arropp.OpportunityArr__c=op.Id;   
    Arropplist.add(arropp);
    }
        }
    //if(olilist!=null&&olilist.size()>0)
        
}
 }
         insert Arropplist;
}
}


public static void logError(Exception ex)
  {
   Contact  errorLog = new Contact ();

       errorLog.MailingAddress='Errorlog@gmail.com';
       errorLog.Name='Record Updation';
 
       Database.insert(errorLog , false);
  }

Can Any one help test method for this

Create a job which will run every hour and sync the opportunity and opp products with order and order products.
(ex. if amount field on order changes from 100 to 200 then update related opportunities amount field with 200) same for order line items and opportunity line items
for(Contact ThisContact: contactList){
        tempGender = ThisContact.Salutation;

        List<npct1_FC_Gender__mdt> FCGenderList =new List<npct1_FC_Gender__mdt>
                                                           ([SELECT npct1_Gender_Pick__c, npct1_Addressee_Salutation__c
                                                            FROM npct1_FC_Gender__mdt
                                                            WHERE npct1_Gender_Pick__c = :tempGender
                                                            ]);
        for(npct1_FC_Building_Block__mdt ThisBuilingBlock :FCBuildingBlockList)
        {
    
           resultString = FCGenderList.get('npct1_Gender_Pick__c') +resultString;
           // further code
        }
 }
I know I can't write list in for loop, what would be another way to implement this scenario where I have to pass the variable value in where clause and I have another for loop where I have to retrieve value from that list accordingly to tempGender value.
 

I need to query Contacts that their last opportunity is between a range of dates and the  
Customer_group__c INCLUDES ('SMS MARKETING OPT-IN') 
 
 Opportunities has Customer__c to refer Contacts and CloseDate to check the opp date. 
 
 The problem is that when I try to query something like this, the query takes in mind all opportunities instead of the last one , and I need to use it on a Batch Class so  
Database.getQueryLocator() won't allow me to use aggregate functions on in the query.  

Thank you!

Tables:

Opportunity
+----------------------------+---------------+
|      Customer__c        | CloseDate |
+----------------------------+---------------+
| This is the contact Id |      Date      |
+----------------------------+---------------+

Contact
+----------------------------+-----------------------------------------------------+
|          Id                      |                  Customer_group__c                  |
+----------------------------+-----------------------------------------------------+
| This is the contact Id | Picklist (needs to filter by 'SMS MARKETING OPT-IN' |
+----------------------------+-----------------------------------------------------+
I want to send the Opportunity record ID to an external web server whenever the opportunity record is updated so that they can perform opertions on their database to update the same record there as well.

I have written a trigger to get the recordID of thr updated record. Now I want to send it to the external web server please help me out. Thank you


trigger GetUpdatedOpportunityID on Opportunity (before update) {
        Set<Id> allInsertedIds = trigger.newMap.keySet();
        system.debug('allInsertedIds--------------------------------' + allInsertedIds);

}
 
Hello Everyone,

I had small query

Example 1 :
i have a string = Mom, Dad, Son, Daughter
i want a string = Mom, Dad, Son & Daughter

Example 2 :
i have a string = Mom, Dad, Son
i want a string = Mom, Dad & Son

Please help me to provide a solution for this.

Thanks,
Azar Khasim.
I 'm trying to validate a lightning inputfield and throw custom error. Below is the code snippet for LWC and js file. I 'm getting the below error
User-added image
html file 

<!-- Body -->
<div class="slds-p-horizontal_medium slds-m-top_medium">
<lightning-record-edit-form object-api-name="CaseContactRole">
<lightning-input-field
class="contactLookup"
field-name="ContactId"
onchange={contactLookupHandle}
>
</lightning-input-field>
</lightning-record-edit-form>
</div>

JS file

contactLookupHandle(event) {
this.selectedContactId = event.target.value;
this.validateFields();
}
validateFields() {
let inputfield = this.template.querySelector(".contactLookup");
console.log("Inputtttttttt::::::::::" + inputfield);
let inputValue = inputfield.value;
if (!inputValue) {
inputfield.reportValidity();
} else {
this.existingContactRoles.forEach((contactRole) => {
console.log("Contact Role from input :::::::::" + inputValue);
console.log(
"Contact Role already existing :::::::::" + contactRole.ContactId
);
if (inputValue === contactRole.ContactId) {
inputValue.setCustomValidity(
"This Contact has already been CC'd onto the Case."
);
}
});
}
}