Forum Replies Created

Page 4 of 8
  • Aman

    Member
    May 1, 2018 at 9:46 am in reply to: What is Salesforce apex managed sharing?

    Hi Pranav,

    Sharing enables record-level access control for all custom objects, as well as many standard objects (such as Account, Contact, Opportunity and Case). Administrators first set an object’s organization-wide default sharing access level, and then grant additional access based on record ownership, the role hierarchy, sharing rules, and manual sharing. Developers can then use Apex managed sharing to grant additional access programmatically with Apex.
    Most sharing for a record is maintained in a related sharing object, similar to an access control list (ACL) found in other platforms.

    Types of Sharing
    Salesforce has the following types of sharing:

    Force.com Managed Sharing
    Force.com managed sharing involves sharing access granted by Force.com based on record ownership, the role hierarchy, and sharing rules:Record Ownership
    Each record is owned by a user or optionally a queue for custom objects, cases and leads. The record owner is automatically granted Full Access, allowing them to view, edit, transfer, share, and delete the record.
    Role Hierarchy
    The role hierarchy enables users above another user in the hierarchy to have the same level of access to records owned by or shared with users below. Consequently, users above a record owner in the role hierarchy are also implicitly granted Full Access to the record, though this behavior can be disabled for specific custom objects. The role hierarchy is not maintained with sharing records. Instead, role hierarchy access is derived at runtime. For more information, see “Controlling Access Using Hierarchies” in the Salesforce online help.
    Sharing Rules
    Sharing rules are used by administrators to automatically grant users within a given group or role access to records owned by a specific group of users. Sharing rules cannot be added to a package and cannot be used to support sharing logic for apps installed from AppExchange.Sharing rules can be based on record ownership or other criteria. You can’t use Apex to create criteria-based sharing rules. Also, criteria-based sharing cannot be tested using Apex.
    All implicit sharing added by Force.com managed sharing cannot be altered directly using the Salesforce user interface, SOAP API, or Apex.
    User Managed Sharing, also known as Manual Sharing
    User managed sharing allows the record owner or any user with Full Access to a record to share the record with a user or group of users. This is generally done by an end user, for a single record. Only the record owner and users above the owner in the role hierarchy are granted Full Access to the record. It is not possible to grant other users Full Access. Users with the “Modify All” object-level permission for the given object or the “Modify All Data” permission can also manually share a record. User managed sharing is removed when the record owner changes or when the access granted in the sharing does not grant additional access beyond the object's organization-wide sharing default access level.
    Apex Managed Sharing
    Apex managed sharing provides developers with the ability to support an application’s particular sharing requirements programmatically through Apex or the SOAP API. This type of sharing is similar to Force.com managed sharing. Only users with “Modify All Data” permission can add or change Apex managed sharing on a record. Apex managed sharing is maintained across record owner changes.

    Thanks

  • Hi Saurabh ,

    Use the error messages that appear in the Process Builder and the emails you receive when a process fails to help solve problems that arise when you’re working with processes. When all else fails, look at the Apex debug logs for your processes.

    Common Reasons Why Processes Fail
    Here are some common design problems that cause processes to fail.
    Errors in the Process Builder
    The API names for criteria nodes and actions are created in the background. When you create or update processes, you might see error messages that reference those names to help you identify specifically where the problem occurred.
    What Happens When a Process Fails?
    When a user performs an action that triggers a process (such as creating a record) and that process fails, the user sees a page with this error: “Workflow Action Failed to Trigger Flow.” In addition, the administrator who activated the process receives an email with more details.
    Troubleshoot Processes with Apex Debug Logs
    Use debug logs to find detailed information about your running processes after they finish running. For example, if a process doesn’t seem to trigger when a record meets the process’s criteria, or if you want to understand the sequence of processes being executed.

    Thanks

  • Aman

    Member
    May 1, 2018 at 8:48 am in reply to: What are all the things that are not supported in joined reports?

    Hi Pranav,

    Most of the things you can do with summary or matrix reports you can also do with joined reports, such as find, add, and remove fields; summarize fields; and run and save reports. However, there are some things you can’t do.

    Here are some things you can’t do with joined reports :
    Add bucketed fields.
    Add cross filters.
    Drag and drop filters from the Fields pane on to the Filter pane.
    Apply conditional highlighting.
    Change the hierarchy for opportunity or activity reports.
    Create reporting snapshots based on joined reports.

    Standard Report Types That Can’t Be Used in Joined Reports
    Accounts and Contacts
    Account History
    Account Owners*
    Contact History
    Activities
    My Delegated Approval Requests*
    Administrative
    All Pending Approval Requests*
    API Usage Last 7 Days*
    Campaign
    Campaign Call Down*
    Campaign Member
    Campaign Member Analysis*
    Campaigns with Influenced Opportunities
    Contract
    Contract History
    Order History
    Customer Support
    Case History
    Self Service Usage
    Solution History
    File and Content
    Content Authors
    Content Publication Time Frame
    File and Content Downloads
    File and Content Engagement
    File and Content Links
    Library Administrators
    Library Content
    Most Content Downloads
    Most Content Subscriptions
    Stale Content
    Forecasts
    Customizable Forecasting: Forecast History
    Customizable Forecasting: Forecast Summary
    Customizable Forecasting: Opportunity Forecasts
    Forecast History
    Forecasts
    Quota versus Actual*
    Lead
    Lead All
    Lead History
    Lead Status*
    Opportunity
    Opportunities with Contact Roles and Products
    Opportunities with Opportunity Teams and Products
    Opportunity Field History
    Price Books, Products and Assets
    Assets without Products*

    Thanks

  • Aman

    Member
    May 1, 2018 at 8:42 am in reply to: Can we update parent record with workflow field update?

    Hi Pranav,
    By following the below steps you can achieve how to update parent field using workflows.
    Let us take Account and Opportunity objects as an example.

    1. Create a workflow rule for Opportunity Object (Detail/Child object)
    2. Set the evaluation criteria as required.
    3. set the Rule Criteria as required.
    4. Click next.
    5. Select field update from the 'Add workflow action' dropdown menu
    6. Fill in the Name, Unique Name & Description. If you notice 'Field to update' will appear as a dropdown with two possible values a) Opportunity b) Account (As account is a master object for Opportunity)
    7. When you select Account object in the above dropdown, the second dropdown shows all the standard & custom fields from account object.
    8. Select any field and set the formula to update that field.

    This is how you can update the parent field from a workflow rule set on child object by setting the criteria on child object.

    Thanks.

  • Hi Rajan,

    You can use the below code :

    <div style = display:none;>
    #$$$$$${!Lead.Id}##
    </div>

    Thanks

  • Aman

    Member
    May 1, 2018 at 8:34 am in reply to: Issues with Custom Buttom in a Salesforce Opportunity

    Hi Rafi,

    You can execute the below logic on your custom button :

    <apex:page standardController="Opportunity">
    <apex:detail Subject="{!Opportunity.Id}" relatedList="true" title="true" oncomplete="Javascript:location.reload();" />

    <script src = "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script type = "text/Javascript">

    var jquery = $.noConflict();
    jquery(document).ready(function(){

    var $buttons = jQuery("[name= 'discount_approval']");
    if ('{!Opportunity.StageName}' != 'Proposal/Price Quote' && '{!Opportunity.StageName}' != 'Negotiation/Review'){

    $buttons.toggleClass('btnDisabled', true).attr('disabled', 'disabled');
    }
    });
    </script>
    </apex:page>

    Abhi

  • Hi Rajan,

    You can use the below query :

    [SELECT Id,Name FROM RecentlyViewed WHERE Type = 'et4ae5__IndividualEmailResult__c' ];

    Thanks

  • Aman

    Member
    May 1, 2018 at 8:28 am in reply to: how to fetch value of tag in script tag in a visualforce Page?

    Hi Rajan,

    <apex:inputHidden value="{!theme}" id="theHiddenInput"/>

    You can use the below script

    <script>
    var userThemeDisplayed = $('[id$=theHiddenInput]').val();

    </script>

    Thanks

  • Hi Rajan,

    SetSenderDisplayName won't work here. use setOrgWideEmailAddressId, by creating a custom setting and put the record owner in setting
    list<String> listOfEmailsAddress = new list<String>();
    for(Lead leadobj : leadList){
    String [] toRecipients = new String[] {leadobj.NominatorEmail__c};
    Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
    email.setToAddresses(toRecipients);
    email.setTargetObjectId(leadobj.Id);
    email.setUseSignature(false);
    email.setBccSender(false);
    email.setTemplateId(templateId);
    if(listofEmailAddresses.size() > 0 ) {
    email.setOrgWideEmailAddressId(listofEmailAddresses.get(0).Id);
    }
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
    }

    Thanks

  • Hi Rajan,

    As i can see in you code, please add setSaveAsActivity as true in your code Like below.

    Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
    email.setToAddresses(toRecipients);
    email.setSenderDisplayName(leadobj.Owner_Name__c);
    email.setTargetObjectId(leadobj.Id);
    email.setUseSignature(false);
    email.setBccSender(false);
    email.setSaveAsActivity(true);
    email.setTemplateId(templateId);

    Thanks

  • Aman

    Member
    May 1, 2018 at 8:15 am in reply to: Can we bypass validation Rules?

    Hi Saurabh,

    Below are the steps for allowing certain users to bypass a Validation Rule :

    1. Create a Custom Permission.
    2. Create a Permission Set and mark the Custom Permission as active in that set.
    3.  Assign users to the Permission Set who should be able to bypass the Validation Rule.
    4. a line to the Validation Rule that references the Custom Permission

    the line is $Permission.PermissionName = FALSE

    salesforce-validation-rule

  • Aman

    Member
    May 1, 2018 at 8:07 am in reply to: Can we create a formula type in report and How?

    Hi Pranav,

    Before adding a summary formula to your report, be sure to group report data. Summary formula columns require at least 1 group.
    Available in: Salesforce Classic and Lightning Experience
    Available in: Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions
    Available in: Enhanced Folder Sharing and Legacy Folder Sharing
    User Permissions Needed
    To create, edit, and delete summary formula columns in private reports:
    Legacy Folder Sharing
    Create and Customize Reports
    Enhanced Folder Sharing
    Create and Customize Reports
    To create, edit, and delete summary formula columns in public and private reports:
    Legacy Folder Sharing
    Report Builder
    Enhanced Folder Sharing
    Report Builder OR Report Builder (Lightning Experience)
    Summary formula columns are available in both Lightning Experience and Salesforce Classic. They use the same formula language, so the summary formulas you add in Lightning Experience work in Salesforce Classic, and vice versa.

    The steps for adding a summary formula column are a little different depending on whether you’re using Lightning Experience or Salesforce Classic. Follow the instructions based on whether you’re using the Lightning Experience or the Salesforce Classic report builder.

    Note
    Summary formulas are powerful and complex. For help building your formula, refer to Formula Operators and Functions in Salesforce Help.
    Add a Summary Formula Column in Lightning Experience
    Edit or create a report.
    If necessary, group report data. From the Groups section, select a field from the Add group... lookup menu under GROUP ROWS.
    From the Columns section, click   | Add Summary Formula Column.
    Optionally, to open the full editor, click Switch to Full Editor.
    Enter a summary formula. For example:IF(AMOUNT:SUM < 1000000, AMOUNT:SUM * (1 - 0.15), AMOUNT:SUM * (1 - 0.20))
    To see if your formula contains errors, click Check Syntax. Resolve any errors.
    Optionally, click FORMAT to choose how to format results, how many decimal points to show, and to change where the formula gets applied.
    Click Apply.
    Click Save.
    Add a Summary Formula Column in Salesforce Classic
    Edit or create a report.
    If necessary, group report data. Change the format to Summary, Matrix, or Joined, find the field you want to group by, and drop it into the grouping field.
    From the Fields pane, in the Formulas folder, click Add Formula.
    Enter a name for your formula column. The label must be unique. Optionally, enter a description.
    From the Format dropdown list, select the appropriate data type for your formula based on the output of your calculation.
    From the Decimal Places dropdown, select the number of decimal places to display for currency, number, or percent data types. This setting is ignored for currency fields in multicurrency organizations. Instead, the Decimal Places for your currency setting apply.
    Set the Where will this formula be displayed? option. The formula calculation displays in the report at the level you select. To display the formula calculation at every level, including the Grand Total, select All summary levels.
    Build your formula.Select one of the fields listed in the Summary Fields dropdown list. This field’s value is used in your formula.
    Select a summary type for use in your formula. This option is not available for Record Count.Summary Type
    Description
    Sum
    The summary value of data in a field or grouping of fields.
    Largest Value
    The largest value of data in a field or grouping of fields.
    Smallest Value
    The smallest value of data in a field or grouping of fields.
    Average
    The average of data in a field or grouping of fields.
    To add operators (like > or <) to your formula, click Operators.
    Select the function category (All, Logical, Math, or Summary), choose the function you want to use in your formula, and click Insert.
    Repeat these steps as necessary.
    To see if your formula contains errors, click Check Syntax. If there are errors, the cursor highlights them.
    Click OK.
    Click Save.
    The summary formula column appears in your report.

    Thanks

  • Hi Saurabh,

    You need to give Manager Force.com Flow and View All Data permissions (which kind of acts as giving Customize Application permission but with less controls)

    Thanks

  • Aman

    Member
    May 1, 2018 at 8:00 am in reply to: Can we avoid deletion of records through validation rules?

    Hi Saurabh,
    I think you can only do this with a validation rule if the object in question is the child in a master-detail relationship. If so:

    Set up a rollup summary field on the parent object which counts the number of child records.
    Set up a validation rule on the parent object which prevents the rollup field value from decreasing:

    If that doesn't work, a simple trigger will:

    trigger DeletePrevention on MyObject__c (before delete) {

    for (MyObject__c mo : Trigger.old) {

    mo.addError('Unable to delete record!');
    }
    }

    Thanks

  • Aman

    Member
    May 1, 2018 at 7:53 am in reply to: Can we define apex sharing reason for standard object?

    Hi Pranav,

    Since we have defined Apex Sharing Reason on Custom Object sharing, it will keep Share table records updated whenever record owner is changed.  So, still granted user can access the records without any issue. This scenario is totally different for standard object because Standard objects don’t support Apex Sharing Reason. So, while sharing standard object records, by default you must define RowCause is “Manual”.

    It will impact the sharing table when record owner is changed. To solve this issue, we need to call apex sharing logic for both Insert as well as update function.

    Example Apex Sharing Code for Standard Objects: 

    download (2)

    Record Sharing via Workflow Rule.

    When you are sharing records to external system via Outbound Message, you should add condition like “OwnerId <> PriorValue(OwnerId)”. So, whenever record owner is going to change, it will share the records to external system again.

    Thanks

  • Aman

    Member
    May 1, 2018 at 7:47 am in reply to: What is 'Suppression list' in Salesforce Marketing Cloud?

    Hi Rajan,

    A suppression list is a list of subscribers that you don't want to receive your communications. Suppression lists filter out email addresses and prevent those addresses from receiving your messages. Suppression lists serve as a "do not contact" list for your email sends. Examples of the types of addresses included on a suppression list are addresses with a history of spam complaints, unsubscribe lists from previous providers or advertisers, addresses of your competitors, and canceled customers.

    Thanks

  • Hi Rajan,

    Tracking HTML Email, Available in: Salesforce Classic .It's not available in lightning experience.

    Thanks

  • Hi Saurabh,

    If a conflict occurs between two permissions in Salesorce, it chooses the one with less access.

    Thanks

  • Hi Saurabh,

    Your process needs to fulfil any one of the below conditions to have schedule actions:

    1. Start the process only when a record is created.
    2. Start the process when a record is created or edited

    Thanks

  • Hi Saurabh,

    Administrators to grant access to records associated with a given object across the organization. “View All” and “Modify All” can be better alternatives to the “View All Data” and “Modify All Data” permissions.
    Available in: Salesforce Classic and Lightning Experience
    Available in: All Editions
    Be aware of the following distinctions between the permission types.Permissions
    Used for
    Users who need them
    View AllModify All
    Delegation of object permissions.
    Delegated administrators who manage records for specific objects
    View All DataModify All Data
    Managing all data in an organization; for example, data cleansing, deduplication, mass deletion, mass transferring, and managing record approvals.Users with View All Data (or Modify All Data) permission can view (or modify) all apps and data, even if the apps and data are not shared with them.
    Administrators of an entire organization
    View All Users
    Viewing all users in the organization. Grants Read access to all users, so that you can see their user record details, see them in searches, list views, and so on.
    Users who need to see all users in the organization. Useful if the organization-wide default for the user object is Private. Administrators with the “Manage Users” permission are automatically granted the “View All Users” permission.

    Thanks

  • Aman

    Member
    May 1, 2018 at 7:26 am in reply to: How to create share table record using Salesforce apex?

    Hi Pranav,

    To access sharing programmatically, you must use the share object associated with the standard or custom object for which you want to share. For example, AccountShare is the sharing object for the Account object, ContactShare is the sharing object for the Contact object. In addition, all custom object sharing objects are named as follows, where MyCustomObject is the name of the custom object:

    MyCustomObject__Share

    Objects on the detail side of a master-detail relationship do not have an associated sharing object. The detail record’s access is determined by the master’s sharing object and the relationship’s sharing setting. For more information, see “Custom Object Security” in the Salesforce online help.

    A share object includes records supporting all three types of sharing: Force.com managed sharing, user managed sharing, and Apex managed sharing. Sharing granted to users implicitly through organization-wide defaults, the role hierarchy, and permissions such as the “View All” and “Modify All” permissions for the given object, “View All Data,” and “Modify All Data” are not tracked with this object.

    Every share object has the following properties:

    Property Name
    Description
    objectNameAccessLevel
    The level of access that the specified user or group has been granted for a share sObject. The name of the property is AccessLevel appended to the object name. For example, the property name for LeadShare object is LeadShareAccessLevel. Valid values are:Edit
    Read
    All
    The All access level can only be used by Force.com managed sharing.
    This field must be set to an access level that is higher than the organization’s default access level for the parent object. For more information, see Understanding Sharing.
    ParentID
    The ID of the object. This field cannot be updated.
    RowCause
    The reason why the user or group is being granted access. The reason determines the type of sharing, which controls who can alter the sharing record. This field cannot be updated.
    UserOrGroupId
    The user or group IDs to which you are granting access. A group can bea public group or a sharing group associated with a role
    a territory group if you use the original version of Territory Management, but not with Enterprise Territory Management
    This field cannot be updated.

    Thanks

  • Hi Harsh,

    I didn't get your point 'I need to integrate into one that is in <apex:inputtextarea>'. Please elaborate your problem a little more.

    Thanks

  • Aman

    Member
    April 27, 2018 at 9:30 am in reply to: How to detect in which Salesforce environment I am working?

    Hi Pranav,

    with javascript you can do that :

    if(document.referrer.indexOf(".lightning.force.com") > 0){
    alert("welcome to lightning ");
    }else{
    alert("welcome to classic");
    }

  • Aman

    Member
    April 27, 2018 at 9:29 am in reply to: How to Lock custom setting in salesforce?

    Hi Saurabh,

    If you look at the documentation on the Lead object, there is no CampaignId field (nor any reference to Campaign. However, if you wanted to loop through the Campaigns a Lead is joined to, there is a CampaignMembers related list (see also the documentation for the CampaignMember object). You could, for example, do:

    <apex:page standardController="Lead">
    <apex:relatedList list="CampaignMembers" />
    </apex:page>
    Or if you wanted more granular control over which fields to display:

    <apex:page standardController="Lead">
    <apex:pageBlock>
    <apex:pageBlockTable value="{!Lead.CampaignMembers}" var="member">
    <apex:column value="{!member.Campaign.Name}" />
    <!-- other columns -->
    </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:page>

    Thanks

  • Aman

    Member
    April 27, 2018 at 9:28 am in reply to: URL Navigation in salesforce classic vs lightning

    Hi Pranav,

    You can also use Salesforce navigateToURL event to navigate URL In lightning,

    navigate : function(component, event, helper) {

    //Find the text value of the component with aura:id set to "address"
    var address = component.find("address").get("v.value");

    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
    "url": 'https://www.google.com/maps/place/' + address
    });
    urlEvent.fire();
    }

Page 4 of 8