-
ChatterFeed
-
142Best Answers
-
0Likes Received
-
1Likes Given
-
22Questions
-
997Replies
How to check Accessibility of merge field
'Schema.sObjectType.Contact.fields.Account.Name.isAccessible()'
using above code trying to check the Accessibility of Merge field "Account.Name" in Contact object but getting Error that Account is not a field in Contact.
"Compile Error: account is not a field of Contact ".
How to resolve this issue??
Thanks
- Shephali Swarnkar
- December 23, 2015
- Like
- 0
- Continue reading or reply
How to get default Prepopulate Fields on a Standard Edit page
I want to Prepopulate Fields on a Standard Edit page. How we can do that ?
Every time display only default value for any appointment like " SRManagement " for Organization.
then i tried using custom button through url. It looks like working but getting some error like
Standard button url is: /a03/e?CF00N1a000006x8Xb=Gloria+Hejduk&CF00N1a000006x8Xb_lkid=a021a000003HpXA&retURL=%2Fapex%2FPatientView%3Fid%3Da021a000003HpXA%26sfdc.override%3D1.
My custom button url like this: /a03/e?CF00N1a000006x8Xb={!Patient__c.Name}&CF00N1a000006x8Xb_lkid={!Patient__c.Id}&CF00N1a0000077UQp=SRManagement&retURL=%2Fapex%2FPatientView%3Fid%3D{!Patient__c.Id}%26sfdc.override%3D1.
Please help me with appropriate solution.
I appriciate your response.
Thank you.
Rakesh.S
- Rakesh S
- October 15, 2015
- Like
- 0
- Continue reading or reply
How to create bulk Leads(say 100) Leads at a time ?
Our need is to create almost 100 leads taking data from our custom object (Operation__c) of our previous clients on a particular condition at a time along with that a single email and a text message should go to each lead.
I have created one schedulable class which takes required data from Operation__c(Query on operation) of our previous clients and I am inserting leads through this schedulable class and the control then enter into our Lead creation trigger.
It works fine for 10 records creation but on 11th it hits the governer limits and throws a DML exception "TO Many SOQL Queries:101" which is quite obvious because as my single lead creation hits 10 queries(inside my lead creation)....indeed in a single transaction for 11 records creation 11records * 10queries(More than 100)...EXCEPTION.
Now my question is how can I create bulk leads for my existing clients ?
- BMC Group
- July 30, 2015
- Like
- 0
- Continue reading or reply
How to create a "Related to" picklist lookup field
Step1: Picklist with the Objects
Step2: On select of any one object, need to display all related records
Give me quick suggestion.
Thakns Niraj
- Niraj Kr Singh
- July 30, 2015
- Like
- 1
- Continue reading or reply
create sidebar in visualforce page
How can i create sidebar in VF page. please anyone help me.
- Sami Shakith
- July 30, 2015
- Like
- 0
- Continue reading or reply
Getting SOQL results into MAP
[SELECT name, profile.name, email, isActive from User where UserRoleId in (SELECT ID from UserRole WHERE name in ('CEO','COO','ALC Midwest','ALC Southwest'))];
Now each role may have more than one users.
So, My requirement is that I want a map with key = UserRoleID and value = list of all users under that role.
So is it possible to do this without looping the above query's result and then putting values into map
Or some GROUP BY clause (or something else) can help me do this efficiently..
If nothing is possible and only looping is the only way then please provide an efficient and optimized code than the normal one-by-one row looping.
Help me its urgent
- Ayan Sarkar
- July 23, 2015
- Like
- 0
- Continue reading or reply
Dynamic Visualforce apex:inputText addition
I am trying to add the fields <apex:inputText> Dynamically
i have got the code in Html (http://jsfiddle.net/YE5vF/2/) But unable to get this code in Visual force page Any body please help me over here. I have used this script even it is not working below is the code i have used. how to use those html components in salesforce VFPAGE.
<apex:page sidebar="false" StandardController="Account" standardstylesheets="false" rendered="true" docType="html-5.0"> <script type="text/javascript">//<![CDATA[ $(window).load(function(){ $("[id$=day]").change(function() { var total = 0; $('.timesheet2 input').each(function() { total = total + Number( $(this).val() ); }); $('div#total_amount').html(total); }); });//]]> </script> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/> </apex:pageBlockButtons> <table id="newspaper-b" border="" width="100%"> <thead> <tr> <td>Value1</td> <td>Value2</td> <td>Adding Value</td> </tr> </thead> <tr> <td><apex:inputText style="width:60px;height:20px"/></td> <td><apex:inputText style="width:60px;height:20px"/></td> <td><apex:inputText style="width:60px;height:20px"/></td> </tr> <tr> <td><apex:inputText style="width:60px;height:20px"/></td> <td><apex:inputText style="width:60px;height:20px"/></td> <td><apex:inputText style="width:60px;height:20px"/></td> </tr> <tr> <td><apex:inputText style="width:60px;height:20px"/></td> <td><apex:inputText style="width:60px;height:20px"/></td> <td><apex:inputText style="width:60px;height:20px"/></td> </tr> </table> </apex:pageBlock> </apex:form> </apex:page>
Need Exact output , How to configure the above mentioned JS fiddle code in Visualforce page
Thanks & regards,
Mounika
- RohithaSfdc
- July 17, 2015
- Like
- 0
- Continue reading or reply
How to assign a custom VF page only to community user not others.
Hi All,
I am working on a community setup. Where I had to create a custom VF page for a custom object, say 'C1' .
Now I need to show this custom vf page layout to only partner account, they should not allow to see standard page layout.
But internal user in organization allow to see stndard page layout only.
Please sugges how can i achive this ?
Thanks,
Shiv
- shiv@SFDC
- July 17, 2015
- Like
- 0
- Continue reading or reply
Custom button and a formula
Hello,
I have a question, I am making a custom button which need to generate data from certain formula and after that put the data in given field, the formula was the easy pars, and as I am new to salesforce, I can't get a way to put the data into the given field, I am having this formula code:
{!PayedSum__c.Payed_Sum__c} = {!Account.Compensation_Sum__c} - {!Account.Payed_Compensation_Sum__c} AND {!PayedSum__c.Payed_Date__c} = {!TODAY()}
As you can see from the code I need to put the data in sObject PayedSum__c field Payed_Sum__c, can someone help me how to put the result from this formula into the Payed_Sum__c field ?
Thank you in advance,
Bozidar
- Tucko
- June 02, 2015
- Like
- 0
- Continue reading or reply
Triggering a workflow when Lead is added to a Campaign
Campaign.Name = 'Soccer' &&
ISPICKVAL(Campaign.Status, 'Joined')
I activated the rule, but it is not firing.
I have tried different rule criteria, such as CampaignId='701U0000000xMD3', and have tried using Campaign Member as the rule object, but that won't work because I need to update field on Lead.
Does this require an Apex trigger to work? I am not a coder...
Thanks for any help!
Meli
- Melisande Perron
- May 27, 2015
- Like
- 0
- Continue reading or reply
Testing Save and New Extension
I need a small hand with testing the new bit of code that I have added to my extension. I feel like I am one line of code away from passing, i have just never tested for a save and new, so I am not sure on how to do this. The extension already saves, cancels and clones (and passes 100%). The save and new fucntion was jsut added and I was hoping I could get a small hand in testing for it. The newly added bits will be highlighted:
public class extSaveSerButton {
public Service__c ser {get;set;}
public extSaveSerButton(ApexPages.StandardController controller) {
this.ser = (Service__c)controller.getRecord();
}
Public PageReference saveDestinyService(){
if(System.currentPageReference().getParameters().get('clone') == '1'){
//Set record id to null
ser.Id = null;
}
insert ser;
// Send the user to the detail page for the new account.
PageReference pageRef= new PageReference('/apex/DestinyAccount?id='+ser.account__c+'&Sfdc.override=1');
pageRef.getParameters().put('tab','Destiny Services');
return pageRef;
}
Public PageReference saveNewDestinyService(){
insert ser;
// Send the user to the detail page for the new account.
PageReference pageRef= new PageReference('/a0I/e');
return pageRef;
}
Public PageReference cancelDestinyService(){
PageReference pageRef = new PageReference('/apex/DestinyAccount?id='+ser.account__c+'&Sfdc.override=1');
pageRef.getParameters().put('tab','Destiny Services');
return pageRef;
}
}
test:
static testMethod void TestExtSaveSerButton(){
Account acc = new Account(Name = 'Test Ser Account');
insert acc;
//Now lets create Destiny Products record that will be reference for the Standard Account
Service__c serTest = new Service__c(Account__c = acc.id);
//call the apepages stad controller
Apexpages.Standardcontroller stdSer = new Apexpages.Standardcontroller(serTest);
ApexPages.currentPage().getParameters().put('clone', '1');
//now call the class and reference the standardcontroller in the class.
extSaveSerButton extSer = new extSaveSerButton(stdSer);
//call the pageReference in the class.
extSer.saveDestinyService();
extSer.saveNewDestinyService();
extser.cancelDestinyService();
Thank you for your time.
- Developer.mikie.Apex.Student
- February 03, 2014
- Like
- 0
- Continue reading or reply
Help writing Test code for trigger
An account with Jane and Ben samol would be called: Samol, Jane and Samol, Ben
This is my test code:
@isTest
private class TestAccountNameTrigger {
static testMethod void validateAccountNameTrigger() {
//create test data
Account a = new Account(Name='test');
insert a;
Contact C = new Contact(FirstName='test1',lastName='test2', accountid = a.Id);
insert c;
// Retrieve data
a = [Select ID, Name From Account WHERE ID = a.Id];
System.debug('Value after trigger fired: ' + a.name);
// Test that the trigger correctly updated the name
System.assertEquals('test2, test1',a.name);
}
}
This is my trigger:
trigger AccountNameTrigger on Contact (after insert,after update, after delete, after undelete) {
Set<ID> setAccountIDs = new Set<ID>();
if(trigger.isdelete)
{
for(Contact c : Trigger.old)
{
setAccountIds.add(c.Accountid);
}
}else
{
for(Contact c : Trigger.new){
setAccountIDs.add(c.AccountId);
}
List<Account> accounts = [Select ID, Name,(Select FirstName, LastName From Contacts) From Account WHERE ID IN :setAccountIDs];
for(Account a : accounts){
String accName = '';
Boolean hit = false;
for(Contact c : a.Contacts){
if(hit)
{
accName+=' and ';
}
accName += c.LastName+', '+c.FirstName;
hit = true;
}
a.Name=accName;
}
update accounts;
}
}
- Developer.mikie.Apex.Student
- February 03, 2014
- Like
- 0
- Continue reading or reply
What is Test code in apex?explain one example
really i am stuck with these apex test codes..
Kindly help ....
- wixxey
- April 08, 2013
- Like
- 0
- Continue reading or reply
how to hide image depends upon Profiles
Iam trying to hide flag iamge for some profiles and visible to some profiles in visualforce page
i really appreciate if any one can help me
Thanks,
Abhi
- Abhirams470
- April 05, 2013
- Like
- 0
- Continue reading or reply
Assign Value To Controller From Javascript Without ActionFunction
Hi,
This is a very unusual requirement I know and may not be possible but I thought I'd put it out there all to same to confirm.
- I require to use Javascript Remoting to perform a particular requirement in my Force.com site. With this (and if this was possible it would be ideal) I would like to assign the result returned from the remoting funciton to a variable in my controller.
I know an actionFunction can be used for this but I require to do this without an actionFunction and directly from my Javascript.
Can this be done or is it impossible? Can the actionFunction be replicated in Javascript?
Thanks in advance for any help on this and I know it's a very unusual scenario!
- SalesRed
- April 03, 2013
- Like
- 0
- Continue reading or reply
Need help with help bubble on VF page
Hi ,
I am trying to get help bubble in VF page.
Helptext attribute is working fine but its not working if i say showheader=false.
How can i solve this.I dont want the header...
Sample code:
This is working fine:
<apex:page standardcontroller="Account"> //// I should say showheader=false
<apex:form >
<apex:pageblock title="" id="pageBlock">
<apex:pageblockbuttons location="top"/>
<apex:pageblocksectionitem helptext="Enter Account Name">
<apex:outputlabel value="Name : "/>
<apex:inputfield value="{!Account.Name}"/>
</apex:pageblocksectionitem>
</apex:pageblocksection>
</apex:pageBlock>
</apex:form>
</apex:page>
- Linda 98
- March 28, 2013
- Like
- 0
- Continue reading or reply
INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call
Can somebody help me with the code m constanly getting this error
global class CreateQoDelivery implements Database.Batchable<sObject>, Schedulable { public String Query; global CreateQoDelivery(){ String ProjectQuery = 'Select Id,Name,Dev_Lead_User__c,Project_Start_Date_original_baseline__c,Project_End_Date_original_baseline__c,Project_Start_Date_current_baseline__c,Project_End_Date_current_baseline__c,Project_Start_Date_actual__c,Project_End_Date_actual__c,Project_TQL_Phase__c,Project_State__c from Project__c where Overall_Project_Status__c NOT IN (\'Not Started\',\'On hold\') AND Project_TQL_Phase__c !=\'1. Kick-off\' AND Project_State__c IN(\'Active\')'; this.Query=ProjectQuery; } global Database.QueryLocator start(Database.BatchableContext BC){ return Database.getQueryLocator(Query); } global void execute(Database.BatchableContext BC, List<SObject> scope){ List<Project__c> ProjectList =(Project__c[]) scope; List< Quality_of_Delivery__c> detailList = new List< Quality_of_Delivery__c>(); // to insert the record List< Quality_of_Delivery__c> detailListUpdate = new List< Quality_of_Delivery__c>(); // to upsert the record for(Project__c prj : ProjectList){ Quality_of_Delivery__c qodDel = new Quality_of_Delivery__c (); List< Quality_of_Delivery__c> LstRecord = new List< Quality_of_Delivery__c>();// new line lstRecord=[Select CDN__c,Working_Days_to_get_ROM__c,Slow_score__c,PageSpeed_score__c,Number_of_Change_Requests__c,Planned_Cost_current_baseline__c,Planned_Cost_original_baseline__c,Actual_Cost__c,Planned_Scope_originale_baseline__c,Planned_Scope_current_baseline__c,Actual_Scope__c,SIT_defects__c,Minor_UAT_Defects_TA__c,Minor_UAT_Defects_All__c,Major_UAT_Defects_TA__c,Major_UAT_Defects_All__c,Hypercare_Defects_All__c,Hypercare_Defects_TA__c,P_S_Compliance_after_Hypercare__c,P_S_Compliance_as_Launch__c from Quality_of_Delivery__C where Project__c=:Prj.id order by createdDate desc limit 1]; // checking the record in project… if (lstrecord!=null){ // if there a record in the list then copy the field values and creates a new record for(Quality_of_Delivery__c q:lstRecord){ qodDel.Project__c=prj.Id; date currentDate = Date.today(); Integer CurrentMonth = currentDate.month(); Integer Currentyear=currentDate.year(); qodDel.Date__c = System.Today()-1; qodDel.CDN__c = q.CDN__c; //copying values for all the below fields from the latest created Record.. qodDel.Working_Days_to_get_ROM__c = q.Working_Days_to_get_ROM__c; qodDel.Slow_score__c = q.Slow_score__c; qodDel.PageSpeed_score__c = q.PageSpeed_score__c; qodDel.Number_of_Change_Requests__c = q.Number_of_Change_Requests__c; qodDel.Planned_Cost_current_baseline__c = q.Planned_Cost_current_baseline__c; qodDel.Planned_Cost_original_baseline__c = q.Planned_Cost_original_baseline__c; qodDel.Actual_Cost__c = q.Actual_Cost__c; qodDel.Planned_Scope_originale_baseline__c = q.Planned_Scope_originale_baseline__c; qodDel.Planned_Scope_current_baseline__c = q.Planned_Scope_current_baseline__c; qodDel.Actual_Scope__c = q.Actual_Scope__c; qodDel.SIT_defects__c = q.SIT_defects__c; qodDel.Minor_UAT_Defects_TA__c = q.Minor_UAT_Defects_TA__c; qodDel.Minor_UAT_Defects_All__c = q.Minor_UAT_Defects_All__c; qodDel.Major_UAT_Defects_TA__c = q.Major_UAT_Defects_TA__c; qodDel.Major_UAT_Defects_All__c = q.Major_UAT_Defects_All__c; qodDel.Hypercare_Defects_All__c = q.Hypercare_Defects_All__c; qodDel.Hypercare_Defects_TA__c = q.Hypercare_Defects_TA__c; qodDel.P_S_Compliance_after_Hypercare__c = q.P_S_Compliance_after_Hypercare__c; qodDel.P_S_Compliance_as_Launch__c = q.P_S_Compliance_as_Launch__c; qodDel.Apex_Context__c=true; // used to bypass validation rule on the record if(CurrentMonth==1){ // used for naming the record qodDel.Name=prj.Name+' - '+String.valueof(Currentyear-1)+'-'+String.valueof(CurrentMonth+11); } else if(CurrentMonth==11 || CurrentMonth==12) { qodDel.Name=prj.Name+' - '+String.valueof(Currentyear)+'-'+String.valueof(CurrentMonth-1); } else{ qodDel.Name=prj.Name+' - '+String.valueof(Currentyear)+'-'+'0'+String.valueof(CurrentMonth-1); } qodDel.Dev_Lead__c=prj.Dev_Lead_User__c; // lookup to user qodDel.Approved_Status__c ='Pending input from Dev Specialist'; if(prj.Project_Start_Date_original_baseline__c!=null && prj.Project_End_Date_original_baseline__c!=null) { qodDel.Planned_Working_Days_Original_baseline__c= prj.Project_Start_Date_original_baseline__c.daysBetween(prj.Project_End_Date_original_baseline__c); } else { qodDel.Planned_Working_Days_Original_baseline__c=0; } if(prj.Project_Start_Date_current_baseline__c!=null && prj.Project_End_Date_current_baseline__c!=null) { qodDel.Planned_Working_Days_current_baseline__c=prj.Project_Start_Date_current_baseline__c.daysBetween(prj.Project_End_Date_current_baseline__c); } else { qodDel.Planned_Working_Days_current_baseline__c=0; } if(prj.Project_Start_Date_actual__c!=null && prj.Project_End_Date_actual__c !=null) { qodDel.Actual_Working_Days__c = prj.Project_Start_Date_actual__c.daysBetween(prj.Project_End_Date_actual__c); } else { qodDel.Actual_Working_Days__c=0; } detailListUpdate.add(qodDel); insert detailListUpdate; } } else // if there is no record in the list of Qod then creates a new record in Project { date currentDate = Date.today(); Integer CurrentMonth = currentDate.month(); Integer Currentyear=currentDate.year(); qodDel.Date__c = System.Today()-1; qodDel.Project__c=prj.Id; // Id of the parent Record if(CurrentMonth==1){ qodDel.Name=prj.Name+' - '+String.valueof(Currentyear-1)+'-'+String.valueof(CurrentMonth+11); } else if(CurrentMonth==11 || CurrentMonth==12) { qodDel.Name=prj.Name+' - '+String.valueof(Currentyear)+'-'+String.valueof(CurrentMonth-1); } else{ qodDel.Name=prj.Name+' - '+String.valueof(Currentyear)+'-'+'0'+String.valueof(CurrentMonth-1); } qodDel.Dev_Lead__c=prj.Dev_Lead_User__c; qodDel.Number_of_Change_Requests__c =0; qodDel.Approved_Status__c ='Pending input from Dev Specialist'; if(prj.Project_Start_Date_original_baseline__c!=null && prj.Project_End_Date_original_baseline__c!=null) { qodDel.Planned_Working_Days_Original_baseline__c= prj.Project_Start_Date_original_baseline__c.daysBetween(prj.Project_End_Date_original_baseline__c); } else { qodDel.Planned_Working_Days_Original_baseline__c=0; } if(prj.Project_Start_Date_current_baseline__c!=null && prj.Project_End_Date_current_baseline__c!=null) { qodDel.Planned_Working_Days_current_baseline__c=prj.Project_Start_Date_current_baseline__c.daysBetween(prj.Project_End_Date_current_baseline__c); } else { qodDel.Planned_Working_Days_current_baseline__c=0; } if(prj.Project_Start_Date_actual__c!=null && prj.Project_End_Date_actual__c !=null) { qodDel.Actual_Working_Days__c = prj.Project_Start_Date_actual__c.daysBetween(prj.Project_End_Date_actual__c); } else { qodDel.Actual_Working_Days__c=0; } detailList.add(qodDel); insert detailList; } } } global void finish(Database.BatchableContext BC){ } //Execute batch class with default constructor from schedular global void execute(SchedulableContext sc) { try { database.executeBatch(new CreateQoDelivery()); } catch (Exception e) { System.debug('There are no jobs currently scheduled. ' + e.getMessage()); } } }
thanks in advance
- Irish@acc.com
- March 28, 2013
- Like
- 0
- Continue reading or reply
Trigger to monitor field updates
Hello. I have created a trigger to minotor if certain fields are updated in a custom object. If the field is updated it creates a record in another custom object. Below is the code:
trigger CheckFieldUpdate on Obj1__c (before update) { List<Obj1__c> stores = trigger.new; List<Obj2__c> tasks = new List<Obj2__c>(); for(Obj1__c s : stores){ if(s.Field1__c <> trigger.oldMap.get(s.id).Field1__c) { Obj2__c tsk = new Obj2__c( Company__c = s.id, Name = 'Changed Field1 from "'+ trigger.oldMap.get(s.id).Field1__c +'" to ' + '"' + s.Field2__c + '"' ); tasks.add(tsk); } if(s.name <> trigger.oldMap.get(s.id).name) { Obj2__c tsk = new Obj2__c( Company__c = s.id, Name = 'Changed Field2 from "'+ trigger.oldMap.get(s.id).Field2__c +'" to ' + '"' + s.Field2__c + '"' ); tasks.add(tsk); } if (!tasks.isEmpty()) { insert tasks; } }
The code above only checks for 2 fields. What if there are more fields that i need to check, i'm wondering if there is a way to accomplish this in more efficient manner? Is it possible to create a loop to go though a list of fields?
Thanks.
- David S
- March 25, 2013
- Like
- 0
- Continue reading or reply
Render fields based on picklist value
Any help would be appreciated. I'm trying to get a field to render based on a picklist value seleciton but I can't seem to get it to work. Here's my VF code (I'm not using a controller).
<apex:page standardController="Opportunity">
<apex:form >
<apex:pageBlock id="thePageBlock">
<apex:pageBlockSection columns="2">
<apex:inputfield value="{!Opportunity.Type}" id="Type">
<apex:actionSupport event="onchange"
rerender="ProdFamilyModel"/>
</apex:inputfield>
<apex:inputfield value="{!Opportunity.Fiscal_Booking_Date__c}"/>
</apex:pageBlockSection>
<apex:outputPanel id="ProdFamilyModel" rendered="{!IF(Opportunity.Type != 'Test', true, false)}">
<apex:pageBlockSection columns="2" id="ProdFamily">
<apex:inputfield value="{!Opportunity.Product_Family__c}"/>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>
What am I doing wrong?
- Curious Force
- March 25, 2013
- Like
- 0
- Continue reading or reply
Custom Controller
When I creat a custom controller and the code experience an error, the codes are reverted back to last working code.
Do we have a setting for keeping the codes intact during error.
- SanjayS
- March 25, 2013
- Like
- 0
- Continue reading or reply
Know Contact's User Type on Contact Level
Thanks
- Rahul Sharma
- February 17, 2016
- Like
- 0
- Continue reading or reply
Custom Service Console Component: Getting Primary Tab's Object Id on page reload
Currently I am working on Service Console and have created a custom Visualforce component where in we are displaying some information related to the record in Primary tab.
This component is being added to the console app and is launched by a Button (which is a standard functionality).
I am able to display the record's information in the page, whenever a user switches through the primary tab (using sforce.console.onFocusedPrimaryTab method from the Salesforce Console Integration Toolkit (https://resources.docs.salesforce.com/198/latest/en-us/sfdc/pdf/api_console.pdf" target="_blank)).
When a user keeps the console components open and refreshes the page, it looses the data as I did not find any method in toolkit using which I can get the primary tab's Object Id on page load.
Is there any way to bind the page refresh or reload event with the Console component?
Thanks for your time!
- Rahul Sharma
- February 04, 2016
- Like
- 0
- Continue reading or reply
Multilingual translation for standard fields
We can override the translation for Standard and lookup fields from translation workbench(export the translation files, make a change and import it back again) and can override the labels from Rename Tabs and Labels in setup for english language.
But I didn't get any option to override the language for standard fields, tabs and lookup field labels.
- Rahul Sharma
- December 31, 2016
- Like
- 0
- Continue reading or reply
Notify Case team member on post to Case record in chatter
I need to notify Case team members when there is a post to Case record in chatter.
Notification for those user works who are mentioned in a post but not otherwise.
I tried auto following case record in chatter when a new team member is added, which didn't worked as well.
This requirement seems very generic, would be good to know if there is any OOTB functionality for it.
- Rahul Sharma
- June 16, 2015
- Like
- 0
- Continue reading or reply
Provide edit access to Partner's records!
I am working on Salesforce community but facing some issues with providing access related to partners.
Have configured all the settings in profiles and now partners are able to see their data(Account and Related Contacts & Other object records). But I am not able to give the edit permissions to them to those records.
To add- OWD setting is Private and owner of the Account is System administrator.
Please let me know what could be done to provide edit access to partner's record.
Thanks,
Rahul
- Rahul Sharma
- November 04, 2014
- Like
- 0
- Continue reading or reply
Event Trigger is not fired when it passes the Activity Date?
Hello Board,
Task has Status field, by marking it as Completed the Task is closed(Manually by a user). But for Event there is no such field, It closes automatically as the Event's end date surpases.
I have created a Trigger on Event which should work as soon as Activity closes. I had add a check to see if the date is less that the Event.EndDateTime.
I want the trigger to fire as soon as the Event is closed. Is there any option for doing the same?
Thanks for your time and help.
- Rahul Sharma
- June 13, 2013
- Like
- 0
- Continue reading or reply
Adding custom button in Console Page to launch visualforce page
Hello All,
I am facing hard time in adding a button in Console Tab(By that I mean to add a button in Console page, Not service Console). Button's functionality is just to launch a visualforce page.
When a button is added in Service console, it provide an awesome behaviour, just like Facebook or Salesforce chat. And on click of custom console button, page open as nice small popup.
But now I want the button to be added in Console Page(Even if it could launch a page instead of service console behaviour, It would work for me).
Please let me know if any of you have encountered similar situation.
Thanks for your time!!
- Rahul Sharma
- April 02, 2013
- Like
- 0
- Continue reading or reply
Getting started with Salesforce Mobile Development
Hello All,
I want to start mobile development in salesforce and have good hold on apex and visualforce. But I don't have any knowledge of C or Java or .net.
So it would be great if you could share some pointers on how I can start learning mobile development.
Thanks for your time.
- Rahul Sharma
- March 26, 2013
- Like
- 0
- Continue reading or reply
Hide show a custom button in console view?
Hello Community,
I was wondering if we could hide/show custom buttons in console view/layout conditionally.
Did anybody ran into such requirement or have any ideas about it?
Thanks for your time.
- Rahul Sharma
- March 19, 2013
- Like
- 0
- Continue reading or reply
Programatically reading apex classes
Hello Board,
I am eager to know the best way by which we can parse Apex Class, for checking how many SOQL queries are in for loop.
- One of many ways is to fetch Class in text from ApexClass object then using string manipulation identify queries inside for loops. But queries inside methods or another class method would be very dificult to identify.
Please shed some lights on on better way to parse the Apex Class. Thanks all for your time.
- Rahul Sharma
- November 29, 2012
- Like
- 0
- Continue reading or reply
how can I send multiple request in a single http.send() method
Hello Support,
I am using below code for sending emails.I need to send bulk Email from Salesforce.but here I am facing Error with
Too many future calls: 11
Can you please let me know how can I send multiple request in a single http.send() method.
//send the email
@future (callout=true)
public static void SendElasticEmailBulk(String userName, String APIKey, String fromEmail,
String fromName, String subject,list<String> lstEmailWithMessage) {
Http http = new Http();
for(string strEmailMessage :lstEmailWithMessage){
string[] arrSplitResult = strEmailMessage.split('#',2);
HttpRequest req = new HttpRequest();
HTTPResponse res;
req.setEndpoint('https://api.elasticemail.com/mailer/send')
;
req.setMethod('POST');
try {
//Construct the data
String data = 'userName=' + userName;
data += '&api_key=' + APIKey;
data += '&from=' + fromEmail;
data += '&from_name=' + fromName;
data += '&subject=' + EncodingUtil.urlEncode(subject, 'UTF-8');
data += '&body_html=' + EncodingUtil.urlEncode(arrSplitResult[1], 'UTF-8');
data += '&reply_to='+Label.Inbound_Email;
data += '&to=' + arrSplitResult[0];//Email Address
req.setBody(data);
http.send(req);
}
catch(Exception e) {
Alert.Emailmessage('Error on Execption'+string.valueOf(e));
}
}
- Rahul Sharma
- June 30, 2012
- Like
- 0
- Continue reading or reply
Fetching the Probability and Stage Name mapping from salesforce Metadata
Hello Board,
I ran into a issue where in i overridden Opportunity New button with visualforce page.
Everything is working properly except the functionality where in Probability value is changed to a respective value on change of Stage Name in standard functionality.
I believe that the mapping of StageName with Probability must be stored somewhere in metadata but i'm failing to find the exact value.
Solution using a custom setting to store mapping externally does not looks best option as user would need doubly enter changes/new values.
Please share some thoughts on this issue and thanks for your time.
- Rahul Sharma
- June 26, 2012
- Like
- 0
- Continue reading or reply
System.TypeException: Cannot have more than 10 chunks in a single operation.
Hi Board,
I'm facing a issue in trigger where in i'm trying to perform a dml statement using List<sObject>.
It throws exception for me when i have more then 900 records in my list.
Error message is stated below:
System.TypeException: Cannot have more than 10 chunks in a single operation. Please rearrange the data to reduce chunking.
- Rahul Sharma
- April 13, 2012
- Like
- 0
- Continue reading or reply
Bug with integer field while using standard controller
Hello boards,
From last few days i ran into an issue, at start i thought its a issue with my application but later on realized its a behaviour of Integer field while using standard controller.
The example of what i'm trying to do is to display the fields in pageblocktable on click of a button using standard controller and extension.
Everything is working smoothly but only problem is with integer fields, even tough they contain null value it displays 0 in UI.
Below is small demo of the what i found:
Page:
<apex:page standardController="Account" extensions="stdAccCtrl"> <apex:form id="theForm"> <apex:pagemessages id="info"/> <apex:inputText value="{!Account.NumberOfEmployees}"/> <apex:commandButton action="{!Check}" value="Save" rerender="theForm"/> </apex:form> </apex:page>
Extension:
public class stdAccCtrl { public Account objAccount {get;set;} public stdAccCtrl(ApexPages.StandardController controller){ objAccount = (Account) controller.getRecord(); ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Employees : '+String.valueOf(objAccount.NumberOfEmployees))); } public void Check(){ ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Employees : '+String.valueOf(objAccount.NumberOfEmployees))); } }
I know its displaying 0 as a default for integer field but would like to know the reason in depth.
I would be happy is some one is able to shed some light on it.
- Rahul Sharma
- January 16, 2012
- Like
- 0
- Continue reading or reply
Update Rich text area field with image through code
Greetings board,
Is there a way by which we can update RTA field with image through code.
I'm aware about image can be inserted from local machine or by giving the web address but the problem is i want to update the RTA field through code.
I tried to debug the value stored in the RIA field after inserting the image in it.
system.debug([Select Image__c from account where id= '00190000007KFZr']); (Account:{Image__c=<img src="http://www.w3schools.com/images/compatible_firefox.gif" alt="Firefox"></img>})
It can be seen that RTA field contains image as HTML but if we update same field with HTML value from debug, then that html is displayed as text instead of image.
One solution is to have a text field to store URL and display image using IMAGE() function in another formula field, But as the RIch text area field supports Image and HTML there must be a way by which we could achieve this.
Please share your thoughts on this and thanks for your time.
- Rahul Sharma
- December 30, 2011
- Like
- 0
- Continue reading or reply
Displaying the list retrieved by remote function to a Page block table
Hi Board,
What i'm trying to do is to create a List of wrapper class in JS remote method and display it to page.
I'm passing multiple values from JS to Remote function as a parameter.
I have the list to be displayed in remote function, but the problem is i'm not able to store this list in any property( which is get set) so that i could display this to Page.
Even if i assign the created list to a property i get the value as null.
That might be due to the Remote method executes in a seperate instance.
Please point me some direction.
Thanks for your time.
- Rahul Sharma
- December 27, 2011
- Like
- 0
- Continue reading or reply
Best way to display a lookup field?
Hello board,
I would like to know whats the best way to display an input lookup field in a custom page.
I know if we want to show a account lookup, we can do it by using a contact object in controller and use objContact.AccountId as a input field in a page.
Thats works in case of lookup but in case of master detail it shows a outputfield if we try to prepopulate a master object.
Any ideas?
- Rahul Sharma
- December 01, 2011
- Like
- 0
- Continue reading or reply
Variable does not exists in javascript remoting method
Hello Guys,
I'm trying to use javascript remoting for my one of the requirement but facing a problem when i try to use the class variable inside the remoting method to set the value.
Code in controller i'm using is something like this:
global with sharing class MyJSController { public String strContactName { get; set; } @RemoteAction global static List<Account> getAccount(String accountName) { accountName += '%'; String str = 'select id, name, phone from Account where name like :accountName limit 1'; List<Account> lstAccount = database.query(str); if(!lstAccount.isEmpty()) { strContactName = [Select Id, LastName from Contact where AccountId =: lstAccount[0].Id limit 1].LastName; return lstAccount; } else return null; } }
JS code:
MyJSController.getAccount(buttonValue, function(result, event) { if(event.status) { alert('{!strContactName}'); } }
I just want to set a variable in the remote function which could be used in the Page.
Have anyone faced same issue or please suggest if there's any work around for this.
Thanks for you time.
- Rahul Sharma
- November 23, 2011
- Like
- 0
- Continue reading or reply
Image re-sizing using JavaScript or CSS
Hello techies,
I would like to know the best way to resize (Scale down) the image.
I tried with CSS and javascript function but i'm unable to find the best approach.
Since currently that methods are not much reliable as image gets distorted for most of them.
Any suggestions?
- Rahul Sharma
- November 14, 2011
- Like
- 0
- Continue reading or reply
javaScript ScaleImage function not working when showheader is set as false
Hello guys,
I'm facing with a weird problem,
I have a simple page to show a image using img tag, and i'm calling scaleImage javascript onload.
example:
<apex:page> <img id="imageId" src='http://freeimagesarchive.com/data/media/131/1_images.jpg' onload="javascript:scaleImage(this,70,250);" /> </apex:page>
but when i disable the header of the page using:
<apex:page showheader="false"> <img id="imageId" src='http://freeimagesarchive.com/data/media/131/1_images.jpg' onload="javascript:scaleImage(this,70,250);" /> </apex:page>
javascript:scaleImage(this,70,250);
Then its throwing error as : scaleImage is not defined
Please let me know if there's any workaround for this, i want to disable the page header and also use the ScaleImage function.
Thanks in advance!
- Rahul Sharma
- November 11, 2011
- Like
- 0
- Continue reading or reply
Trailhead challenge error: Our trailbots are having a problem accessing your hands-on org. Please try again and if this issue persists refer to this article to fix the problem.
- Su Wang 3
- January 05, 2017
- Like
- 0
- Continue reading or reply
" An internal server error has occurred" - While Assigning Apex Classes to Permission Sets
We are receiving an internal server error. when I go to (any) Permission Set, Apex Class Access then hit 'Edit' we are facing this issue. How can we overcome this, please assist.
Error: An internal server error has occurred An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. Thank you again for your patience and assistance. And thanks for using salesforce.com! Error ID: 1488824837-18844 (-1270687048)
- Krishna Rama
- October 17, 2016
- Like
- 0
- Continue reading or reply
Inline edit for Lookup field on a Visualforce page not working like standard page
I have a requirement for visualforce page with inline edit in a pageblocktable.This particular functionality is working fine for all scenarios except when a lookup field is inline edited.
When I use the undo button to clear out the value after filling in the lookup field, it throws an error 'Value does not meet filter criteria'. To get rid of this error I used rerender. I rerender the column with lookup field and I no longer faced the error.
However, due to the rerender, other values in the lookup field column also get changed inconsistently.
I think rerender row/cell wise might help solve this issue but I can't find a right way to do it.
Any help on this issue or alternate ways to tackle this issue will be highly appreciated.
Thank you in advance.
- Shambhavi Tambulwadkar 17
- September 12, 2016
- Like
- 0
- Continue reading or reply
visual force life cycle
Can any one briefly explain about VF life cycle and order of execution in detail
thanks for giving reply (In Advance)
Thanks and Regards
- prashanthi ch
- September 12, 2016
- Like
- 0
- Continue reading or reply
Java script is not working
i am using the external java script file from sttaicresource, according to the code when i click on the "try it " botton " A paragraph" line should be changed to "Paragraph changed." but when i click on the button iam not getting any change. Code is as follows,
VF code:
<apex:page >
<!--In case you uploaded just the file-->
<html>
<head>
<apex:includeScript value="{!URLFOR($Resource.jsss,'siva123.js')}"/>
</head>
<body>
<h1>External JavaScript</h1>
<p id="demo">A Paragraph.</p>
<button type="button" onclick="myFunction()">Try it</button>
<p><strong>Note:</strong> myFunction is stored in an external file called "myScript.js".</p>
</body>
</html>
JS file:
function myFunction() { document.getElementById("demo").innerHTML = "Paragraph changed."; }
Please any body suggest mr for this.
Regards,
Siva.
</apex:page>
- Ram Shiva Kumar
- September 12, 2016
- Like
- 0
- Continue reading or reply
Boot Strap Glyphicon s are not coming
<apex:page showHeader="false">
<html lang="en">
<head>
<!-- If you zip folder has subfolder for css -->
<link href="{!$Resource.sfdc}/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
<div class="container">
<h2>Glyphicon Examples</h2>
<p>Envelope icon: <span class="glyphicon glyphicon-envelope"></span></p>
<p>Envelope icon as a link:
<a href="#"><span class="glyphicon glyphicon-envelope"></span></a>
</p>
<p>Search icon: <span class="glyphicon glyphicon-search"></span></p>
<p>Search icon on a button:
<button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span> Search
</button>
</p>
<p>Search icon on a styled button:
<button type="button" class="btn btn-info">
<span class="glyphicon glyphicon-search"></span> Search
</button>
</p>
<p>Print icon: <span class="glyphicon glyphicon-print"></span></p>
<p>Print icon on a styled link button:
<a href="#" class="btn btn-success btn-lg">
<span class="glyphicon glyphicon-print"></span> Print
</a>
</p>
</div>
</body>
</html>
</apex:page>
Please any body suggest me how to use the Glyphicons in VF page from Boot strap.
Regards,
Siva.
- Ram Shiva Kumar
- September 10, 2016
- Like
- 0
- Continue reading or reply
Developer Edition Issues
I'm going through the Trailhead quizzes, and I've come to the ones that say "Connect to your Developer Edition" in order to complete the quiz. I have a Developer Edition account set up, but when I try to access it through Trailhead it gives me this message: "Houston, we have a problem... you are attempting to log into Trailhead to complete challenges with an org that isn't supported. When you are completing Trailhead hands-on challenges, you cannot use a production or sandbox org...." Anways, I'm not sure how to complete the quizzes. (They are under Learn CRM Essentials) . I am on bootcamp next week and need to complete the badges.
- Lee Heather
- March 04, 2016
- Like
- 0
- Continue reading or reply
List index out of bound 1 error
String userId = leadUsrStr.split('_')[1];
- shravani mil
- March 04, 2016
- Like
- 0
- Continue reading or reply
Know Contact's User Type on Contact Level
Thanks
- Rahul Sharma
- February 17, 2016
- Like
- 0
- Continue reading or reply
Multilingual translation for standard fields
We can override the translation for Standard and lookup fields from translation workbench(export the translation files, make a change and import it back again) and can override the labels from Rename Tabs and Labels in setup for english language.
But I didn't get any option to override the language for standard fields, tabs and lookup field labels.
- Rahul Sharma
- December 31, 2016
- Like
- 0
- Continue reading or reply
Profile Setup page - why 2 different UI - 1 with no Field level setup
I find 2 diiferent kind of profile setup page from developer account. Why this? In one setup page, even I cannot find how to perform Field Level Setup?
Any pointer for above!
Thanks In Advance!
Priyadarshi
- Priyadarshi Nayak
- December 27, 2016
- Like
- 0
- Continue reading or reply
checking login is successful before redirecting to starturl and retrieve userid
I have and object where i need to update a field user_info__C with the customer portal userid. before redirecting to the start url.
by any means can i retrieve user id before redirection if login is successful.
Thanks
Abhilash Mishra
- Abhilash Mishra 13
- December 24, 2015
- Like
- 0
- Continue reading or reply
Looking for freelancing work in salesforce
I am a senior salesforce developer having nearly 4years of experience. I am certified with:
- Salesforce certified Force.com Developer.
- Salesforce certified Advanced developer.
- Salesforce certified Administrator.
- Salesforce certified Salescloud consultant.
- Salesforce certified Service cloud consultant.
Thanks and Regards,
Surendranadh Nune
- Surendra nune
- December 24, 2015
- Like
- 0
- Continue reading or reply
Display Attachment image in formula field
I have a trigger which updates attachment id into a custom field of object X__c. I have creatted a formula field with below formula to display the attached pic
IMAGE('/servlet/servlet.FileDownload?file=customfield__c', customfield__c ,20,20).
But the image is not getting displayed.But if i replace the customfield__c with recordid like below , the image is getting displayed. Please help where i am going wrong.
IMAGE('/servlet/servlet.FileDownload?file=00P28000000Ezg4', customfield__c ,20,20).
Regards
- ❤Code
- July 14, 2015
- Like
- 0
- Continue reading or reply
What JavaScript client-side frameworks would you like to see in future Mobile Packs?
We now have Mobile Packs for jQuery Mobile, Backbone.js and AngularJS, with (safe harbor!!!) Knockout.js in the pipeline. What other client-side framework(s) are you using? We've heard from fans of Ember.js and Sencha, but we need your help in prioritizing the next set of Mobile Packs.
Let us know here what you're looking for...
- Pat Patterson
- May 02, 2013
- Like
- 2
- Continue reading or reply