• Jim Carraway
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
I have inline editing available for a lightning datatable.  I realized today that if you touch a cell but don't input any data, the update will fail with the message, "Value provided is invalid for action parameter 'target' of type 'LIST'".

Data being submitted.  The bold/italized is the cell that was touch but no data was entered.
{hct: "", Id: "blahblahblah"}

Thanks.
 
So due to business requirements, I'm using a wrapper to sum daily target data into a single "record" displayed in a lightning:datatable in an aura component.   Those summarized records are editable and when saved were divided by seven for the week.  

Now the start of the "week" is changeable.  In other words some weeks can be seven days long, others can be five depending on the start date.  I'm able to get things working fine, creation of new records, extra except for the division part when updating previous records.  

Essentially using the "Power of One," I'm summing up the number of days in the "weekly record" and displaying it in the consolidated view for users.  I would like to pass that number back to SFDC so the updated values are divided by that summed "Power of One" value.  

Hoping some one can help me figure out how to force the component to return the sum even though it hasn't changed, kind of like the ID value.   If that value is rreturned, I don't have to do a SOQL query to find the number of daily records for the various "weekly" records.

Thanks.
Use case - Field is updated on opportunity, select contactid and role associated to opportunity via opportunitycontactrole, then update related fields on the various contact records.

I am having issues getting the relationship between objects correct. 

I am looping through an opportunity list based on the ID.
In the loop I'm pulling all the contact IDs and roles from the OpportunityContactRole base related to said ID.

After that I'm trying to update the contact record based on the contact record id, but I cant get the relationship between the contact ID and opporuntitycontactrole object's contactID to associate.  Any ideas?

Appreciate the help.
Thanks!
So I am writing a class to pull out community login data from the user object to populate a custom object which will be used to create reports for customers, since community users are unable to access the user object.

Here's what I have so far.  Thinking this should work but I'm getting an error when populating the data into the custom object.
 
global class CommunityLoginHistory implements Schedulable {
    
    // This method queries the LoginHistory Object for Community User logins in the past 15 minutes and populates the CommunityLoginHistory custom object.
 
    global void execute(SchedulableContext ctx) {
        DateTime d = Datetime.now().addMinutes(-15);
        List<User> UserLoginHistory = [SELECT Id,
                                              name, 
                                              LastLoginDate, 
                                              profile.name, 
                                              userrole.name, 
                                              account.name 
                                            FROM User 
                                            WHERE profile.name LIKE '%Customer Community Plus%' 
                                            AND isactive = true 
                                            AND LastLoginDate > :d ];
                                            
        if ( !UserLoginHistory.isEmpty()) {
            List<CommunityLoginHistory__c> clh = new List<CommunityLoginHistory__c>();
            for (User ulh : UserLoginHistory) {
                clh.add (new CommunityLoginHistory__c ( UserID__c           =   Id,
                                                        UserName__c         =   name,
                                                        LastLoginDate__c    =   LastLoginDate,
                                                        UserProfile__c      =   profile.name,
                                                        UserRole__c         =   userrole.name,
                                                        UserAccount__c      =   account.name
                ));
            }
            insert clh;
        }
    }
}
In the for loop, when trying to populate the record with the data that was pulled from the SOQL query, the Developer Console is giving me the following errors.

Line 21 - Variable does not exist: Id - Illegal assignment from Schema.SObjectField to String
Line 22 - Variable does not exist: name - Illegal assignment from Schema.SObjectField to String
Line 23 - Variable does not exist: LastLoginDate - Illegal assignment from Schema.SObjectField to String

I'm at a loss for why that is the case when the console doesn't complain about the other variables.  Hoping someone can help.
I have inline editing available for a lightning datatable.  I realized today that if you touch a cell but don't input any data, the update will fail with the message, "Value provided is invalid for action parameter 'target' of type 'LIST'".

Data being submitted.  The bold/italized is the cell that was touch but no data was entered.
{hct: "", Id: "blahblahblah"}

Thanks.
 
So due to business requirements, I'm using a wrapper to sum daily target data into a single "record" displayed in a lightning:datatable in an aura component.   Those summarized records are editable and when saved were divided by seven for the week.  

Now the start of the "week" is changeable.  In other words some weeks can be seven days long, others can be five depending on the start date.  I'm able to get things working fine, creation of new records, extra except for the division part when updating previous records.  

Essentially using the "Power of One," I'm summing up the number of days in the "weekly record" and displaying it in the consolidated view for users.  I would like to pass that number back to SFDC so the updated values are divided by that summed "Power of One" value.  

Hoping some one can help me figure out how to force the component to return the sum even though it hasn't changed, kind of like the ID value.   If that value is rreturned, I don't have to do a SOQL query to find the number of daily records for the various "weekly" records.

Thanks.
Use case - Field is updated on opportunity, select contactid and role associated to opportunity via opportunitycontactrole, then update related fields on the various contact records.

I am having issues getting the relationship between objects correct. 

I am looping through an opportunity list based on the ID.
In the loop I'm pulling all the contact IDs and roles from the OpportunityContactRole base related to said ID.

After that I'm trying to update the contact record based on the contact record id, but I cant get the relationship between the contact ID and opporuntitycontactrole object's contactID to associate.  Any ideas?

Appreciate the help.
Thanks!