• Chris Voge 9
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 5
    Replies
Hello,

Can a Continuation (Asynchronous REST call) be made from an Invocable method ? I've been trying with no luck. Wondering if I'm doing something wrong. Calling it the same way a JS Remoting function would do it.

Thanks, Chris
Hello,
I'm trying to populate a lightning select component with
a list of list views. It's retrieving ALL list views instead of what
the current user has access to.

I would expect the "with sharing" in the class would enforce the
sharing rules. The "getListViews" method is being called from a lightning
controller (JavaScript code). Can someone investigate ? (See Below)

Thanks, Chris


 
public with sharing class LX_Controller {

    @AuraEnabled
    public static  List<ListView>  getListViews( String sObjectType) {
        List <ListView> listviews = (List <ListView>)Database.query('SELECT Id, Name, SobjectType FROM ListView   WHERE SobjectType =\'' + sObjectType + '\'');
        return listviews;
    }
...
}



 
Hello,

Is there a way to retrieve the selected rows for a lightning listview component?
I know the datatable component has a getSelectedRows function built in to it.

Was wondering why this wasn't included on the listview since the way they
render is similar (IE. checkboxes)

Thanks, Chris
Hello,

In regards to this release note:
https://releasenotes.docs.salesforce.com/en-us/spring18/release-notes/rn_lc_api_revert_cruc.htm

I'm a little confused. In the first paragraph it says REST API's. In the second paragraph,
it says Salesforce API's.

Could someone elaborate further on this note ? (See below)

User-added image

Thanks, Chris
Hello,

Been researching an issue with duplicate inserts of records.
Below, I posted some log entries for a BeforeInsert and AfterInsert for a trigger.

The question I have is should the number records in the BeforeInsert (represented
by the word "new" ) be equal to the number of records in the AfterInsert (represented
by the id's) ?

I think this may be part of my issue. Just looking for direction.

Let me know if you need more information.


07:25:16.0 (146648)|CODE_UNIT_STARTED|[EXTERNAL]|01qU0000000DJN6|LeadsTrigger on Leads trigger event BeforeInsert for [new, new, new, new, new, new, new, new, new, new, new]  11 inserts
*
*  misc logs
*
07:25:18.471 (3127040361)|CODE_UNIT_FINISHED|LeadsTrigger on Leads trigger event BeforeInsert for [new, new, new, new, new, new, new, new, new, new, new]                       11 inserts
*
*  
* validations
*
*
*
07:25:19.593 (3593202511)|CODE_UNIT_STARTED|[EXTERNAL]|01qU0000000DJN6|LeadsTrigger on Leads trigger event AfterInsert for [a0E0P00000pYNMQ, a0E0P00000pYNMR, a0E0P00000pYNMT, a0E0P00000pYNMU, a0E0P00000pYNMV, a0E0P00000pYNMW, a0E0P00000pYNMX, a0E0P00000pYNMY, a0E0P00000pYNMZ, a0E0P00000pYNMa]                                                          10 id's    
*
*  misc logs
*
07:25:19.593 (3596467452)|CODE_UNIT_FINISHED|LeadsTrigger on Leads trigger event AfterInsert for [a0E0P00000pYNMQ, a0E0P00000pYNMR, a0E0P00000pYNMT, a0E0P00000pYNMU, a0E0P00000pYNMV, a0E0P00000pYNMW, a0E0P00000pYNMX, a0E0P00000pYNMY, a0E0P00000pYNMZ, a0E0P00000pYNMa]                                                                                              10 id's

Thanks, Chris
Hello,

We just had a refresh of one of our sandbox environments (Type Full).
When logging in as partner user and trying to view one of the custom
object records, I get an "insufficient privileges" error.

After extensive research, I noticed there are no 'Owner' records
on the share object.

I ran the following query to find this:

SELECT AccessLevel, Id, IsDeleted, LastModifiedById, LastModifiedDate, ParentId, RowCause, UserOrGroupId FROM CustomObj__Share where RowCause = 'Owner'

Any idea how this could have happened ?

Any help is appreciated.

Thanks, Chris
Hello,

We have an issue where a Set object contains duplicate elements,
but the elements contain the same hashCode. Isn't the hashCode the
determining factor when considering whether there are duplicate items
in a Set ?

The problem starts on line:
        o.Most_Recent_Lead__c = lead.Id;       (see below)

If I comment this line out , there is no issue.

We are then moving the Set object to a List object, expecting
it to have unique elements, then attempt to perform a Database.update.
When attempting this, we get
            Duplicate id in list: 0065B000002HyxqQAC
for ( Opportunity o : oppList ){
        if ( o.accountId != null ){
            Id contactId = someMap.get( o.AccountId );
            if ( contactId != null ){
                List<Leads__c> tmpLeads = someOtherMap.get( contactId );

                if ( tmpLeads != null ){
                    DateTime mostRecent;
                    Leads__c mostRecentLead;
                    for ( Leads__c lead : tmpLeads ){

                        lead.Opportunity__c = o.Id;                                                                                        
                        if ( mostRecent == null || lead.createdDate > mostRecent ){
                            mostRecent = lead.createdDate;
                            o.Most_Recent_Lead__c = lead.Id;
                        }

                        if(updateOppSet.contains(o)){
                            System.debug('Already contains opp'); 
                        } else {
                            updateOppSet.add( o );
                        }
                        System.debug('Hashcode: ' + updateOppSet.hashCode());     // Debugging purposes
                        for ( Opportunity o1 : updateOppSet){
                            System.debug('Hashcode for elm: ' + System.hashCode(o1));
                        }         
                    }   
                }
            }   
        }
    }
    List<Opportunity> updateOppList = new List<Opportunity>();
    updateOppList.addAll( updateOppSet );
    
    Database.Saveresult[] results = Database.update(updateOppList, false);

Wondering why this is happening and if anyone can offer suggestions.

Much appreciated
Chris
Hello,

I've come across the limitation that you cannot associate a
Contact record to a User record that has a non-portal license

This is the error I'm seeing:
"only portal users can be associated to a contact"

Is there a way around this ?

Let me know. Thanks, Chris
Hello,

We just had a refresh of one of our sandbox environments (Type Full).
When logging in as partner user and trying to view one of the custom
object records, I get an "insufficient privileges" error.

After extensive research, I noticed there are no 'Owner' records
on the share object.

I ran the following query to find this:

SELECT AccessLevel, Id, IsDeleted, LastModifiedById, LastModifiedDate, ParentId, RowCause, UserOrGroupId FROM CustomObj__Share where RowCause = 'Owner'

Any idea how this could have happened ?

Any help is appreciated.

Thanks, Chris
Hello,
I'm trying to populate a lightning select component with
a list of list views. It's retrieving ALL list views instead of what
the current user has access to.

I would expect the "with sharing" in the class would enforce the
sharing rules. The "getListViews" method is being called from a lightning
controller (JavaScript code). Can someone investigate ? (See Below)

Thanks, Chris


 
public with sharing class LX_Controller {

    @AuraEnabled
    public static  List<ListView>  getListViews( String sObjectType) {
        List <ListView> listviews = (List <ListView>)Database.query('SELECT Id, Name, SobjectType FROM ListView   WHERE SobjectType =\'' + sObjectType + '\'');
        return listviews;
    }
...
}



 
Hello,

Been researching an issue with duplicate inserts of records.
Below, I posted some log entries for a BeforeInsert and AfterInsert for a trigger.

The question I have is should the number records in the BeforeInsert (represented
by the word "new" ) be equal to the number of records in the AfterInsert (represented
by the id's) ?

I think this may be part of my issue. Just looking for direction.

Let me know if you need more information.


07:25:16.0 (146648)|CODE_UNIT_STARTED|[EXTERNAL]|01qU0000000DJN6|LeadsTrigger on Leads trigger event BeforeInsert for [new, new, new, new, new, new, new, new, new, new, new]  11 inserts
*
*  misc logs
*
07:25:18.471 (3127040361)|CODE_UNIT_FINISHED|LeadsTrigger on Leads trigger event BeforeInsert for [new, new, new, new, new, new, new, new, new, new, new]                       11 inserts
*
*  
* validations
*
*
*
07:25:19.593 (3593202511)|CODE_UNIT_STARTED|[EXTERNAL]|01qU0000000DJN6|LeadsTrigger on Leads trigger event AfterInsert for [a0E0P00000pYNMQ, a0E0P00000pYNMR, a0E0P00000pYNMT, a0E0P00000pYNMU, a0E0P00000pYNMV, a0E0P00000pYNMW, a0E0P00000pYNMX, a0E0P00000pYNMY, a0E0P00000pYNMZ, a0E0P00000pYNMa]                                                          10 id's    
*
*  misc logs
*
07:25:19.593 (3596467452)|CODE_UNIT_FINISHED|LeadsTrigger on Leads trigger event AfterInsert for [a0E0P00000pYNMQ, a0E0P00000pYNMR, a0E0P00000pYNMT, a0E0P00000pYNMU, a0E0P00000pYNMV, a0E0P00000pYNMW, a0E0P00000pYNMX, a0E0P00000pYNMY, a0E0P00000pYNMZ, a0E0P00000pYNMa]                                                                                              10 id's

Thanks, Chris
Hello,

We just had a refresh of one of our sandbox environments (Type Full).
When logging in as partner user and trying to view one of the custom
object records, I get an "insufficient privileges" error.

After extensive research, I noticed there are no 'Owner' records
on the share object.

I ran the following query to find this:

SELECT AccessLevel, Id, IsDeleted, LastModifiedById, LastModifiedDate, ParentId, RowCause, UserOrGroupId FROM CustomObj__Share where RowCause = 'Owner'

Any idea how this could have happened ?

Any help is appreciated.

Thanks, Chris
Hello,

We have an issue where a Set object contains duplicate elements,
but the elements contain the same hashCode. Isn't the hashCode the
determining factor when considering whether there are duplicate items
in a Set ?

The problem starts on line:
        o.Most_Recent_Lead__c = lead.Id;       (see below)

If I comment this line out , there is no issue.

We are then moving the Set object to a List object, expecting
it to have unique elements, then attempt to perform a Database.update.
When attempting this, we get
            Duplicate id in list: 0065B000002HyxqQAC
for ( Opportunity o : oppList ){
        if ( o.accountId != null ){
            Id contactId = someMap.get( o.AccountId );
            if ( contactId != null ){
                List<Leads__c> tmpLeads = someOtherMap.get( contactId );

                if ( tmpLeads != null ){
                    DateTime mostRecent;
                    Leads__c mostRecentLead;
                    for ( Leads__c lead : tmpLeads ){

                        lead.Opportunity__c = o.Id;                                                                                        
                        if ( mostRecent == null || lead.createdDate > mostRecent ){
                            mostRecent = lead.createdDate;
                            o.Most_Recent_Lead__c = lead.Id;
                        }

                        if(updateOppSet.contains(o)){
                            System.debug('Already contains opp'); 
                        } else {
                            updateOppSet.add( o );
                        }
                        System.debug('Hashcode: ' + updateOppSet.hashCode());     // Debugging purposes
                        for ( Opportunity o1 : updateOppSet){
                            System.debug('Hashcode for elm: ' + System.hashCode(o1));
                        }         
                    }   
                }
            }   
        }
    }
    List<Opportunity> updateOppList = new List<Opportunity>();
    updateOppList.addAll( updateOppSet );
    
    Database.Saveresult[] results = Database.update(updateOppList, false);

Wondering why this is happening and if anyone can offer suggestions.

Much appreciated
Chris