+ Start a Discussion
suji srinivasansuji srinivasan 
I have two profiles,in profile 1 user should have read access to account and opportunity , only owner should  edit the record they own.

In profile 2 account and opportunity should be private.how to achiev this?

Thanks in advance
Best Answer chosen by suji srinivasan
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Suji,

The main thing here is you cannot give record level access using Profiles. You have to create the public groups and create the sharing rules as per your requirement.

As the low level security should be private so you have to make OWD as private on Account . and create the sharing rule for read access for profile 1 users by creating a public group.

Anyways the owner of the record will have edit access.

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

Thanks,
 
svidyansvidyan 

Hi,

 

I am following the book "Developement with the Force.com platform" by JasonOuelette.

When creating the Custom Objects, I did not check the box to be visible in a tab, and so I could not add this object to the Custom App I was creating. Now I have a created fields and relationships in the custom object. How do I add this Object to the Custom App?

 

thanks

Svidya

Best Answer chosen by Admin (Salesforce Developers) 
b-Forceb-Force

It looks you havent create custom Tabs while defining custom objects first you need to create custom Tab for new objects Creating Tab Setup -->App Set up---> Create---> Tabs Click on new Tab [drop down shows all untabed objects ] select your object, set Tab style , click Next select profiles Save Adding To App Setup -->App Set up---> Create---> Apps Click on edit, edit available tab section Save Done Thanks, Bala

surendra.cloudsurendra.cloud 

is there any possibility of uploading a video file or directly a video in salesforce sandbox

 

 

Thanks In advance

Best Answer chosen by Admin (Salesforce Developers) 
PrakashbPrakashb

You can use the Salesforce Content inorder to upload the video file in Salesforce and share it to others.

 

To know more about content please follow the below link.

 

http://na1.salesforce.com/help/doc/en/content_about.htm

Admin User 10568Admin User 10568 
Hi, 

Hopeing someone can help me here. 

I would like to filter results in a pageBlockTable in ascending order.

I've created a standard controller extension: 

public with sharing class ProjectONSExtension
{
    private final Id acctId;
    public List<REPRO__Project__c> oncs { get; set; }

    public ProjectONSExtension(ApexPages.StandardController stdController)
    {
        acctId = stdController.getId();
        oncs = Database.query('SELECT Name,REPRO__Street__c, REPRO__City__c, (SELECT Id,name,Property_Level__c,Price_List_Property_Name__c,REPRO__Type__c,REPRO__Bdr__c,REPRO__Bth__c,REPRO__Study__c,REPRO__Internal_Size__c,REPRO__External_Size__c,REPRO__Car__c,REPRO__List_Price__c,REPRO__Status__c from REPRO__Properties__r where REPRO__Project__c =:acctId order by Price_List_Property_Name__c )' +
                ' FROM REPRO__Project__c ' 
   );             
    }
}

It runs without an error. But it didn't order the pageBlockTable results in ascending order. Boo! Any thoughts?

Here is the visual page for reference:

<apex:page standardController="REPRO__Project__c" extensions="ProjectONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <apex:pageBlock >
     
          <h1 style= "text-align: center;">{!REPRO__Project__c.name}</h1>
        <p style= "text-align: center;">{!REPRO__Project__c.REPRO__Street__c}, {!REPRO__Project__c.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
   
        <apex:pageBlockTable value="{!REPRO__Project__c.REPRO__Properties__r}" var="custom" align="center" cellpadding="1" border="2"  style="font-weight: bold; text-align: center; ">
              <apex:column value="{!custom.Property_Level__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.Price_List_Property_Name__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Type__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />   
              <apex:column value="{!custom.REPRO__Bdr__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Bth__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Study__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Internal_Size__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; "  />
              <apex:column value="{!custom.REPRO__External_Size__c}"  style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Car__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__List_Price__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Status__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
            </apex:pageBlockTable>

Any help would be greatly appreciated :)
Best Answer chosen by Admin User 10568
ANUTEJANUTEJ (Salesforce Developers) 
 So I tried checking and I see that there is another example in a similar way but with an extension can you try checking it, below is the link:

>> https://developer.salesforce.com/forums/?id=906F0000000BVX2IAO

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.
Travis Lee 1Travis Lee 1 
When checking this challenge, I get an error stating that the quickContact Lightning Component could not be found. Including screenshots of the steps I took thus far. Any advice would be appreciated!

1. The Lightning component must be named quickContact (this comes as part of the package, confirmed in picture below)
User-added image

2. Create a new action with Label Quick Contact and Name Quick_Contact on the Account object that invokes the quickContact component. (confirmed in picture below)
User-added image
3. Add the appropriate interfaces to the quickContact component. (Hint: there are two.) (used the implements force:lightningquickaction AND the force:hasrecordid on line 1, confirmed in picture below)
User-added image

4. Add the action to the Account Layout page layout. (added in picture below)
User-added image
Best Answer chosen by Travis Lee 1
SandhyaSandhya (Salesforce Developers) 
Hi,

Please check if you have connected to same DE org where you have done  your work in the trailhead.To do this click on" launch your hands on  org" and select the DE org or trailhead playground where you have your work and then check challenge.

 OR

Go to Trailhead Profile -- settings -- make the DE org which you have worked as default then check the challenge.

Please refer below link how to take challenges in trailhead.

https://force.desk.com/customer/portal/articles/2643793-trailhead-profile-signup-login-faq?b_id=13478

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya

 
Joanne Thomas 12Joanne Thomas 12 
Unable to set up free developer org.  Set up process misses out the password step and resetting the password takes me back eventually to the reset window saying the reset link has expired or has been used already.
Best Answer chosen by Joanne Thomas 12
Maharajan CMaharajan C
I have done the reset but you can only recieve the email and proceed further. Otherwise can we connect so that i will create a dev org for you.
My Email : maharajansfdc@gmail.com

 
Richard E. MooreRichard E. Moore 
Reposting this per suggestion from Support. Can folks please confirm that this is not functioning as intended? The behavior is happening in all orgs that I have tested in.

Per the documentation (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_with_security_stripInaccessible.htm), Security.stripInaccessible is supposed to nullify any inaccessible fields, but as of today (I assume related to recent release) it removes the field from the sObject entirely. I don't see any mention of this in the release notes so beleive the change is unintentional.

Consider this test code which, until recently, passed, but now fails because the MemberId__c field is removed from the sObject. I've also included the results of the system.debug calls as comments.
 
@isTest
public class tempTestClass {
@isTest
	public static void test_UserCannotAccess() {
		Contact cont = TestFactory.testContact('DOE', true);
        
		User u = TestFactory.testUser('Standard User', 'standarduser@testorg.com', 'Testing');
		List<Contact> records = [SELECT Id, MemberId__c FROM Contact WHERE MemberId__c != null];
        system.debug(records);
 //09:51:56:170 USER_DEBUG [9]|DEBUG|(Contact:{Id=0030t000010Jz9wAAC, MemberId__c=29AnA})

		system.assertEquals(true, records.size() > 0, 'Some Contacts should exist for this test to be valid.'); //PASS
		system.assertNotEquals(null, records[0].MemberId__c, 'Value must not be null for this test to be valid.'); //PASS

        List<Contact> secureRecords = new List<Contact>();
		System.runAs(u) {
			// The following code runs as user 'u'
			SObjectAccessDecision decision = Security.stripInaccessible(AccessType.READABLE, records);
			secureRecords = decision.getRecords();
		}
        system.debug(secureRecords);
//09:51:56:797 USER_DEBUG [20]|DEBUG|(Contact:{Id=0030t000010Jz9wAAC}) <--Field removed!
		system.assertEquals(null, secureRecords [0].MemberId__c, 'Should have returned null because of FLS.'); //FAILS!!!
	}
}

Note that Security.stripInaccessible is supposed to NULLIFY the field, but leave it in the result. As of the most recent minor release, it is instead REMOVING the field completely, and that is not the documented behavior.
Best Answer chosen by Richard E. Moore
Richard E. MooreRichard E. Moore
Even more interesting, the documentation has now been updated to remove the language saying that the field should be nullified. Instead, we should be using .isSet and perhaps getRemovedFields. It does make it more explicit, but a bit more complicated to use.
Vanessa RamicVanessa Ramic 
I have a formula that currently works. Basically, if Investment Name is XYZ, then filling in the Total Size is required.
AND(ISBLANK(TEXT(Total_Size_c)), ISPICKVAL(Investment_Name_c,"XYZ"))

I want to add additional consideration for another picklist field. I want the above to kick in only if Type_c field is equal to “Addition”  OR  “New Investment”.  

I am not sure how to add this. Can anyone help?
 
Best Answer chosen by Vanessa Ramic
Abdul KhatriAbdul Khatri
Hi Vanessa

Any of the solutions should work.
 
AND(ISBLANK(TEXT(Total_Size_c)), ISPICKVAL(Investment_Name_c,"XYZ"), OR(ISPICKVAL(Type__c, "Addition"), ISPICKVAL(Type__c, "New Investment")))

OR
 
AND(ISBLANK(TEXT(Total_Size_c)), ISPICKVAL(Investment_Name_c,"XYZ"), OR(TEXT(Type__c) = "Addition",TEXT(Type__c) = "New Investment"))

I hope this will help
Pink TacoPink Taco 

 Area Information Analyst Sales can request for promotions into two ways (see below).  Once the promotion has been submitted for approval,  there is a level of notifications that will go to the Regional Sales Manager then to the Marketing Manager.

 

1. Through Distributor-Sales Promotion which is by the Account. The emails has been approved by the above mentioned managers but the area analyst is not getting the approval from the following and the approval history is not updated in the respective account.!

 

 Can anyone explain me what would be the problem ? 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Jeff MayJeff May

Double check which Object the Approval Process is associated with. The Approval History will be tracked on the object that was Approved, not related objects.  If you are not seeing any Approval History section on the page layout, double check that the Approval History Related List has been added to the page layout for the object associated with the Approval Process.

Rocio VivancoRocio Vivanco 
Hi all,

I am struggling since hours trying to find out what the root cause is and how to solve it, but til now without success.

I am trying to deploy a test class.
Here the following relationship: Account has a master detail relationship with Admissions (Admisiones), Study Interests (Intenciones de Estudio), Enrollments (Matriculaciones), Pre-enrollments (Preinscripciones) and Actas.

When trying to deploy the test class, I am getting these errors:
 
EnvioDeCorreoTest	ActaTest	System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.: [Name]
Stack Trace: Class.EnvioDeCorreoTest.InsertAccount: line 12, column 1 Class.EnvioDeCorreoTest.ActaTest: line 146, column 1

EnvioDeCorreoTest	Admisiontest	System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.: [Name]
Stack Trace: Class.EnvioDeCorreoTest.InsertAccount: line 12, column 1 Class.EnvioDeCorreoTest.Admisiontest: line 36, column 1

EnvioDeCorreoTest	Intencionesestudiotest	System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.: [Name]
Stack Trace: Class.EnvioDeCorreoTest.InsertAccount: line 12, column 1 Class.EnvioDeCorreoTest.Intencionesestudiotest: line 54, column 1

EnvioDeCorreoTest	Matriculaciontest	System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.: [Name]
Stack Trace: Class.EnvioDeCorreoTest.InsertAccount: line 12, column 1 Class.EnvioDeCorreoTest.Matriculaciontest: line 98, column 1

EnvioDeCorreoTest	Preinscripciontest	System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.: [Name]
Stack Trace: Class.EnvioDeCorreoTest.InsertAccount: line 12, column 1 Class.EnvioDeCorreoTest.Preinscripciontest: line 73, column 1

EnvioDeCorreoTest	Titulotest	System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.: [Name]
Stack Trace: Class.EnvioDeCorreoTest.InsertAccount: line 12, column 1 Class.EnvioDeCorreoTest.Titulotest: line 122, column 1
My code has the following Method:
 
public static void InsertAccount() {

        Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Alumnos').getRecordTypeId();
        account = new Account(Name = 'Test Account', PersonEmail = 'testaccount@test.com', Nacionalidad__c = 'España', Tipo_de_Id__c = 'DNI', DNI__c = '12345678', RecordTypeId = recordTypeId);
        insert account;
        
   }
What it does is to insert a new account with record type "Alumnos" (Students).

My test class EnviodeCorreoTest looks like this:
 
@isTest(SeeAllData=true)
private class EnvioDeCorreoTest {

    static Preinscripci_n__c preinscripcion;
    static Product2 postgrado;
    static Account account;

   public static void InsertAccount() {

        Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Alumnos').getRecordTypeId();
        account = new Account(Name = 'Test Account', PersonEmail = 'testaccount@test.com', Nacionalidad__c = 'España', Tipo_de_Id__c = 'DNI', DNI__c = '12345678', RecordTypeId = recordTypeId);
        insert account;
        
   }
   
 @isTest 
    static void Admisiontest() {
        
        InsertAccount();
        InsertPostgrado();
        InsertContacto();
        Admisi_n__c admision = new Admisi_n__c();
        admision.Nombre_de_la_cuenta__c = account.Id;
        admision.Idioma_de_preferencia__c = 'Español';
        admision.Programa_Acad_mico__c = postgrado.Id;

        insert admision;
        
        Test.startTest();
        EnvioDeCorreo.enviarCorreoAdmision(admision, 'Notificaci_n_de_registro_de_Admision');
        Test.stopTest();
    }

...
the rest of the methods for enrollments, pre-enrollments, etc. look similar

What I don't understand is, where is the issue. The error is pointing to the field "Name" of the object Account, so far I understand. If I am executing the deployment as Admin, I have access to this field. In the method Admisiontest() I am calling the InsertAccount() method.
All error lines are also pointing to the line:

InsertAccount();

Can please somebody help me to find the answer?. I am stuck in this issue and can not deploy to Production :(.

 
Best Answer chosen by Rocio Vivanco
Rocio VivancoRocio Vivanco
Alex, I could solve my problem! :). I have amended the line:
 
public static void InsertAccount() {

        Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Alumnos').getRecordTypeId();
        account = new Account(Name = 'Test Account', PersonEmail = 'testaccount@test.com', Nacionalidad__c = 'España', Tipo_de_Id__c = 'DNI', DNI__c = '12345678', RecordTypeId = recordTypeId);
        insert account;
        
   }

so that it looks now so:
 
public static void InsertAccount() {

        Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Alumnos').getRecordTypeId();
        account = new Account(FirstName = 'Test', LastName = 'Test', PersonEmail = 'testaccount@test.com', Nacionalidad__c = 'España', Tipo_de_Id__c = 'DNI', DNI__c = '12345678', RecordTypeId = recordTypeId);
        insert account;
        
   }
It probably says that there is no access to the Name field because if you insert an account you have to first indicate first name and last name for the first time, giving this information the field Name can be filled.
I also removed the part with the InsertContact() in my code according to this thread:

https://salesforce.stackexchange.com/questions/7747/invalid-cross-reference-key-can-not-select-a-person-account-accountid

So, I could then deploy the test class.
Thank so much anyway for your efforts.