+ Start a Discussion
Merci 10Merci 10 
I have the following requirement. I have to change styles of the second element rendered of this list, i tried a solution to do that but doesn't work, can you help me please?

data = {
                  issues: [
                                  {
                                         'chapter' :  'something1'
                                         'posiion':  '2A'
                                  },
                                 {
                                          'chapter': 'something2',
                                          'position' : '3A'
                                 },
                                 {
                                           'chapter : 'something3',
                                           'position': '4A'
                                 }
                                      ]
             }

html code:

<template for:each={data.issues} for:item="item" for-index="index">
             <h3 class ={dinamicClass} > {index} {item.chaper} </h3>
             <h3 claas ={dinamicClass} >{index} {item.position} </h3>
</template>

output: 
                          0 something1     0 2A
                          1 something2     1 3A
                          2 something3     3 3A

the idea is to modificate the second row, in bold and bigger.

I try this in JS but doesnt not work

@api index;

get dinamicClass(){
  return this.index == 2 ? 'slds_xxxxxxx_large' : slds_xxxxxxx_small'
}


Any idea to can implement to solve this?  Thanks
Best Answer chosen by Merci 10
Maharajan CMaharajan C
Yes it's possible...
 
get result(){
        let jsondata = [];
        this.data.issues.forEach((obj, index) => {
            //console.log( ' ++++++ ' + index);
            obj.classstyle = (index == 1) ? 'slds-text-heading_large' : (index == 2) ? 'slds-text-color_error' : 'slds-text-heading_small';    
            //console.log( ' ++++++ ' + JSON.stringify(obj));
            jsondata.push(obj);
        });
        //console.log( ' ++++++ ' + JSON.stringify(jsondata));
        return jsondata;
    }

Thanks,
Maharajan.C
Daniel Cole 5Daniel Cole 5 
Hello everyone, 
 
My name is  Daniel and I am looking for a perfect backup solution for Mac email clients. I completely agree that Time Machine is the best option to backup on Mac but not for emails. I am more focused on emails, their attachments, address books and contacts. I want to only focus on email backup as my business is so. I run a couple of email clients, one is apple mail and other is outlook 2016 for mac. So is there any app like Time Machine that only focusses on Email Backup?
Best Answer chosen by Daniel Cole 5
George KempGeorge Kemp
Look here if you could find any solutions, this website deals in issues related with email clients on Mac:-
https://sites.google.com/site/mailbackupsolution/outlook-mac-backup-solutions

I hope this helps. Thanks
Palmira AngelovaPalmira Angelova 
Hi friends,

I need to look up specific Contacts on Accounts, but only include Contacts on Accounts that have Opportunities WHERE Stage IN('X','Y','Z') i.e. what I think of as a child -> parent -> child lookup. I've been using workbench for this. 

I couldn't figure out a way to do this within the syntax, so instead I opted for Account -> Contacts WHERE Account -> Opportunities meets my criteria, which seemed to make sense to me. However, my query is getting an error telling me I can't have a child -> parent lookup in the where clause:
"MALFORMED_QUERY: 
AND Id IN(SELECT Account.Id FROM Opportunity WHERE
ERROR at Row:5:Column:24
The inner select field 'Account.Id' cannot have more than one level of relationships"

Here is my query:
SELECT Id,
       (SELECT Id FROM Contacts WHERE Send_Partner_Updates__c = TRUE)
FROM Account
WHERE Account.POS_Provider_s__c NOT IN('Toshiba ACE', 'Toshiba ACE (old, non-integrated)')
      AND Id IN(SELECT Account.Id FROM Opportunity WHERE Stage IN('6 - Deployed', '6 - Deploying', '6.5 - Fully Deployed'))

Does anyone have a way to get by this? When I tried "SELECT Id FROM Opportunity", removing the child->parent lookup within the Opportunity query, I get this error: "The selected field 'Id' in the subquery and the left operand field in the where expression in the outer query 'Id' should point to the same object type"...so I haven't been able to think of a way around these two limitations.

Thanks for your help!
Best Answer chosen by Palmira Angelova
jigarshahjigarshah
Palmira,

Change the Account.Id to AccountId in the subquery for Opportunity hence your updated Soql query will now become
SELECT Id,
    (SELECT Id FROM Contacts WHERE Send_Partner_Updates__c = TRUE)
FROM Account
WHERE Account.POS_Provider_s__c NOT IN('Toshiba ACE', 'Toshiba ACE (old, non-integrated)')
      AND Id IN (SELECT AccountId, Stage FROM Opportunity WHERE Stage IN('6 - Deployed', '6 - Deploying', '6.5 - Fully Deployed'))
Hope that helps.
Mia HorwathMia Horwath 
hello, I am trying to create a field formula to exclude weekends but keep getting this error " Error: Syntax error. Missing ')'" 

this is my formula

TEXT ( ((DATEVALUE(NOW ()) - DATEVALUE(CreatedDate )) - (CASE(MOD(DATEVALUE(CreatedDate) - DATE (1900, 1,7),7),
0 , CASE ( MOD ( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate), 7),1,0,2,0,3,0,4,0,5,1,6,2,0),
1 , CASE ( MOD ( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate), 7),0,0,1,0,2,0,3,0,4,0,5,2,2),
2 , CASE ( MOD ( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate), 7),0,0,1,0,2,0,3,1,2),
3 , CASE ( MOD ( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate), 7),0,0,1,0,2,1,2),
4 , CASE ( MOD ( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate), 7),0,0,1,1,2),
5 , CASE ( MOD ( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate), 7),0,1,2),
6 , CASE ( MOD ( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate), 7),6,2,1),
999)


I am trying to count how many business days it's been so it should just return a numeric value
Best Answer chosen by Mia Horwath
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Mia,

If your return type for the formula is number please use the below formula. 
If the return type is text just add TEXT() to the below.
 
CASE(MOD( DATEVALUE(CreatedDate) - DATE(1985,6,24),7),
0 , CASE( MOD( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate) ,7),1,2,2,3,3,4,4,5,5,5,6,5,1),
1 , CASE( MOD( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate) ,7),1,2,2,3,3,4,4,4,5,4,6,5,1),
2 , CASE( MOD( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate) ,7),1,2,2,3,3,3,4,3,5,4,6,5,1),
3 , CASE( MOD( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate) ,7),1,2,2,2,3,2,4,3,5,4,6,5,1),
4 , CASE( MOD( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate) ,7),1,1,2,1,3,2,4,3,5,4,6,5,1),
5 , CASE( MOD( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate) ,7),1,0,2,1,3,2,4,3,5,4,6,5,0),
6 , CASE( MOD( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate) ,7),1,1,2,2,3,3,4,4,5,5,6,5,0),
999)
+
(FLOOR(( DATEVALUE(NOW ()) - DATEVALUE(CreatedDate) )/7)*5)

If this solution helps , Please mark it as best answer.

Thanks,
kavya mareedukavya mareedu 
Ans:  Text, Text Area, Text Area Long, Rich Text Area, URL. Is this is the right answer or is there something else????

13. Can we change the data type from Text to Auto Number for the Name when we already have?

Ans: I feel the answer is yes. If yes, please do let me know the explanation . If no, let me know the reason as well. Thanks guys. 

 
Best Answer chosen by kavya mareedu
sairam akella 11sairam akella 11
Yes.. We change the Data field type from name to autonumber . But the changes only apply to the new record not for the existing record.

As name is one of the default field that is created while creating object and also internally it is used for indexing Salesforce has given this permissiong to edit the data type of this field.
 
Sohan ShirodkarSohan Shirodkar 
I have used case-assignment rules to assign cases automatically to the right user/queue based on certain conditions. 

Recently I was going through Trailhead content on omni-channel and various routing mechanisms (skill based, queue based). Following statement from trailhead confuses me : "Omni-Channel always assigns cases to the right support agents, and customers are happy with customer service. ".

If we already have case-assignment rules in place, why do we need omni-channel queue based routing? How are the two things different?
Best Answer chosen by Sohan Shirodkar
SwethaSwetha (Salesforce Developers) 
HI Sohan,

A case assignment rule in Salesforce.com is really a grouping of rules that will help you automatically assign cases throughout your support organization based on criteria captured on the case records. Each assignment rule can have multiple rule entries.

In Omni-Channel, work items are automatically routed or “pushed” to agents who are assigned to the appropriate queue. Incoming work items are routed to the agent with the least amount of open work. When work items all consume 1 capacity, the agent with the lowest number of work items receives incoming work.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks
Somya TiwariSomya Tiwari 

I have set Default value for a Picklist, but to my luck it is not working, don't know the reason for the same.

Can anyone help me with any workaround? Even Custom Picklists are not working with default values on Account. Although it is working for Contact. 

Default Value:
User-added image

New Account Page:
User-added image
 

Best Answer chosen by Somya Tiwari
Khan AnasKhan Anas (Salesforce Developers) 
Hi Somya,

Greetings to you!

You have record types enabled for Account. Each record type has its own Default. You have to set the default under each record type. 
Go to Setup -> Object Manager -> Account -> Record Types -> Open Record Type - Not Edit -> Picklist value to set default

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Soundhariyaa MSoundhariyaa M 
The scenario is:

I need to send CEO Closed WON Report in Email every Week.

I created the report and when I subscribed it and tried sending report mail to me[myself and not other user], I'm getting this error.
I'm using Developer Edition.

User-added imageI'm not able to figure out how to resolve this..

Thanks in Advance!
Best Answer chosen by Soundhariyaa M
SwethaSwetha (Salesforce Developers) 
Can you check if the issue you are facing is related to the known issue - https://success.salesforce.com/issues_view?id=a1p3A000000JX3RQAW and try the workaround specified in it?

Thanks
Poonam Agarwal 7Poonam Agarwal 7 
Hi, I am facing error - Ensure that you implement the Queueable interface in the AnnouncementQueueable class. 

I am getting proper response....and implemented trigger, Product2Helper and AnnouncementQueable class as per the trailhead 



Follwoing is my code -
product2Trigger --->
trigger product2Trigger on Product2 (after update) {
   Product2Helper.AfterUpdate((List<Product2>)trigger.new,(List<Product2>)trigger.old);
   
}

Product2Helper Class ---->
public class Product2Helper {

    /**
     * @name COLLABORATION_GROUP
     * @description List of CollaborationGroup used in both business and test logic
    **/
    static List<CollaborationGroup> COLLABORATION_GROUP = [
        SELECT Id
        FROM CollaborationGroup
        WHERE Name = :Constants.INVENTORY_ANNOUNCEMENTS 
        OR Name = :('TEST'+Constants.INVENTORY_ANNOUNCEMENTS)
        LIMIT 1
    ];

    /**
     * @name afterUpdate
     * @description called by product2 Trigger on After Update
     * @param List<Product2> newList
     * @param List<Product2> oldList
    **/
    public static void AfterUpdate(List<Product2> prodList, List<Product2> prodOldList){
        //ToDo: Declare a List of Product2 records named needsAnnouncement

        //ToDo: Declare a Map of Strings to Inventory_Setting__mdt records

        //ToDo: Loop through a query of Inventory_Setting__mdt records and populate the Map with Name as the key

        //ToDo: Loop through the Products in newList
        // Use the corresponding Inventory Setting record to determine the correct Low Quantity Alert
        // If the Product's Quantity Remaining has been changed to less than the Low Quantity Alert
        //      add it to the needsAnnouncement list

        //ToDo: Pass records to the postAlerts method
        List<Product2> needsAnnouncement = new List<Product2>();
        Map<String,Inventory_Setting__mdt> mapInventory = new Map<String,Inventory_Setting__mdt>();
        for(Inventory_Setting__mdt inv : [select id, DeveloperName, Low_Quantity_Alert__c from Inventory_Setting__mdt]){
            mapInventory.put(inv.DeveloperName,inv);
        }
        
        for(integer i=0;i<prodList.size();i++)
        {
            if(mapInventory.get(prodList[i].Family).Low_Quantity_Alert__c > prodList[i].Quantity_Remaining__c && 
                mapInventory.get(prodList[i].Family).Low_Quantity_Alert__c <= prodOldList[i].Quantity_Remaining__c)
            {
                needsAnnouncement.add(prodList[i]);
            }
        }
        PostAlerts(needsAnnouncement);
    }

    /**
     * @name postAlerts
     * @description called by product2 Trigger on After Update
     * @param List<Product2> productList
    **/
    public static void PostAlerts(List<Product2> productList){
        List<ConnectApi.AnnouncementInput> toPost = new List<ConnectApi.AnnouncementInput>();
        for ( Product2 p : productList ){
            // ToDo: Construct a new AnnouncementInput for the Chatter Group so that it:
            // expires in a day
            // does not notify users via email.
            // and has a text body that includes the name of the product followed by the INVENTORY_LEVEL_LOW constant
            ConnectApi.MessageBodyInput msgBody = new ConnectApi.MessageBodyInput();
            ConnectApi.AnnouncementInput tempPost = new ConnectApi.AnnouncementInput();
            ConnectApi.TextSegmentInput textSegment = new ConnectApi.TextSegmentInput();
            textSegment.text = p.Name +'  '+ Constants.INVENTORY_LEVEL_LOW;
            msgBody.messageSegments = new List<ConnectApi.MessageSegmentInput>();
            msgBody.messageSegments.add(textSegment);
            
            tempPost.body = msgBody;
            tempPost.expirationDate = DateTime.Now().AddDays(1);
            tempPost.parentId = COLLABORATION_GROUP[0].id;
            tempPost.sendEmails = false;
            toPost.add(tempPost);
         }
    
        // ToDo: Create and enqueue an instance of the announcementQueuable class with the list of Products
        AnnouncementQueueable annQue = new AnnouncementQueueable(toPost);
        //annQue.toPost = toPost;
        system.enqueueJob(annQue);
    }
}

AnnouncementQueueable Class ---->
/**
 * @name AnnouncementQueueable
 * @description This class posts Chatter Announcements
**/
public class AnnouncementQueueable implements Queueable{

    public List<ConnectApi.AnnouncementInput> toPost;
    
    public AnnouncementQueueable(List<ConnectApi.AnnouncementInput> annList)
    {
        toPost = annList;
    }

    //ToDo: Modify this class to implement the Queueable interface and call the postAnnouncements method
    public void execute(System.QueueableContext context){
        
        PostAnnouncements(toPost);
    }

    /**
     * @name postAnnouncements
     * @description This method is provided for you to facilitate the Super Badge
    **/
    public static void PostAnnouncements(List<ConnectApi.AnnouncementInput> announcements){
        while ( announcements.size() > 0 ){
            if ( Limits.getDMLStatements() < Limits.getLimitDMLStatements() && !test.isRunningTest() ){
                ConnectApi.AnnouncementInput a = announcements.remove(0);
                ConnectApi.Announcements.postAnnouncement('Internal', a);
            } else {
                break;
            }
        }
        if ( announcements.size() > 0 && !test.isRunningTest() ){
            AnnouncementQueueable q = new AnnouncementQueueable(announcements);
            //q.toPost = announcements;
            system.enqueueJob(q);
            //ToDo: Enqueue the above instance of announcementQueueable
        }
    }

}

Any help would be really appreciated.
Best Answer chosen by Poonam Agarwal 7
SandhyaSandhya (Salesforce Developers) 
Hi,

I would suggest you refer below link for similar discussion.

https://developer.salesforce.com/forums/?id=9060G0000005O9cQAE
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
 
Best Regards
Sandhya
 
surya singh 9surya singh 9 
Configure appropriate organization-wide defaults
You’ve been asked to create a custom object for tracking projects. The Project custom object records should only be visible to the owner of the record and users above the owner on the role hierarchy. Create the Project custom object and then create an organization-wide default for the Project object to accommodate for this use case.
The custom object must be named 'Project' with a resulting API name of 'Project__c'.
 What I have tried is that I made in organization's sharing settings  for object Project below settings
Object: Project
Default Internal Access:Public Read/Write
Default External Access:Public Read Only
Grant Access Using Hierarchies:Tick yes
 Got below error
"Challenge Not yet complete... here's what's wrong:
The organization-wide default for the Project custom object was not configured correctly"

Please guide me

 
Best Answer chosen by surya singh 9
Arti KulkarniArti Kulkarni
Hi Surya,

OWD settings should be private and Grant Access Using Hierarchies should be checked

Thanks!
Arati