• Jaya Karthik karnati
  • NEWBIE
  • 280 Points
  • Member since 2022

  • Chatter
    Feed
  • 10
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 39
    Replies
Hi, hoping someone can tell me what am I doing wrong here.
Trying to prooduce a custom formula that:
  • will return "Comm" if opportunity type is New Logo or Cross Sell
  • will return "n/a" if sum:maint = sum:amount
  • will return "n/a" if opportunity type is Renewal
  • will return "Comm" if opportunity type is Upsell AND CSE Booking field is 'Yes'
  • ELSE it should return "n/a"
Here's the formula I plotted; it keeps gicing me Error when encoding row-level formula: Syntax error. Extra ','

IF (ispickval(TYPE),"New Logo"), "Comm",
IF (ispickval(TYPE),"Cross-Sell"), "Comm",
IF (ispickval(TYPE),"Renewal"), "n/a",
IF (Opportunity.Sum_Maintenances__c.CONVERT=AMOUNT.CONVERT),"n/a",
IF (AND(ispickval(TYPE),"Upsell"),(ispickval(Opportunity.CSE_Booking__c),"Yes"),"Comm","n/a")))))



Thanks in advance!
List<Account> accountList = new List<Account>();
for(integer i=1; i<=10; i++){
Account a = new account();  
a.name ='sha'+i;  
a.phone='123323240'+i;  
a.annualrevenue=9096;   accountList.add(a);
}
insert accountList; 
I want to create a list of id's and print thought system.debug . how to do this?
 
Hello,

I have insalled vs studio, i have sfdx and java installared.
i can check both the version.
i have installed sfdx extension pack.

but I still don't get the option of sfdx with ctril+shift+p

what can be the reason, please ?
  • October 21, 2022
  • Like
  • 0
Am struggling with nested lists. I want to create one list (list2) with all the string values from the nested lists in list1. How do I assign in the loop ?
 
public static void ctask1(List<List<String>> list1){

		List<String> list2 = new List<String>();

        for(List<String> l: list1) {          
            //?                 
        }

}


Thanks

 
A company has a custom object named Warehouse. Each Warehouse record has a distinct
record owner, and is related to a parent Account in Salesforce.Which kind of relationship would a
developer use to relate the Account to the Warehouse?
A. One -to -Many
B. Parent -Child
C. Master -Detail
D. Lookup
Answer: D
Why will it be Look up and why not Master Detail ? Can you plerase explain?
Hello,

Few profiles dont have access to element in LWC are there any elements we can test so all have sale accessbility, please ?
  • October 19, 2022
  • Like
  • 0

Hi Folks, 

I am trying to assign Custom Labels as a Radio Group values into LWC but with no success. Please share your thoughs how do I do that Properly?  

- So I imported Custom labels into JS file. 
- Stored them into label object
- How do assign it to "Options" that Radio group could use it? 

Please see code below and screen shoot, how it should look like at the end. So in place of the current Radio Options, there should be custom labels displayed.

HTML **************************************************************

            <lightning-radio-group name="Random Radio"
                        label="Radio"
                        options={options}
                        value={value}
                        required
                        type="radio"
                        onchange= {handleChange}>
            </lightning-radio-group>    

JS ******************************************************************

import { LightningElement, wire, track, api } from 'lwc';
import customLabel1 from '@salesforce/label/c.label1';
import customLabel2 from '@salesforce/label/c.label2';
import customLabel3 from '@salesforce/label/c.label3';

export default class RandomClass extends LightningElement {

label {
    label1,
    label2,
    label3
}

get options() {
        return [
            { //Custom Label 1 Here },
            { //Custom Label 2 Here },
            { //Custom Label 3 Here },

        ];  
    }
}

Hi Experts,
 
I am struggling to cover the below if condition line( if(minutes <60)) in the test class can anyone help me out, please?
 
for(campaignmember cm:listcamps)
        {
            Long customFieldLong = cm.CreatedDate.getTime();
            Long dt2Long = DateTime.now().getTime();
            Long milliSeconds = dt2Long - customFieldLong;
            Long seconds = milliSeconds / 1000;
            Long minutes = seconds / 60;
            
            if(cm.status=='Form' || cm.status=='submit')
            {
                if(minutes<60)
                {
                    cammemleadId.add(cm.leadId);
                }

 
Hello. I'm a new LWC developer and need some assistance if possible.

I have a requirement to fire a toast message after a user changes a picklist field value in the record detail of an Opportunity and clicks save. I created the toast in LWC but don't know how to fire it upon save when this condition is met.

There is a lot of great information on how to fire toast messages upon a button click or when a field value is changed within an LWC. However, I can't find anything on how to fire the toast when a user makes a change in the standard record detail page and saves. Is there an if/then statement in the javascript that can be used or conditional rendering in the html? I need the toast to appear any time this picklist field value is changed and the record saved. Thanks so much!
So I'm looping through the records from a List and want to check the value of a field against the value from the previous record. But I want to be able to pass the name of the field to the method. Something like:

public static void (List<Contact> cList, string fieldname) {
integer i = 1;
for ( Contact c : cList) {
if (c[i].fieldname == c[i-1].fieldname) {
...
} else {
...
}

 
here is my apex class
I am getting this error

DEBUG|{"status":400,"error":"There was a problem in the JSON you submitted [5132df156cbaf320d27f8e06f3b61656]: logged with error code"}

PLEASE TELL ME HOW TO INCLUDE THE JSON???

public class makeCallOutIC1 {
    public String getContent(String url){
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint('https://api.intercom.io/contacts/search/');
        req.setMethod('POST');
        String authorizationHeader = 'Bearer ' + 'd2222=';
        req.setHeader('Authorization', authorizationHeader);  
        req.setHeader('Accept', 'application/json');
        req.setHeader('Content-Type', 'application/json');
        req.setHeader('Intercom-Version', '2.6');
        String body = '{'+
                       '"query": {' +
              '            "field": "last_seen_at", ' +
              '            "operator": ">", ' +
              '              "value": "1646149510",   ' +
              '        }' +
            '      }';
        

        req.setBody(body);
        HttpResponse res = h.send(req);
        return res.getBody();
        
    }
}
Challenge not yet complete

I get the following error when trying to complete this challenge: 
"We submitted an account for approval, but we can't find that account's Type set to 'Pending'. 
So then I update the Type to "Pending" but the it changes the Rejection Account Type Value to "Pending" so I update it to "Prospect" and then I get the following error: 
"We submitted an account for approval, but we can't find that account's Type set to 'Pending'. "

I feel like I'm in a loop, please help! Thanks in advance.    
 
Hi, hoping someone can tell me what am I doing wrong here.
Trying to prooduce a custom formula that:
  • will return "Comm" if opportunity type is New Logo or Cross Sell
  • will return "n/a" if sum:maint = sum:amount
  • will return "n/a" if opportunity type is Renewal
  • will return "Comm" if opportunity type is Upsell AND CSE Booking field is 'Yes'
  • ELSE it should return "n/a"
Here's the formula I plotted; it keeps gicing me Error when encoding row-level formula: Syntax error. Extra ','

IF (ispickval(TYPE),"New Logo"), "Comm",
IF (ispickval(TYPE),"Cross-Sell"), "Comm",
IF (ispickval(TYPE),"Renewal"), "n/a",
IF (Opportunity.Sum_Maintenances__c.CONVERT=AMOUNT.CONVERT),"n/a",
IF (AND(ispickval(TYPE),"Upsell"),(ispickval(Opportunity.CSE_Booking__c),"Yes"),"Comm","n/a")))))



Thanks in advance!
nvalid conversion from runtime type List<ANY> to Map<String,ANY>

Http h = new Http();
HttpResponse res = h.send(req);
 Map<String,Object> resBody = (Map<String, Object>)JSON.deserializeUntyped(res.getBody());

List<String> fieldAPINames = new List<String>(); List<String> headerList = new List<String>();

String fieldQuery = 'SELECT ';

for(Object col : (List<Object>)resBody.get('columns')){

   Map<String, Object> colFieldMap = (Map<String, Object>)col;
   if((Boolean)colFieldMap.get('hidden') == false){
          headerList.add((String)colFieldMap.get('label'));
          fieldAPINames.add((String)colFieldMap.get('fieldNameOrPath'));
          if(fieldQuery == 'SELECT '){ 
                fieldQuery += (String)colFieldMap.get('fieldNameOrPath');
           }
          else
        {
            fieldQuery += ','+(String)colFieldMap.get('fieldNameOrPath');
         }
    }
}

Any help is appreciated 
  • October 21, 2022
  • Like
  • 0
List<Account> accountList = new List<Account>();
for(integer i=1; i<=10; i++){
Account a = new account();  
a.name ='sha'+i;  
a.phone='123323240'+i;  
a.annualrevenue=9096;   accountList.add(a);
}
insert accountList; 
I want to create a list of id's and print thought system.debug . how to do this?
 
Hello,

I have insalled vs studio, i have sfdx and java installared.
i can check both the version.
i have installed sfdx extension pack.

but I still don't get the option of sfdx with ctril+shift+p

what can be the reason, please ?
  • October 21, 2022
  • Like
  • 0
Am struggling with nested lists. I want to create one list (list2) with all the string values from the nested lists in list1. How do I assign in the loop ?
 
public static void ctask1(List<List<String>> list1){

		List<String> list2 = new List<String>();

        for(List<String> l: list1) {          
            //?                 
        }

}


Thanks

 
When attempting to change the due date on User Stories (Milestone Tasks) we're faced with this error message when editing some user stories, those user stories are ones with a dependant User Story (predecessor) . The error message is posted below.

This is the method being called by the trigger
 
public static void checkSuccessorDependencies(Map<Id, Milestone1_Task__c> oldMap, Map<Id, Milestone1_Task__c> newMap) {
        Map<Id, Set<Milestone1_Task__c>> successorMap = new Map<Id, Set<Milestone1_Task__c>>();
        for(Milestone1_Task__c successor: [SELECT Id, Start_Date__c, Due_Date__c, Predecessor_Task__c FROM Milestone1_Task__c WHERE Predecessor_Task__c IN :newMap.keySet() AND Id NOT IN :newMap.keySet()]) {
            if(!successorMap.containsKey(successor.Predecessor_Task__c)) {
                successorMap.put(successor.Predecessor_Task__c, new Set<Milestone1_Task__c>());
            }
            successorMap.get(successor.Predecessor_Task__c).add(successor);
        }
        List<Milestone1_Task__c> successorsToUpdate = new List<Milestone1_Task__c>();
        for(Milestone1_Task__c newRec : newMap.values()) {
            Milestone1_Task__c oldRec = oldMap.get(newRec.Id);
            if(oldRec.Due_Date__c != null && newRec.Due_Date__c != null) {
                Integer deadlineShift = oldRec.Due_Date__c.daysBetween(newRec.Due_Date__c);
                if(deadlineShift != 0 && successorMap.containsKey(newRec.Id)) {
                    for(Milestone1_Task__c successor: successorMap.get(newRec.Id)) {
                        successor.Start_Date__c = successor.Start_Date__c.addDays(deadlineShift);
                        successor.Due_Date__c = successor.Due_Date__c.addDays(deadlineShift);
                    }
                    successorsToUpdate.addAll(successorMap.get(newRec.Id));
                }
            }
        }
        update successorsToUpdate;
    }



User-added image
 
I have 2 custom field in lead 1 is of text type & 2nd one is of lookup with lead. so when we create the lead & we filll th text in the 1st text type field & save the lead & again do the same & give the id of the that above lead record so that text field data of the above lead record will also show in the another lead record ???? plz. help me to work on this 
Hi Guys,

I have a process builder which has multiple time based actions to send out email reminders for 60,30,7 and 1 day before a date in a custom field. If the custom date field is set a value of 7 days from today, it's sending out 3 reminder emails (60,30 and 7).
Can someone help me fix this
A company has a custom object named Warehouse. Each Warehouse record has a distinct
record owner, and is related to a parent Account in Salesforce.Which kind of relationship would a
developer use to relate the Account to the Warehouse?
A. One -to -Many
B. Parent -Child
C. Master -Detail
D. Lookup
Answer: D
Why will it be Look up and why not Master Detail ? Can you plerase explain?
Hello,

Few profiles dont have access to element in LWC are there any elements we can test so all have sale accessbility, please ?
  • October 19, 2022
  • Like
  • 0
I have created a formula field. I want to show a text field value if it is not blank.
If it is blank then show a picklist field if that picklist is not blank.
If the picklist field is also blank show a different text field.
I have tried the below formula.
 
IF(NOT(ISNULL(TextField)), TextField, IF(NOT(ISBLANK(TEXT(Picklist))), TEXT(Picklist), TextField_2))


When there is a value in TextField, it is updating correctly. But if is blank and there is a value in the Picklist field it is not showing.
getting error :
"statusCode" : "OPERATION_ENQUEUED",
So I'm looping through the records from a List and want to check the value of a field against the value from the previous record. But I want to be able to pass the name of the field to the method. Something like:

public static void (List<Contact> cList, string fieldname) {
integer i = 1;
for ( Contact c : cList) {
if (c[i].fieldname == c[i-1].fieldname) {
...
} else {
...
}