Mohit Agarwal
IndividualForum Replies Created
-
Mohit
MemberAugust 30, 2016 at 10:51 am in reply to: How can I active two assignment rule on a particular object?Hi Pranav,
According to the salesforce documentation :
Assignment rules automate lead generation and support processes for an organization.
There are types of a assignment rules:
Lead Assignment Rule :-Specify how leads are assigned to users or queues as they are created manually, captured from the web, or imported via the Data Import Wizard.
Case Assignment Rule :- Determine how cases are assigned to users or put into queues as they are created manually.
In Your Org there can we one Assignement rule active on particular Sobject
-
Mohit
MemberAugust 30, 2016 at 8:40 am in reply to: How can trigger is used for bulkifying records in Salesforce?Hi Pranav,
Bulkifying Apex code refers to the concept of making sure the code properly handles more than one record at a time.
Originally , Trigger or method that ordinarily only receives a single record as input, will receive a hundred - to run correctly in this context (and others) it should be written to handle multiple records.When a batch of records initiate Apex, a single instance of that Apex code is executed, but it needs to handle all of the records in that given batch. So if a batch of records invokes the the same Apex code, all of those records need to be processed as a bulk, in order to write scalable code and avoid hitting governor limits.
Here is the Example:-
trigger accountTestTrggr on Account (before insert, before update) {
List<String> accountNames = new List<String>{};
for(Account a: Trigger.new){
a.Description = a.Name + ':' + a.BillingState
}
}If this trigger is invoked with a single Account or up to 200 Accounts, all records will be properly processed.
-
Mohit
MemberAugust 26, 2016 at 1:29 pm in reply to: How to get a beep sound in Salesforce Visualforce Page?Hi Tanu,
You do this by using Javascript . You'll need to embed a short WAV file in the HTML, and then play that via code.
<script>
function BeepSound(soundObj) {
var sound = document.getElementById(soundObj);
sound.Play();
}
</script><embed src="success.wav" autostart="false" width="0" height="0" id="sound1"
enablejavascript="true">And then you can call this javascript method from Visualforce page like:
<apex:commandLink value="Beep Button" onclick="BeepSound(Sound1)" />
-
Mohit
MemberAugust 26, 2016 at 12:41 pm in reply to: How can I append the video id in the url of videolink in Salesforce?Hi Pranav,
Here is the code,
String PagevideoUrl{get;set}
String VideoUrl = 'https://www.youtube.com/watch?v=B6LULidOdA0';
String VideoId = VideoUrl.substringAfter('?v=');
PagevideoUrl = 'https://www.youtube.com/watch?'+VideoId;
And use this PagevideoUrl on the Visualforce Page
-
Mohit
MemberAugust 26, 2016 at 10:36 am in reply to: How to apply uniqueness on Junction object in Salesforce?Hi Tanu,
Create a text field of (External Id, Unique) on the junction object.
Create a workflow on C to fire Everytime the record is created or edited (to account for cases where junction object records are reparented) to set this field as the concatenation of the Ids of A and B records that the C record is relating.
This workflow trying to set the composite primary key field will generate an error if a duplicate record is being inserted.
You can add to the composite key to include any other uniqueness criteria such as relationship type if you have that notion.
The workflow will fire only for new records created, you will need to retrospectively populate for already existing records possibly by extracting and concatenation via data loader, or simply do a phantom update on the junction records and that should cause the workflow to fire and set the key. However this could also throw some errors for any existing duplicates which you may need to resolve manually.
-
Mohit
MemberAugust 26, 2016 at 10:22 am in reply to: How to hide standard field when it has a particular value?Hi Pranav,
You can solve this issue by do configuration.
1)Create one record type for each possible phase,
2)Restrict picklist values based on the record type.
You can then use workflow rules to change record types when the status changes.
-
Mohit
MemberAugust 11, 2016 at 9:16 am in reply to: How can we replace action function by a command button?Hey Suyash,
I have stuck in a scenario in which I am getting a list of command link in which on the click of the link the action function get call but I need that when I click on the command link then button and name is shown in different column of page and then after the click on that button the action function get called.
-
Mohit
MemberAugust 10, 2016 at 2:52 pm in reply to: How can be pass the picklist value in trigger of a sobject?Hi Suyash,
Is it possible that we can alter the standard picklist field value on the fire of trigger?
-
Mohit
MemberAugust 10, 2016 at 1:40 pm in reply to: Why can't we use the app name in the prefix of any object name in the test class?Hi Friends
There is change in question:
How can I retrieve the namespace Dynamically on prefer custom object?
-
Mohit
MemberJuly 29, 2016 at 1:19 pm in reply to: If we want to show the home page component on the particular sobject page?Correction in Question :
How can we show the Home page component on Particular Sobject Id ?