• ParidhiBindal
  • NEWBIE
  • 19 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 8
    Replies
HI everyone,

I have two community users with same access to a common object.

When I am logging as User 1 - I can see the content of Visualforce page but when I am logging as User 2. I am getting Visualforce error.

Why is this working for one user and not for other?

When I opened browser console, I got this.

Please let me know where is the issue. Thanks.
 Error
I came across few statements which are not very clear to me and looks conflicting. Correct me if I am wrong –

1. Too many SOQL queries – 101 exception –
Reason - If there are more than 100 DML statements in one transaction/context. What does 1 transaction/context mean?
Does it mean within one class if I am trying to query 100+ DML statements? Is this is the only meaning or there is something else.

2. I tried to insert 160 records using lists to avoid the 101 exception. This code ran fine and records were created.
List<Account> listAccounts = new List<Account>();
For (Integer x = 1; x <=160 ; x++) 
{
   Account newAccount = new Account (Name='Loop MyAccount' + x);
   listAccounts.add(newAccount);
   System.debug('Account added ' + x);
}
insert listAccounts;

But I came through this URL - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_examples.htm

This URL mentions "If the list contains more than 150 items, the 151st update returns an exception that can’t be caught."
So now, I ran into confusion because the code had list of 160 records which is 150+ and it created 160 records for me.

Please let me know what part I am missing.

Thanks in advance.
 

I am working in my developer org. I created a Salesforce Community with Build your own salesforce template. I am trying to create something like tabs and one of the tabs I want to use Record Detail Component. The Record Detail should have two detailings - One the details of the User who logs in and second the related record on the User record.

Also, how can I create links into the page to navigate to other Community Builder page?

Thanks.

Hi I am writing my first trigger. Please help.  I have two objects - CourseOffering and CourseConnection, there is a field in CourseOffering named 'Faculty. I want to write a trigger by which on updating Faculty, Course Connection's field named 'Status' changes to 'Former' from 'Current'.

Please help. Thanks.
I came across few statements which are not very clear to me and looks conflicting. Correct me if I am wrong –

1. Too many SOQL queries – 101 exception –
Reason - If there are more than 100 DML statements in one transaction/context. What does 1 transaction/context mean?
Does it mean within one class if I am trying to query 100+ DML statements? Is this is the only meaning or there is something else.

2. I tried to insert 160 records using lists to avoid the 101 exception. This code ran fine and records were created.
List<Account> listAccounts = new List<Account>();
For (Integer x = 1; x <=160 ; x++) 
{
   Account newAccount = new Account (Name='Loop MyAccount' + x);
   listAccounts.add(newAccount);
   System.debug('Account added ' + x);
}
insert listAccounts;

But I came through this URL - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_examples.htm

This URL mentions "If the list contains more than 150 items, the 151st update returns an exception that can’t be caught."
So now, I ran into confusion because the code had list of 160 records which is 150+ and it created 160 records for me.

Please let me know what part I am missing.

Thanks in advance.
 
Hi I am writing my first trigger. Please help.  I have two objects - CourseOffering and CourseConnection, there is a field in CourseOffering named 'Faculty. I want to write a trigger by which on updating Faculty, Course Connection's field named 'Status' changes to 'Former' from 'Current'.

Please help. Thanks.
Re-factored my code from previous units with base lightning components, but receiving this error.  Here's my new form component.  Any help would be much appreciated.

<aura:component >   
    <aura:attribute name="newItem" type="Camping_Item__c"    default="{ 'sobjectType': 'Camping_Item__c',
                         'Name': '',
                         'Price__c': 0,
                         'Quantity__c': 0,                         
                         'Packed__c': false
                       }"/>
 
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">
<div aria-labelledby="newItemForm">

    <!-- BOXED AREA -->
    <fieldset class="slds-box slds-theme--default slds-container--small">

    <legend id="newItemForm" class="slds-text-heading--small 
      slds-p-vertical--medium">
      Add Camping Item
    </legend>

    <!-- CREATE NEW CAMPING ITEM FORM -->
    <form class="slds-form--stacked">          
        <lightning:input aura:id="itemForm" label="Camping Item Name"
                         name="Name"
                         value="{!v.newItem.Name}"
                         required="true"/> 
        <lightning:input type="number" aura:id="itemForm" label="Quantity"
                         name="Quantity"
                         maxlength="16"
                         min="0"
                         step="1"
                         value="{!v.newItem.Quantity__c}"
                         required="true"/>
        <lightning:input type="number" aura:id="itemForm" label="Price"
                         name="Price"
                         min="0"
                         step=".01"
                         value="{!v.newItem.Price__c}"
                         formatter="currency"
                         messageWhenRangeUnderflow="Enter an amount that's at least .01."/>
        <lightning:input type="checkbox" aura:id="itemForm" label="Packed?"  
                         name="Packed"
                         checked="{!v.newItem.Packed__c}"/>
        <lightning:button label="Create Expense" 
                          class="slds-m-top--medium"
                          variant="brand"
                          onclick="{!c.clickCreateItem}"/>
    </form>
  </fieldset>
  <!-- / BOXED AREA -->

</div>
        </lightning:layoutItem>
    </lightning:layout>
</aura:component>

I'm having issues with adding a Menu Item to the Navigation Menu within Community Builder.

User-added image
User-added image

This is what I want: Add a menu item called "My Profile" and have it go directly to the User Profile page.
What's happening: The URL for My Profile requires one or more parameters. Please replace each parameter with the appropriate value.

Name: My Profile

Type: Community Page
Page: User Profile
URL: /profile/:recordId

I am trying to set up Customer communities on the system and am using the Napili standard template that Salesforce provides. I am trying to create a custom tab to allow the user to land on his/her Contact detail page.
However when I try to create the URL using the merge syntax for User's Contact ({!$User.ContactId}), the system throws an error that says,
'The value you entered "/contact/{!$User.ContactId}" for Menu Item "My Contact" of Menu Item Type "InternalLink" isn’t valid.'

How do we define dynamic record IDs for community URL for tabs within the Navigation Menu?
Hi, I am trying to write my first trigger and need some help. 

We have a custom object called Employee that has a field named "Scheduled Review Date". 
I need to create a trigger that upon creation of an Event record this field is updated with the date from Event in field "StartDateTime" < API name. The Related to (who) field on event is my employee. 

I have come up with this so far:
trigger ScheduledReviewDate on Event (after insert) {
    for (Event e: trigger.new){
    
    }
}

I'm not sure where to go from here. I think I need to query employee and then put the field update but I don't really know how to do this. 

I think this is pretty simple so hopefully someone can point me in the right direction. 

Thanks!
Matt

 

This should be a relatively simple request I think, but I can't find another example that has the specifics I need.

 

I would like to update one object based on changes made to another object where one string is equivalent.  In this case, I have a custom object (Customobj__c) that has a trigger on it to update a case with fields from that custom object based on a field that they both have in common.  One of the fields I want to update is a multi-select picklist, too (Event_Types__c).  The primary weirdness I am encountering is that the multi-select picklist doesn't always update when I save the Custom Object record, but I also suspect my code isn't laid out efficiently.  Can anyone help?

 

Here's the code:

 

trigger OnCustobjCaseFields on Customobj__c (before insert, before update)
{
String objSharedField; String objRecordId; String objAccount; String objEventTypes; for(Customobj__c obj: Trigger.new) { if (obj.Shared_Field__c != Null) { objSharedField = obj.Shared_Field__c; objRecordId = obj.Id; objAccount = obj.Account__c; objEventTypes = obj.Event_Types__c; } } List<Case> cases = new List<Case>([SELECT Id, Shared_Field__c, AccountId, Expected_Event_Types__c FROM Case WHERE Shared_Field__c = :objSharedField]); List<Case> caseUpdateList = new List<Case>(); for(Case c: cases) { c.AccountId = objAccount; c.App__c = objRecordId; c.Expected_Event_Types__c = objEventTypes; caseUpdateList.add(c); } if(caseUpdateList.size() > 0) { update caseUpdateList; } }

 

  • September 30, 2013
  • Like
  • 0