Sudhir Kumar
IndividualForum Replies Created
-
Sudhir
MemberJuly 24, 2017 at 7:23 pm in reply to: One account record have one contact record,so when i'm creating the second record for same account it will show error message "you can't create more than oneSo you wanted to have 1-to-1 relationship between Account & Contact.?
Just think a bit more, it can be achieved using wf field update.
-
Sudhir
MemberJuly 24, 2017 at 8:19 am in reply to: How to integrate salesforce to salesforce by using point and clickHave you tried using external object with Salesforce Connect: Cross-org as the type of external data source.
-
Sudhir
MemberJuly 24, 2017 at 8:16 am in reply to: One account record have one contact record,so when i'm creating the second record for same account it will show error message "you can't create more than oneWHY DO YOU WANT TO USE TRIGGER IF YOU CAN ACHIEVE THIS USING A WORKFLOW FIELD UPDATE ON A TEXT FIELD.
Any specific reason.
-
Sudhir
MemberJuly 21, 2017 at 5:53 pm in reply to: What parameters should be kept in mind while checking dependency of one class on another?One way could be: Go to that class --> Select "Show Dependencies" button,
-
Sudhir
MemberJuly 21, 2017 at 5:27 pm in reply to: How to share private records with different Users in salesforce organization?You can use Grant access using role hierarchies if the users are up in the same hierarchy.
For cross hierarchy, you can use different options like Sharing Rules(Criteria & Owner based), Manual Sharing and Apex Sharing as well.
For more info, refer salesforce guide.
-
Sudhir
MemberJuly 20, 2017 at 2:36 pm in reply to: What are the parameters of a clone method in Salesforce?I am not going to duplicate the explanation if it is already existing somewhere.
Bringing it at your click here: Clone Explained
Let me know if you wanted to know any specifics which are not explained in this blog post.
-
Sudhir
MemberJuly 18, 2017 at 8:23 am in reply to: How to change the value of formula field by Salesforce Visualforce page?Formula field value cannot be changed directly, they are read only. However, the value of formula fields can be changed by changing the values of the fields referenced in the formula fields.
-
Sudhir
MemberJuly 18, 2017 at 7:45 am in reply to: Salesforce - What is Starting Number in Auto Number DataType?Autonumber is a system-generated sequence number that uses a display format you define. The number is automatically incremented for each new record.
The Starting Number defines the starting point of the number in the format for the subsequently created records.
-
Sudhir
MemberJuly 17, 2017 at 8:07 am in reply to: What is the Limit for record retrieve in a Salesforce subquery ?This point can help you understand this:
In a SOQL query with parent-child relationship subqueries, each parent-child relationship counts as an extra query. These types of queries have a limit of three times the number for top-level queries. The row counts from these relationship queries contribute to the row counts of the overall code execution.
So, Total number of records retrieved by SOQL queries would be 50,000 altogether.
-
Sudhir
MemberJuly 12, 2017 at 8:21 am in reply to: what is the use of Database.Stateful in Salesforce Batch Class?Look at the example in the Aman's response above.
-
Sudhir
MemberJuly 11, 2017 at 2:52 pm in reply to: what is the use of Database.Stateful in Salesforce Batch Class?I think you can do a little bit of searching inside Salesforce Apex Developer Guide to get this answer.
Each execution of a batch Apex job is considered a discrete transaction. For example, a batch Apex job that contains 1,000 records and is executed without the optional scope parameter is considered five transactions of 200 records each.
If you specify Database.Stateful in the class definition, you can maintain state across these transactions. When using Database.Stateful, only instance member variables retain their values between transactions. Static member variables don’t retain their values and are reset between transactions. Maintaining state is useful for counting or summarizing records as they’re processed. For example, suppose your job processed opportunity records. You could define a method in execute to aggregate totals of the opportunity amounts as they were processed.
If you don’t specify Database.Stateful, all static and instance member variables are set back to their original values.
#copied #Salesforce_Apex_Developer_Guide
Is there any specific answer you are seeking for? Please ask.
-
Sudhir
MemberJuly 6, 2017 at 7:53 am in reply to: Following error when run apex code in eclipse [{"message":"The HTTP entity body is required, but this request has no entity body.","errorCode":"JSON_PARSER_ERROR"}]At least mention the apex code you are using.
From error message, it says that the body is required in your httprequest.
Set the body and try again.
-
Sudhir
MemberJuly 5, 2017 at 2:52 pm in reply to: How to query email and images from feedItems in case object?Query like:
select Id, Body, isRichText, Title, Type from CaseFeed where ParentId = '50090000008cXoS'
where
If Type = ContentPost, then it is an attachment. Then check for ContentType of the file
if(contenttype =='image/jpeg' || contenttype=='image/png' || contenttype=='image/gif' || contenttype=='image/jpg' ){ ... }
If isRichText = True, parse the body to check for email ids.
-
This worked for me. Could you retry.
-
Sudhir
MemberJuly 5, 2017 at 2:05 pm in reply to: Salesforce Streaming API some time's are not working in the ProductionAs you highlighted, did you check if you are reaching the Streaming API LIMITATIONS or the current count.
-
Sudhir
MemberJuly 5, 2017 at 1:18 pm in reply to: count number of unique email addresses on child records(contact) in SalesforceIs this still the issue? or you solved it?
-
Sudhir
MemberJuly 5, 2017 at 1:09 pm in reply to: how we can insert casefeed of one case to another case through coding???ParentId on CaseFeed is not writable.
If you look at the CaseFeed attributes, you can find that it is queryable: true but not createable: false, updateable: false etc.
Attributes are:
activateable: false
compactLayoutable: false
createable: false
custom: false
customSetting: false
deletable: true
deprecatedAndHidden: false
feedEnabled: false
hasSubtypes: false
idEnabled: true
isSubtype: false
keyPrefix:
label: Case Feed
labelPlural: Case Feed
layoutable: false
mergeable: false
mruEnabled: false
name: CaseFeed
networkScopeFieldName:
queryable: true
replicateable: true
retrieveable: true
searchable: false
undeletable: false
updateable: false -
Sudhir
MemberJuly 5, 2017 at 12:28 pm in reply to: What is the relationship between Account and Contact?(Explain)It is a lookup relationship. You can create Contacts without any reference to any Account.
The answer lies in the differences between Master-Detail and Lookup.
But in terms of Cascade delete, it behaves like master-detail; meaning when you delete an Account, the related contacts are deleted.
In a standard way, the OWD of Contact is Controlled by its Parent which is Account.
So you say that: at record creation level, it behaves like a lookup; but at sharing/owd level, its Master-Detail.
-
Sudhir
MemberJuly 5, 2017 at 12:24 pm in reply to: How can i get the owner Name of account object by DML and put at the outputfield of visualForce Page?Check this: ShowAccountOwnerName_Page_Controller
-
Sudhir
MemberJuly 5, 2017 at 10:58 am in reply to: How can i get the owner Name of account object by DML and put at the outputfield of visualForce Page?Check this one: ShowAccountOwnerName_page
Examle:
https://<salesforce_base_url>/apex/ShowAccountOwnerName_page?Id=<Account SFDC Id>
-
Sudhir
MemberJuly 5, 2017 at 10:47 am in reply to: Why we have to delete all records before creating a Master Detail relationship in a Master?Simply because the master-detail relationship mandates that for a child to exist, the master must exist.
All the existing child record must be first associated with their parent in order to convert lookup to master-detail.
-
Sudhir
MemberJuly 5, 2017 at 10:43 am in reply to: Can we create many to many relationship using lookup field in Salesforce Junction Object?Differences like in case of lookup:
1.The child record could exist independently.
2. No cascade delete.
3. Independent OWD/Ownership
-
Sudhir
MemberJuly 5, 2017 at 9:33 am in reply to: How can i get the owner Name of account object by DML and put at the outputfield of visualForce Page?Your question title seems vague.
So looking at your code snippet, it appears that the question is: to display Account Owner name on the VF page.
Is this the question ?
-
Sudhir
MemberJuly 5, 2017 at 9:28 am in reply to: Why to avoid using Workflow rule and Process Builder field update with Trigger?It's been explained clearly here: Why to avoid using Workflow rule and Process Builder field update with Trigger
-
When you wanted to display some custom messages to the current VF page context using some validation logic in controller, you use addMessage. Using this, you can show different Severity level (CONFIRM, ERROR, FATAL, INFO, WARNING) message.
If you wanted to prevent some DML operation under trigger context and display some custom error message, you use addError on a record or a field.