• Christian Henning
  • NEWBIE
  • 15 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Our question is regarding custom fields.  When we install our package (this is for the security review) in PROD (the package was created in DEV), the custom fields are being added to the Contact sObject, but they are not being added to the forms for editing these objects, so we cannot actually add those fields.  And they appear locked (and therefore uneditable) even when we display them.  Does anyone have a suggestion on how to fix this issue?  Thanks.
I am getting this error from the Developer Console:
System.QueryException: List has no rows for assignment to SObject
For this specific line in my test:
PermissionSet ps = [SELECT Id FROM PermissionSet WHERE Name = 'My_Permission_Set'];

For my permission set (titled 'My_Permission_Set'), I just cloned CMA Admin User. Is that enough? What else am I missing? This is my apex code (not the test - but the original, I just need access to Contacts and Cases):
 
global with sharing class ContactController {
    @RemoteAction
    global static Contact[] getContactInfo(String recordId) {
        String contactId = [SELECT ContactId FROM Case WHERE Id= :recordId WITH SECURITY_ENFORCED].ContactId;
        List<Contact> selectedContact = [SELECT Id, Name, LOB__c, PlanName__c FROM Contact WHERE Id= :contactId WITH SECURITY_ENFORCED];  
        SObjectAccessDecision decision = Security.stripInaccessible(
            AccessType.READABLE, 
            selectedContact);
        return (Contact[])decision.getRecords();
    }
}

 
Our question is regarding custom fields.  When we install our package (this is for the security review) in PROD (the package was created in DEV), the custom fields are being added to the Contact sObject, but they are not being added to the forms for editing these objects, so we cannot actually add those fields.  And they appear locked (and therefore uneditable) even when we display them.  Does anyone have a suggestion on how to fix this issue?  Thanks.
I am getting this error from the Developer Console:
System.QueryException: List has no rows for assignment to SObject
For this specific line in my test:
PermissionSet ps = [SELECT Id FROM PermissionSet WHERE Name = 'My_Permission_Set'];

For my permission set (titled 'My_Permission_Set'), I just cloned CMA Admin User. Is that enough? What else am I missing? This is my apex code (not the test - but the original, I just need access to Contacts and Cases):
 
global with sharing class ContactController {
    @RemoteAction
    global static Contact[] getContactInfo(String recordId) {
        String contactId = [SELECT ContactId FROM Case WHERE Id= :recordId WITH SECURITY_ENFORCED].ContactId;
        List<Contact> selectedContact = [SELECT Id, Name, LOB__c, PlanName__c FROM Contact WHERE Id= :contactId WITH SECURITY_ENFORCED];  
        SObjectAccessDecision decision = Security.stripInaccessible(
            AccessType.READABLE, 
            selectedContact);
        return (Contact[])decision.getRecords();
    }
}