• User 444
  • NEWBIE
  • 45 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 4
    Replies
Is there an automated way to copy a profile's "object and field" settings to an existing permission set? Through data loader or an apex class?
1. If I deploy a profile from autorabbit from dev to qa sandbox, will it deploy apex classes access, vf page access and other object settings in qa? Do i need to do anything manually in qa box again?

2. Is there a way to assign apex classes to a profile through data loader?
insert new SetupEntityAccess( ParentId = '0PS...', // PermissionSet ID SetupEntityId = '01p...' // ApexClass ID );

In above apex class, i want to add some 1000 apex class ids in setupentityid, how is it possible? Thanks!
Can someone please help in writing test class for below apex class with 100% code coverage. thanks!

public static List<String> getUserName(List<String> currentOwnerValues) {
    List<String> ownerNames = new List<String>();
set<String> uniqueIds = new set<String>(); 
    for (String currentOwnerValue : currentOwnerValues) {
        String trimmedId = currentOwnerValue.trim();
       If(!string.isBlank(trimmedId)){
uniqueIds.add(trimmedId);
}
}

Map<String, User> userMap = new Map<String, User>();
if(uniqueIds.size()>0){
for(   User u = [SELECT Id, Name FROM User WHERE FederationIdentifier IN :uniqueIds];
}
for(String currentOwnerValue : currentOwnerValues){
String trimmedId = currentOwnerValue.trim();
User u = userMap.get(trimmedId);
string ownername;
         
            if (u != null) {
                ownerName = String.escapeSingleQuotes(u.Name);
            }
        } catch (Exception ex) {
            ownerName = String.escapeSingleQuotes(trimmedId);
        }
        ownerNames.add(ownerName);
    }
    return ownerNames;
}

 
which is better option to use cmp file of aura : 1aura: if or 2 normal if condition?

I have been using below code to display list views in custom object page using VF.
But I want "Edit|create list view" in this custom page(same as standard page). How to do that?
<apex:selectList value="{!FilterId}" size="1">
                                            <apex:selectOptions value="{! listViewOptions}" />
                                            <apex:actionSupport event="onchange" reRender="leadRecs" status="loadingMsgStatusId"/>
                                        </apex:selectList>

 
0
I am calling a vf page from a custom button if it meets a particular condition, but now I want to call another vf page if condition changes. Is it possible? and how to do it?
In below code, I want selected product = "anytwo"( if any two of T1, T2, T3 are active) condition displaying /apex/AP_productSelectionPage.(another vf page)
My code as of now displaying only one vf page:
/apex/AP_AgencySelectionPage?contactId={!Contact.Id}&selectionType=Register_Agency& selectedProduct={! if( and(Contact.IsT1Active__c,Contact.IsT2Active__c,!Contact.IsT3Active__c ), 'T3', if( and(Contact.IsT2Active__c,!Contact.IsT1Active__c,Contact.IsT3Active__c ), 'T1', if( and(!Contact.IsT2Active__c,Contact.IsT1Active__c,Contact.IsT3Active__c ), 'T2', if( and(!Contact.IsT2Active__c,Contact.IsT1Active__c,!Contact.IsT3Active__c ), 'T2', if( and(!Contact.IsT2Active__c,!Contact.IsT1Active__c,Contact.Ist3Active__c ), 'T1', if( and(Contact.IsT2Active__c,!Contact.IsT1Active__c,!Contact.IsT3Active__c ), 'T1' , if( and(Contact.IsT2Active__c,Contact.IsT1Active__c,Contact.IsT3Active__c ), 'Allthree' )))
1. If I deploy a profile from autorabbit from dev to qa sandbox, will it deploy apex classes access, vf page access and other object settings in qa? Do i need to do anything manually in qa box again?

2. Is there a way to assign apex classes to a profile through data loader?
1. If I deploy a profile from autorabbit from dev to qa sandbox, will it deploy apex classes access, vf page access and other object settings in qa? Do i need to do anything manually in qa box again?

2. Is there a way to assign apex classes to a profile through data loader?
Can someone please help in writing test class for below apex class with 100% code coverage. thanks!

public static List<String> getUserName(List<String> currentOwnerValues) {
    List<String> ownerNames = new List<String>();
set<String> uniqueIds = new set<String>(); 
    for (String currentOwnerValue : currentOwnerValues) {
        String trimmedId = currentOwnerValue.trim();
       If(!string.isBlank(trimmedId)){
uniqueIds.add(trimmedId);
}
}

Map<String, User> userMap = new Map<String, User>();
if(uniqueIds.size()>0){
for(   User u = [SELECT Id, Name FROM User WHERE FederationIdentifier IN :uniqueIds];
}
for(String currentOwnerValue : currentOwnerValues){
String trimmedId = currentOwnerValue.trim();
User u = userMap.get(trimmedId);
string ownername;
         
            if (u != null) {
                ownerName = String.escapeSingleQuotes(u.Name);
            }
        } catch (Exception ex) {
            ownerName = String.escapeSingleQuotes(trimmedId);
        }
        ownerNames.add(ownerName);
    }
    return ownerNames;
}

 
which is better option to use cmp file of aura : 1aura: if or 2 normal if condition?
Need to display the data from lookup object (ex:User object) we used for Project Manager, assignee etc.. also Createdby, lastmodified by. 
How can we display these Names using a data table in LWC?  Appreciate any help. 
Hello,
I am trying to do the following.  Have a button on teh parenet record that will render the child records in a datatable(editable)
What ever is selected I need to be able to create a new record from the rows slected.
I have a LWC and controller.  The LWC is wrapped in a aura compone tbut when selected it just has the header columns.
Should I try to  grab the child records in the .js?

Then how do I add a button to the LWS to create a new record from the rows slected?

Thank you for your help,
P
I am trying to create a custom lookup search in lwc and after selecting the record from the lookup I have to click an add button so that it would be added to a lwc datatable. But my problem is when I am clicking the add button only the data from current searc is coming to the table removing the previously added data.