Kumar Roopam
IndividualForum Replies Created
-
Kumar
MemberJanuary 2, 2018 at 1:57 pm in reply to: How to restrict a user to not create more than 15 records in Salesforce?Thanks you Mohit! Didn't strike me to use aggregate queries to group records by OwnerIds.
-
Kumar
MemberDecember 29, 2017 at 12:16 pm in reply to: How to restrict a user to not create more than 15 records in Salesforce?Hey Shaik,
You would to most probably write a trigger on Opportunity which saves the count of records created by a user in a custom setting or something. From where you could validate that if a user has created 15 records on Opportunity or not.
Thanks
-
Kumar
MemberFebruary 22, 2017 at 10:08 am in reply to: What are the daily limits on sending Emails whenever a case is generated in salesforce?Hi Sushant,
As far as I know, sent email messages have a limit of 1,000 per day. You can check out this developer forum post for more information.
-
Kumar
MemberFebruary 22, 2017 at 10:04 am in reply to: How can we find if a particular user has edit permission on a specific Sobject in salesforce?Hi Sushant,
If you have a particular user id, you can query on the PermissionSetAssignment object to get the id of all users who have a specific level of access on that Sobject.
For example, this query gives you all the users who have 'view all' and 'modify all' permissions on Account.
SELECT Assignee.Id, Assignee.Name FROM PermissionSetAssignment WHERE PermissionSetId IN (SELECT ParentId FROM ObjectPermissions WHERE SObjectType = 'Account' AND PermissionsViewAllRecords = true AND PermissionsModifyAllRecords = true)
- This reply was modified 7 years, 10 months ago by Kumar.
-
Kumar
MemberFebruary 22, 2017 at 10:00 am in reply to: How to delete a custom metaData in salesforce which I have added as a component in Managed package? -
Kumar
MemberFebruary 16, 2017 at 2:10 pm in reply to: How can we use lightning component in salesforce communityHi Vikas,
In order to be used in a community, your lightning component must implement the "forceCommunity:availableForAllPageTypes" interface and its access must be "global".
Something like this:
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global">
<aura:attribute name="greeting" type="String" default="Hello" access="global" />
<aura:attribute name="subject" type="String" default="World" access="global" /><div style="box">
<span class="greeting">{!v.greeting}</span>, {!v.subject}!
</div>
</aura:component> -
Kumar
MemberFebruary 15, 2017 at 2:38 pm in reply to: How to restrict input to numbers only in inputText field visualforceHi Vikas,
One way you could make this work is use <apex:input type="number" /> instead of apex:inputText.
Otherwise, you could implement some javascript validation or send it back to your controller and do the validation in Apex.
-
Kumar
MemberFebruary 15, 2017 at 2:35 pm in reply to: How can we use an image in a custom field in salesforce?Hi Sushant,
You can use a rich text type field and insert your image there.
Hope this helps.
-
Kumar
MemberFebruary 15, 2017 at 2:34 pm in reply to: What are the advantages of Testsetup in test classes?Hi Sushant,
You can use @testSetup to define common test data for all the methods of a test class.
Go to the developer guide for more details.
-
Kumar
MemberFebruary 14, 2017 at 2:51 pm in reply to: How can we achieve conditional rollback on saving multiple hierarchy records ?Hi Vikas,
You can look into database.savepoint and database.rollback in Salesforce.
Refer to this link for more info.
-
Kumar
MemberFebruary 13, 2017 at 7:34 am in reply to: Is there a way to serialize execution of Salesforce Batchable class?Hi Mohit,
You can use chaining batch jobs can be used for this purpose, for more information you can check out this link.
-
Kumar
MemberFebruary 13, 2017 at 7:30 am in reply to: Salesforce Trailhead challenge error BTSTRGLJHi Prakhar,
Refer to this link, it may help.
-
Kumar
MemberFebruary 13, 2017 at 7:26 am in reply to: Is there any way to check attachments on an object through code in Salesforce?Hi Pranav,
You can query for the attachment with the parentId as the Id of the object record. For example:
SELECT Id FROM Attachment WHERE parentID = <your record's Id>
Hope this helps.
-
Kumar
MemberFebruary 10, 2017 at 2:55 pm in reply to: What is the difference between data loader and workbench?Hi Sushant,
Workbench is a powerful, web-based suite of tools designed for administrators and developers to interact with Salesforce.com organizations via the Force.com APIs. Workbench includes robust support for the Force.com Partner, Bulk, Rest, Streaming, Metadata, and Apex APIs that allows users to describe, query, manipulate, and migrate both data and metadata in Salesforce.com organizations directly in their web browser with a simple and intuitive user interface. Workbench also provides many advanced features for testing and troubleshooting the Force.com APIs, such as customizable SOAP headers, debug logs for API traffic, backward compatibility testing with previous API versions, and single sign-on integration within the Salesforce application.
Data Loader is an easy to use graphical tool that helps you to get your data into Salesforce objects. The Data Loader can also be used to extract data from database objects into any of the destinations mentioned above. You can even use the Data Loader to perform bulk deletions by exporting the ID fields for the data you wish to delete and using that source to specify deletions through the Data Loader.
The Data Loader requires the use of the Force.com API. If your Salesforce edition allows the use of the API (Enterprise, Unlimited and Developer Editions), you can download the Data Loader from the Setup menu, under Administer heading -Data Management.
-
Kumar
MemberFebruary 10, 2017 at 11:33 am in reply to: How can we access custom labels in javascript linked as separate static resource in Salesforce?Hi Mohit,
Custom Labels and the $Label global can be used for this purpose! Instead of evaluating Visualforce inside your JavaScript, you can do a little bit of JavaScript inside your Visualforce.
Load your Custom Labels into the platform using the normal interface,
Create what I like to call a "JavaScript bridging component" that loads before your script, like so:<script>
window.$Label = window.$Label || {};
$Label.MyError = '{!JSENCODE($Label.MyError)}';
$Label.MyPrompt = '{!JSENCODE($Label.MyPrompt)}';
$Label.MyMessage = '{!JSENCODE($Label.MyMessage)}';
</script>Now in your javascript (in a static resource) use the variables just as if they were VF without {!}
<script src="{!URLFOR($Resource.ScriptZip, '/my.js')}">
//NOTE: this example code is for clarity,
//really he lives in the static resource
function errorHandler() {
console.log($Label.MyError);
alert($Label.MyMessage);
}
</script>This is in the spirit of the platform: there is no need to interpret any variation on the token names and you can pluck the values straight out in your JavaScript without inventing anything.
Hope this helps.
- This reply was modified 7 years, 10 months ago by Kumar.
-
Kumar
MemberFebruary 10, 2017 at 11:29 am in reply to: How can we convert Lead to Account through apex code?Hi Sushant,
You can use the LeadConvert class in Salesforce for this scenario. Hope this helps.
-
Kumar
MemberFebruary 10, 2017 at 11:11 am in reply to: How can we get time from Date Time field in Salesforce?Hi Sushant,
Try this formula, this works for any timezone (simply replace the +10 with whatever your timezone is relative to GMT):
IF(
ISBLANK(Departure_Date_Time__c ),"0",
TEXT(MOD(VALUE(
Left(
right( trim(TEXT(Departure_Date_Time__c) ),9),2))+10,24))
&":"&mid(right( trim(TEXT(Departure_Date_Time__c) ),9),4,2)
)Replaced 'Departure_Date_Time__c' with your datetime field, hope this helps.
-
Kumar
MemberFebruary 10, 2017 at 11:07 am in reply to: CSS Style for ui:button in Salesforce Lightning Component non renderingHi Sushant,
The classname which you've given is wrong. This is the correct styling.
.THIS .uiButton.btn{
background-color: #2574a9;
color: #fff;
padding: 10px 20px;
}You may also directly give .THIS .btn (There is space if there's an outer DOM element, otherwise you may avoid the spacing.)
Hope this helps.
-
Kumar
MemberFebruary 9, 2017 at 8:14 am in reply to: How to solve “System.NullPointerException: Attempt to de-reference a null object” in Salesforce apex class?Hi Sushant,
The error “System.NullPointerException: Attempt to de-reference a null object” normally occurs when you try to reference an object which has not been initialized or has null values.
To avoid this you need to make sure that all the sObjects in your class are initialized, preferably in the constructor.
Hope this helps.
-
Kumar
MemberFebruary 5, 2017 at 11:45 am in reply to: Role Hierarchy Issue to enable Opportunity and Case AccessHi Pranav,
I think that the Sharing Rules in your Dev org are Public. If you change the Org Wide Default sharing to Private, you have a chance to define the Access at the time of Role definition.
The Role Hierarchy screen lets you define the 'record access' relationship between your Users. Users can always see records they Own, and any records Owned by Users below them in the Role Hierarchy.
Once your Role Hierarchy is defined, you can use Sharing Settings to determine how you want record access to be controlled in your org (Admin Setup->Security Controls->Sharing Settings). Hope this helps.
-
Kumar
MemberFebruary 5, 2017 at 11:43 am in reply to: How can we integrate the Api's with the lightning?Hi Mohit,
You can go through the following link:
http://www.crmscience.com/single-post/2016/09/16/OOPs-Salesforce-Lightning-Components-Have-APIs-Too
-
Kumar
MemberFebruary 5, 2017 at 11:36 am in reply to: How to send an automated email to a scheduled activity in bulk?Hi Pranav,
I don't understand the full scope of your requirement but probably you will have to use Apex code and use the mass emails class.
Hope this helps.
- This reply was modified 7 years, 10 months ago by Kumar.
-
Kumar
MemberFebruary 5, 2017 at 11:35 am in reply to: How to implement round robin on users in salesforce?Hi Himanshu,
You can refer to these links:
https://help.salesforce.com/articleView?id=000004000&type=1
https://developer.salesforce.com/forums/?id=906F000000094GzIAI
Or check out this app on AppExchange:
https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000178fsEAA&tab=r
-
Kumar
MemberFebruary 5, 2017 at 11:33 am in reply to: How can we hold the system execution on one line while my pop up is opened through javascript?Hi Himanshu,
You refer to this post. Hope this helps.