- Ankit Arora
- ALL STAR
- 8383 Points
- Member since 2010
- Senior Architect
- Briskminds Software Solutions - PDO
Badges
-
ChatterFeed
-
285Best Answers
-
2Likes Received
-
10Likes Given
-
17Questions
-
2055Replies
Identify empty PDF
I'm using function getContent(), to get blob of PDF page.
There are cases where the PDF is empty (blank page), and it's fine. The question how can I detect it.
-I cannot inspect the blob ,as the characters have no meaning....
-In the controller of the PDFpage I have such indication, but I cannot access it in the caller process.
Any suggestions?
PageReference page = new PageReference('/apex/PDFpage...');
blob bodyAttach=page.getContent();
- liron169
- June 18, 2015
- Like
- 0
- Continue reading or reply
Tabs inside a page
I want to merge 3 visualforce tabs in to one.
One solution is use radio buttons and let user select which data it should display.
But is there any better solution which will look better graphically like having tabs
- Simrin
- May 20, 2015
- Like
- 0
- Continue reading or reply
Dependent Picklist Using Dynamic Apex
Can anyone share the code snippet of Dependent Picklist using Dynamic Apex
Regards
- Manoj Dega
- May 05, 2015
- Like
- 0
- Continue reading or reply
Recruiting app - Master-Detail relationship between Review and Job_Application objects.
Let's start by adding the master-detail relationship field, which will relate our Review object with the Job Application object. To create the master-detail relationship field, access the Review object detail page.
4. Select Master-Detail Relationship, and click Next.
5. In the Related To drop-down list, choose Job Application, and click Next.
So I'm stuck at 5th point. I have Job Application object created already, which have two relationships in it, one with Position object and the other one is with Candidate object. Pleas help.
- Muhammad Wasim
- September 11, 2014
- Like
- 0
- Continue reading or reply
Mixed_DML_Operation: Trigger on User when isActive changes
In the trigger below, I am attempting to update a custom object called Instructors__c when a user changes. I'm looking for specific criteria, if they've become inactive, and if they're in a specific department, otherwise I move on. The issue however is that my update is throwing a MIXED_DML_OPERATION error. I found references to the @future option, however I need to pass an object to test against with at least 4 elements, the User id, EmployeeNumber, Department and isActive flag.
I did try putting this into a separate function with @future using this as a reference: http://salesforce-evershine-knowledge.blogspot.com/2012/09/unsupported-parameter-type-in-future.html. That solution had it's own set of issues and errors, namely passing in the information via the objects.
Any thoughts would be greatly appreciated.
// Run this only on update if(Trigger.isUpdate == true) { // When we deactivate a user, check to see if they are in instructor department // if they are, take their exit date and add it to the instructor object // and set them to inactive on the instructor object as well. // Department name that instructors belong to String department='Instruction'; //MASS ERROR MESSAGE String ErrorMsg = ''; List<Instructor__c> instructorsToUpdate = new List<Instructor__c>(); // Loop through each user, in case there is more than one user passed in for(User theUser : trigger.new) { // If we have an active user, and that user happens to be in instruction if(theUser.isActive == false && theUser.Department == department) { try { // Get the instructor from the instructor and update their record Instructor__c theInstructor = [SELECT Id, TeacherActive__c, Employee_Departure_Date__c FROM Instructor__c WHERE TeacherEmployeeID__c = :theUser.EmployeeNumber LIMIT 1]; // Make sure we have an object before trying to work with or update it. if(theInstructor != null) { theInstructor.TeacherActive__c = false; theInstructor.Employee_Departure_Date__c = theUser.Exit_Date__c; // Optimization instructorsToUpdate.add(theInstructor); ErrorMsg = ErrorMsg + 'Instructor: '+theInstructor.Name+', departure: '+theInstructor.Employee_Departure_Date__c+'\n'; } } catch(System.QueryException e) { System.debug('Failed to find Instructor: ' + e); ErrorMsg += 'Croaked while attempting find Instructor in Instructors__c using employee number: '+ theUser.EmployeeNumber + '<br/>Error: '+ e + '<br /><br/>'; } } } // Do the update on the list, not the individual for batch/optimization update instructorsToUpdate;
Error Message text:
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger User_AI caused an unexpected exception, contact your administrator: User_AI: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0UR0000003jSkcMAE; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): Instructor__c, original object: User: []: Trigger.User_AI: line 42, column 1
- Ilene Jones
- September 10, 2014
- Like
- 0
- Continue reading or reply
- sultan
- September 06, 2014
- Like
- 0
- Continue reading or reply
Profiles for Community
Can anyone tell me what are the profiles available for community ?
What's the purpose of those profiles?
Thanks in advance
Karthick
- SS Karthick
- September 02, 2014
- Like
- 0
- Continue reading or reply
Time-Dependent Workflow Actions ?
I want create a Time-Dependent Workflow action, for updating the Product's Custom field 'Status' .
if Product-Stauts = 'New' then after 90days the status field must be updated to Old.
what will be the Rule-Criteria and Criteria-Evalution ?
Thanks in Advance.
Cheers
Baba
- babacandoit
- August 30, 2014
- Like
- 0
- Continue reading or reply
How to add parent object fields to child object page layout
- Prasad Ruwanpathirana
- August 29, 2014
- Like
- 0
- Continue reading or reply
List has more than 1 row for assignment to SObject on action button in a page from managed package.
Then created a site using the apge within the pacjkage. When i clicked an action button, Recieved the exception , “List has more than 1 row for assignment to SObject
Error is in expression '{!saveingData}' in page donation:donationform: (Donation)
An unexpected error has occurred. Your solution provider has been notified. (Donation) “
What will be the reason? Anything regarding the installation or configuration.
Any help?
Thanks in advance.
- U Jay
- August 27, 2014
- Like
- 0
- Continue reading or reply
Rendered and Rerendered in vf pages
- santosh kotte
- August 25, 2014
- Like
- 0
- Continue reading or reply
Displaying SOQL query result in VF page tablular form
- smitra
- August 22, 2014
- Like
- 0
- Continue reading or reply
when i am trying to execute this trigger ............ System.SObjectException: DML statment cannot operate on trigger.new or trigger.old
{
list <student__c>st1= new list <student__c>();
for(student__c st:trigger.new)
{
if(st.sport__r.name=='rugby')
{
st.stdno__c=12345;
}
insert st;
}
}
- dany__
- August 20, 2014
- Like
- 0
- Continue reading or reply
Error: Compile Error: Field expression not allowed for generic SObject
===Trigger===
trigger OpportunityTrigger on Opportunity (after update) { new OpportunityTriggerHandler().run(); }
=== Trigger Handler class ===
public virtual class TriggerHandler { public TriggerHandler() { } // main method that will be called during execution public void run() { // dispatch to the correct handler method if(Trigger.isAfter && Trigger.isUpdate) { this.afterUpdate(); } } // context-specific methods for override protected virtual void afterUpdate(){} protected virtual void afterDelete(){} // exception class public class TriggerHandlerException extends Exception {} }
== OpportunityTriggerHancler Class==
I'm getting error in this class .
public class OpportunityTriggerHandler extends TriggerHandler { List<Task> tasks = new List<Task>(); List<Opportunity> Opps = Trigger.new; Map <Id, String> oppsOwner = new Map <Id, String> (); public OpportunityTriggerHandler() {} protected override void afterUpdate() { for (Opportunity opp : trigger.new) { // Check if the StageName has been changed if (opp.StageName != trigger.oldMap.get(opp.Id).StageName) { // get the owner ID's that have been affected oppsOwner.put(opp.ownerId, null); } } // Map the owner ID to it's email address for (User owner : [SELECT Id, Email FROM User WHERE Id = :oppsOwner.keySet()]) { oppsOwner.put(owner.Id, owner.Email); } } }
- Thakkar Parth
- August 20, 2014
- Like
- 0
- Continue reading or reply
SalesForce SQL Query
Hi All,
I am trying to write a query that export all the data of leads (the data that we need to export is available under (App Setup -> Customize -> Leads -> Fields), i am able to export some fields, but when trying to access some fields i am getting an SQL Error:
(No such column 'Address' on entity 'Lead'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.)
this is the list of the fields that we need to export using our php code:
- Address
- AnnualRevenue
- Campaign
- Company
- CreatedBy
- Jigsaw
- Industry
- LastModifiedBy
- LastTransferDate
- Owner
- RecordType
- NumberOfEmployees
- Rating
- Title
- Correlation_Data
- CorrelationID
- ProductInterest
- Financial_Product
- IB
- iContact_Contact_Id
- Lead_Number
- Lead_Source_Details
- Lead_Type
- Web_to_x_Lead
- Web_to_x_form_id
- Preferred_Communication
- Round_Robin_ID
- Trading_Softwae
- VIP_Customer
- Web_Source
I appreciate your help
- Wassim Ghannoum
- August 20, 2014
- Like
- 0
- Continue reading or reply
Newbie --Help Regarding Salesforce Mobile Development
Hi Guys,
I have been working as a Salesforce Dev for 3 years in Administration,Apex, Visualforce,Javascript,CSS.
Now i wish to move to mobile app development in Salesforce. But i dont have any idea on how to get Started.
I was working on a OMS Portal all these days. Suppose i want to develop a similar OMS app in mobile where Customers can order , how to get started?
Can someone provide me the link/pdf materials that will help us in starting with basics ?
Thanks in Advance ! !
- Ravi Narayanan
- August 20, 2014
- Like
- 0
- Continue reading or reply
I want to prevent customer from posting comment on the chat feeder.
I got the trigger but it seem not right. What is wrong here?
trigger InternalChatterCommentTrigger on FeedComment (before insert) {
list<user> ExternalUser = [select id from user where ProfileId in('00e50000001FdBYAA0')];
FeedComment
for (FeedComment fc : trigger.new){
for(user u : ExternalUser){
{
if (fc.CreatedById == u.id)
{
fc.adderror('You do not have permission to comment on Chatter. Please respond on this case using Comment related list');
}
}
}
}
}
- Phu Dang 1
- August 19, 2014
- Like
- 0
- Continue reading or reply
Unable to Understand behaviour of login hour restrictions
I am unable to understand the behaviour of the feature login hour restrictions.
If a users profile can login from 4pm to 5pm and a user logs in at 4.30 pm then what happens at 5.01pm?
Some have said that it automatically logs out,
some assume that the session goes on but he can only view.Once he tries for any DML operation,hez logged out
Can anyone help me out on this?
Thanks
- SFDC coder
- August 19, 2014
- Like
- 1
- Continue reading or reply
in my issue is i am not getiing data as a table just displays the fields .any one find the problem
<apex:form >
<apex:pageBlock title="hello {!$User.FirstName}!">
<apex:pageblockTable value="{!contact}" var="v" columnswidth="25,25,25,25">
<apex:column value="{!v.name}"/>
<apex:column value="{!v.lastname}"/>
<apex:column value="{!v.phone}"/>
<apex:column value="{!v.email}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
- Sree Salesforce
- August 18, 2014
- Like
- 0
- Continue reading or reply
can anybody Resolve this code below
list<account> alist=[select count(name) from account where name like 'T%'];
for(account a:alist)
{
system.debug('Records are:'+a);
}
- sultan
- August 16, 2014
- Like
- 0
- Continue reading or reply
Several Opening for Jaipur (Raj, India) Location (Freshers + Salesforce Developers)
1) Fresher (3 opening) - Must know Java, JS, HTML
2) Salesforce experienced developer (one opening for 2-3 years of experience) - Must have worked on Apex, Visualforce, Integrations, W/F, Approvals and a little knowledge on communities is preferred
3) QA (one opening for 2-3 years of experience) - Must know automated testing (say selenium)
Please do respond ASAP, we need to fill these positions before October. Spread this to your friends who may be interested.
Thanks
Ankit Arora
Briskminds Software Solutions Pvt. Ltd.
http://www.briskminds.com/
- Ankit Arora
- September 17, 2014
- Like
- 1
- Continue reading or reply
Several Opening for Jaipur Location (Freshers + Salesforce Developers)
1) Fresher (3 opening) - Must know Java, JS, HTML
2) Salesforce experienced developer (one opening for 2-3 years of experience) - Must have worked on Apex, Visualforce, Integrations, W/F, Approvals and a little knowledge on communities is needed
3) QA (one opening for 2-3 years of experience) - Must know automated testing (say selenium)
Please do respond ASAP, we need to fill these positions before October. Spread this to your friends who may be interested.
Thanks
Ankit Arora
Briskminds Software Solutions Pvt. Ltd.
http://www.briskminds.com/
- Ankit Arora
- September 07, 2014
- Like
- 1
- Continue reading or reply
Error: OutputField can only be used with SObject fields.
Strange problem :
Scenario is I have a Map (MyMap) in my controller class : Map<String , List<Account>>
Am trying to display this map values using visualforce page like this :
<apex:repeat value="{!MyMap}" var="M"> <apex:repeat value="{!MyMap[M]}" var="temp"> <apex:outputLabel value="{!temp.Test_Curr__c}"/><br/> </apex:repeat> </apex:repeat>
Test_Curr__c is currency field and it is displaying value like this 1234.0 using above code . But I want to display this as $1,234. Outputfield resolves my problem here.
If I take a simple list of account and display on visualforce using outputField then it displays the desired format ($1,234) :
<apex:repeat value="{!accLst}" var="acc"> <apex:outputField value="{!acc.Test_Curr__c}"/> </apex:repeat>
But when I modify my logic using Map it says "Error: Could not resolve the entity from <apex:outputField> value binding '{!temp.Test_Curr__c}'. outputField can only be used with SObject fields."
<apex:repeat value="{!MyMap}" var="M"> <apex:repeat value="{!MyMap[M]}" var="temp"> <apex:outputField value="{!temp.Test_Curr__c}"/><br/> </apex:repeat> </apex:repeat>
Just wondering when am fetching the list of account from Map why it is giving me error?? I know the error very well as it is at compile time but want to know the reason behind the screen.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
- Ankit Arora
- July 07, 2011
- Like
- 0
- Continue reading or reply
Displaying Image in Contact
There are many Ideas and requirements to display image on native contact page, so this is what I have blogged :
http://forceguru.blogspot.com/2011/06/display-picture-in-contact.html
Thanks
Ankit Arora
Blog | Facebook | Blog Page
- Ankit Arora
- June 28, 2011
- Like
- 0
- Continue reading or reply
Visualforce Code Generator
This is about how we can create visualforce page code with just button click. Hope this is helpful.
Isn't that good if we can create a visualforce page with just clicking some buttons.
Have a look http://t.co/LDiMEBy
- Ankit Arora
- June 15, 2011
- Like
- 0
- Continue reading or reply
Create View for Searching Object in Setup
Hope this Idea will help all.
Please promote : https://sites.secure.force.com/success/ideaView?c=09a30000000D9xtAAC&id=08730000000YXGjAAO
- Ankit Arora
- June 11, 2011
- Like
- 0
- Continue reading or reply
Packaging Salesforce CRM Content Fields
Any one facing the same problem??
Please promote the idea : https://sites.secure.force.com/success/ideaView?c=09a30000000D9xtAAC&id=08730000000YjKwAAK
- Ankit Arora
- June 11, 2011
- Like
- 0
- Continue reading or reply
Report and Dashboard Ids in Full Sandbox
May this is simple but bit strange to me. We know that full sandbox and production have identical ids, but I am facing a problem i.e. I have created some 180 reports on my sandbox and used it on different dashboards. Some of the source in dashboards are having drill down. Means when we are clicking on report from dashboard then some other report is opened.
I have created a change set in which I have included all reports and dashboards. Now when I have deployed the change set on production then all Ids of dashboards and reports are different from that of sandbox.
Which leads me to again change all the drill down report Ids on dashboards.
Problem is why the Ids of reports and dashboards are changed????
- Ankit Arora
- June 07, 2011
- Like
- 0
- Continue reading or reply
Fetching SObject Type in test class referring object of managed package
I have a strange problem, let me explain you the scenario :
1) I have installed a managed package with namespace (ankit), it includes a object name Sling and two recordtypes "test1" and "test2".
2) Now I have done some custom development on my personal org where I have installed that package. I have created a test class which looks something like this :
@isTest private class MyTestClass { private static testmethod void testM() { ankit__Sling__c s = [select id from ankit__Sling__c limit 1] ; System.debug('s :::::: ' + s) ; List<RecordType> rt = [select id from recordtype where sobjectType = 'ankit__Sling__c'] ; System.debug('rt ::::: ' + rt) ; List<RecordType> rt2 = [select id from recordtype] ; System.debug('rt2 ::::: ' + rt2) ; System.assertEquals(rt.size() , 2) ; } }
3) Now I simply create another package which is unmanaged and include this test class in it, automatically package object sling and its record types are included. Now I have created a package(Unmanaged), and its done successfully. Now I am checking the debugs it gives me proper data (two record types are returned in test class and assert is passed).
Note : Till now I have not create a namespace for my organization.
4) Now what I have done is created a namespace on my organization and try to upload the same package(unmanaged) again. This time my test class get failed and the problem is no record type is returned whose sobjecttype is 'ankit_sling__c'.
My second debug
System.debug('rt2 ::::: ' + rt2) ;
returns two record type which is expected, just wondering why these record types are not returned when I am putting where clause condition "where sobjecttype = 'ankit_sling__c' "
Is this is a bug??? I have tried this on multiple orgs and faced same problem everywhere.
Any directions over this will be great.
- Ankit Arora
- May 31, 2011
- Like
- 0
- Continue reading or reply
Fetch SObject.name
List<Sobject> sObj = Database.Query(dynamicQuery) ; for(SObject obj : sObj) { //I can do this System.debug(' :::::::: ' + obj.Id) ; // Looking to do this System.debug('::::::::::::: ' + obj.Name) ; }
I know the SObject name lets say account but I do not want to type cast mt result like this
List<Sobject> sObj = Database.Query(dynamicQuery) ; for(SObject obj : sObj) { Account acc = (Account)obj ; }
Any help regarding this would be appreciable
- Ankit Arora
- May 29, 2011
- Like
- 0
- Continue reading or reply
Salesforce Certification Sample Question (401)
Hi All,
I have posted some of the sample questions for 401 certification exam. Also how you can prepare for the exam.
Will soon post some more interesting topics related to certification exam.
Click for Smaple Questions
And How To Prepare
Thanks
Ankit Arora
- Ankit Arora
- May 16, 2011
- Like
- 0
- Continue reading or reply
- Ankit Arora
- May 07, 2011
- Like
- 0
- Continue reading or reply
How to implement Pagination With Salesforce Native Look And Feel
Hi All,
Some time we need to display a good amount of data on our custom pages and pagination is the best option we can arrange that data on our custom VFP.
So question come how we can do that with salesforce native look and feel.
Here is the answer : http://forceguru.blogspot.com/2011/04/pagination-in-salesforce.html
Thanks
Ankit Arora
- Ankit Arora
- April 17, 2011
- Like
- 0
- Continue reading or reply
Tips regarding reducing apex code script statements
Please visit:
http://forceguru.blogspot.com/2011/04/saving-script-statements.html
for tips regarding how to reduce the script statements and some good logics in apex code.
Thanks
Ankit Arora
- Ankit Arora
- April 11, 2011
- Like
- 0
- Continue reading or reply
- Ankit Arora
- March 09, 2011
- Like
- 0
- Continue reading or reply
Connection from Salesforce to Bhoomi
Hi,
Is there any way to connect from Salesforce to bhoomi.
As there is way to connect from Bhoomi to salesforce, but i want to send data from salesforce to FTP VIA Bhoomi.
If any one know about this please reply.
Thanks in advance.
- Ankit Arora
- July 20, 2010
- Like
- 0
- Continue reading or reply
- Ankit Arora
- July 20, 2010
- Like
- 0
- Continue reading or reply
Several Opening for Jaipur (Raj, India) Location (Freshers + Salesforce Developers)
1) Fresher (3 opening) - Must know Java, JS, HTML
2) Salesforce experienced developer (one opening for 2-3 years of experience) - Must have worked on Apex, Visualforce, Integrations, W/F, Approvals and a little knowledge on communities is preferred
3) QA (one opening for 2-3 years of experience) - Must know automated testing (say selenium)
Please do respond ASAP, we need to fill these positions before October. Spread this to your friends who may be interested.
Thanks
Ankit Arora
Briskminds Software Solutions Pvt. Ltd.
http://www.briskminds.com/
- Ankit Arora
- September 17, 2014
- Like
- 1
- Continue reading or reply
Several Opening for Jaipur Location (Freshers + Salesforce Developers)
1) Fresher (3 opening) - Must know Java, JS, HTML
2) Salesforce experienced developer (one opening for 2-3 years of experience) - Must have worked on Apex, Visualforce, Integrations, W/F, Approvals and a little knowledge on communities is needed
3) QA (one opening for 2-3 years of experience) - Must know automated testing (say selenium)
Please do respond ASAP, we need to fill these positions before October. Spread this to your friends who may be interested.
Thanks
Ankit Arora
Briskminds Software Solutions Pvt. Ltd.
http://www.briskminds.com/
- Ankit Arora
- September 07, 2014
- Like
- 1
- Continue reading or reply
How to prevent double click on a custom Detail Page Button?
VF page is used to call a controller method to execute and create Record in ERP system using REST API.
<apex:page standardcontroller="Account" extensions="CreateCustomerController" action="{!createCustomer}">
</apex:page>
When user double clicks it is creating duplicate customer records in our ERP system.
How can I prevent this happening.?
Can I disable the button after first click?
If you have asome other solution I can try. I have seen some post like below but I am using VF page as content source so don't want use this.
https://developer.salesforce.com/forums/?id=906F000000093GUIAY
- kabu
- November 04, 2015
- Like
- 0
- Continue reading or reply
VR for Stage Convert and multiple picklist values and blank field
Trying to figure this VR but no luck.
Need a VR Rule where it applies to all profiles except system admin, when the Opportunity ID record type =
012d0000000XJyv, and StageName = Conversion, with any values selected from picklist ADO Type = Grow, Mix, or Share, and need to make sure that number field ADO Actual is not blank.
These parameters should prompt the user to enter data in the ADO Actual field.
AND( NOT($Profile.Name ="System Administrator"), OR( RecordType.ID = "012d0000000XJyv"), OR( (ISPICKVAL(StageName, "Convert (ISPICKVAL( ADO_Type__c , "Grow")), ISPICKVAL( ADO_Type__c , "Mix"), ISPICKVAL( ADO_Type__c , "Share")), AND( NOT(ISBLANK(ADO_Actual__c)), )
- HNT_Neo
- November 04, 2015
- Like
- 0
- Continue reading or reply
From Visual force Homepage component we are able to access the case list view buttons, case detail buttons etc.. through jquery? this is not permitted by salesforce after 'winter 16'
In one of our orgs we are able to access the 'list view buttons', Case detail page buttons etc.. from visualforce Home page component through jquery. As per 'winter 16' this privilage has been stopped from salesforce, when we try the same in our any other orgs the cross domain error is popping, this happens when we try to access the parent page buttons from Vf home page component. Could any one can explain what might be the reason for this or is there a special permission or provision from salesforce which is allowing this behavior, i couldn't makeout any help is highly appreciated
Thanks,
Harshavardhan
- Harshavardhan MD
- November 03, 2015
- Like
- 0
- Continue reading or reply
Cannot Rename Action label
- Ceterna 13
- October 12, 2015
- Like
- 0
- Continue reading or reply
how to display the account details in a map ?
- jai raj 6
- October 09, 2015
- Like
- 0
- Continue reading or reply
apex after insert trigger error . please help
trigger afterinsertTrigger on Opportunity (after insert) { list share=new list(); user u=[select id from user where lastname='pogiri']; for(Opportunity op:Trigger.New){ if(op.amount>50000){ Opportunityshare s=new Opportunityshare(); s.OpportunityId=op.id; s.OpportunityAccessLevel='Edit'; s.RowCause='Manual'; s.UserOrGroupId=u.id; share.add(s); } } insert share; }
- Rajendra Pogiri
- June 23, 2015
- Like
- 0
- Continue reading or reply
Visualforce page to include dashboard
is used to represent the report in Piechart,is there any way to represent the report in Bar chart???
- s_mac
- June 23, 2015
- Like
- 0
- Continue reading or reply
- Paras Jain
- June 23, 2015
- Like
- 0
- Continue reading or reply
Map input text to Picklist
On VF page Picklist values Enter Color radio button option a and radio button option B
but if they want to enter any other color than this we give them input text to enter manually and we want to map that input text to this picklist in database. How can I do that?
- ankush
- June 18, 2015
- Like
- 0
- Continue reading or reply
Insert/Update Milestone data in a Custom Object
When ever a CaseMilestone is updated, I want to Insert/Update the Milestone data into a Custom Object.
As far as i know we cannot write a Trigger on CaseMilestone object.
Please suggest some solution to acheive this.
Thanks
- Sky1990
- June 18, 2015
- Like
- 0
- Continue reading or reply
- Dinesh Gupta Kondapalli
- June 18, 2015
- Like
- 0
- Continue reading or reply
Check dependency of a field.
How can I check a particular field's dependencyin the org.
To ensure dependency I have tried to delete the field but it is not the foolproof solution as some dependecies, like reports etc., are not getting covered in that.
SO what is method by which I can garuntee that a metadata (especially a field) is used /have dependency in all other metadata?
Eg: A field XYZ is used in a class, VF page, validation rule, report etc.
So I need the list wherever this XYZ field is used.
Hope my query is clear, but do let me know if any further information is required.
Thanks,
Ritik
- Ritik
- June 18, 2015
- Like
- 0
- Continue reading or reply
how to change owner of record using trigger when we are deactivating the current owner ?
- vutukuru balaji
- June 18, 2015
- Like
- 0
- Continue reading or reply
Identify empty PDF
I'm using function getContent(), to get blob of PDF page.
There are cases where the PDF is empty (blank page), and it's fine. The question how can I detect it.
-I cannot inspect the blob ,as the characters have no meaning....
-In the controller of the PDFpage I have such indication, but I cannot access it in the caller process.
Any suggestions?
PageReference page = new PageReference('/apex/PDFpage...');
blob bodyAttach=page.getContent();
- liron169
- June 18, 2015
- Like
- 0
- Continue reading or reply
clone button
Clone is a standard button or Custom button.If it is custom button can any one provide me code behind the clone button for cloning particular records.
thanks
- Mubarak
- June 18, 2015
- Like
- 0
- Continue reading or reply
Tabs inside a page
I want to merge 3 visualforce tabs in to one.
One solution is use radio buttons and let user select which data it should display.
But is there any better solution which will look better graphically like having tabs
- Simrin
- May 20, 2015
- Like
- 0
- Continue reading or reply
Why an Unlicensed User able to fetch data from a Managed Packaged Custom Object?
Assuming I've a Managed Package CustomObject: [abc__XYZ__c]
IMPORTANT:
- [User A] - has been assigned a License of this Managed Package.
- [User B] - DO NOT have a User License to this Managed Package.
Consider these 3 Visualforce Pages & respective Apex Classes:
- Test1
- Test2 / Test2Controller
- Test3 / Test3Controller
Code for the Pages/Classes is as follows:
Test1 VF Page:
<apex:page standardController="abc__XYZ__c"> <apex:pageBlock> <apex:pageBlockSection columns="1"> <apex:outputField value="{!abc__XYZ__c.Name}" /> <apex:outputField value="{!abc__XYZ__c.abc__TotalAmount__c}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:page>
Test2 VF Page:
<apex:page controller="Test2Controller"> <apex:pageBlock> <apex:pageBlockSection columns="1"> <apex:outputText value="{!mysObjVar['Name']}" /> <apex:outputText value="{!mysObjVar['abc__TotalAmount__c']}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:page>
Test2Controller APEX Class:
public with sharing class Test2Controller { public abc__XYZ__c mysObjVar { get;set; } public Test2Controller() { mysObjVar = new abc__XYZ__c(); abc__XYZ__c[] b = [select Id, name, abc__totalamount__c from abc__XYZ__c where id =: ApexPages.currentPage().getParameters().get('id')]; if (b.size() > 0) mysObjVar = b[0]; } }
Test3 VF Page:
<apex:page controller="Test3Controller"> <apex:pageBlock> <apex:pageBlockSection columns="1" title="via sObject"> <apex:outputText value="{!mysObjVar['Name']}" /> <apex:outputText value="{!mysObjVar['abc__TotalAmount__c']}" /> </apex:pageBlockSection> <apex:pageBlockSection columns="1" title="via Custom"> Name: <apex:outputText value="{!sName}" /> Total: <apex:outputText value="{!sTotal}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:page>
Test3Controller APEX Class:
public with sharing class Test3Controller { public sObject mysObjVar { get;set; } public string sName { get;set; } public decimal sTotal { get;set; } public Test3Controller() { mysObjVar = Schema.getGlobalDescribe().get('abc__XYZ__c').newSObject(); string recordid = ApexPages.currentPage().getParameters().get('id'); sObject[] b = database.query('select Id, name, abc__TotalAmount__c from abc__XYZ__c where id =: recordid'); if (b.size() > 0) { mysObjVar = b[0]; sName = (string) b[0].get('Name'); sTotal = (decimal) b[0].get('abc__TotalAmount__c'); } } }
Now:
- If I access, via [User A]: Test1, Test2, and Test3 VF pages in browser with a valid Record Id, I get ALL these 3 VF pages show me Values for the fields I have shown.
- If I access, via [User B]:
- Test1 VF page show "Insufficient Privileges" error.
- Test2 VF page show me Empty Page.
- Test3 VF Page show me Empty Section when access via sObject[fieldName] BUT show me Actual Values in field in a section when I use String Property to fetch the field values (image attached)
And so my question, how can a User who does not have a License to the Package be able to Fetch Data, and be able to display it to user via a Custom Property, but not via an sObject instance variable or direct object instance variable?
To me it seems like a big Bug in platform! Ideally I don't think it should every allow reading of Data to any User who does not have access to the Managed Package via Licenses and Describe() Calls should respect that, shouldn't they?
- VarunC
- February 05, 2015
- Like
- 2
- Continue reading or reply
Attributes Exection Order
<c:SampleComponent sortBy="Type" storeTo="page2:hidden" isTableFormat="true"/>How will I know which of the setter methods of each attributes executes first? Thanks!
- Leuwend Job Hapa
- September 17, 2014
- Like
- 1
- Continue reading or reply
Get Apex Percentage Used in Salesforce.
I have plan to get apex percentage used in salesforce through codding. So, for this I am trying to get size without comments from each apex class or currently using characters from apex.
If we able to get directly apex percentage used, then no issues, my problem will solve.
Can you please help me any one on this.
Please find attached image for more details.
Thanks
Venkat
- arigela
- August 29, 2014
- Like
- 1
- Continue reading or reply
bug? page refresh creates new child records
I have a problem that I'm finding hard to figure out. Any help on the issue would be most welcome.
I have a custom object called Bonus, this has a lookup relationship with another custom object called Payments.
Using a VF page and standard controller with extension, I have a button on the Bonus page layout that will create 4 payment records for a single Bonus record when pressed.
This all works fine, however if I refresh the page immidiately after creating the Payment records, I get 4 more. If I close the page, open it again and then refresh I do not get any duplicates.
Has anyone ever experienced this before? ...or have any suggestions for how I can troubleshoot?
Many thanks!
- Jamie Evans
- August 28, 2014
- Like
- 1
- Continue reading or reply
Percent of Apex Used: XX.XX% in salesforce
Can you please help on this?
Below queries are using for getting but not able to get correct result(These are tooling api objects).
1. SELECT Sum(LengthWithoutComments) FROM ApexClass WHERE ID NOT IN (SELECT ApexTestClassId FROM ApexCodeCoverage)
2. SELECT Sum(LengthWithoutComments) FROM ApexTrigger
I am doing sum of these two result.((Sum(1+2)/10000000)*100)
Thanks
Venkat
- arigela
- August 28, 2014
- Like
- 1
- Continue reading or reply
SOQL query, WHERE clause reference to related list size
I would like to use SOQL to query a parent object based on whether it does or does not have any child records (whether MD or Lookup).
The perfect query would be something like:
- SELECT Id FROM Account WHERE COUNT(Contacts__r) = 0
or
- SELECT Id FROM Account WHERE Contacts__r.size() = 0
or
- SELECT Id FROM Account WHERE Contacts__r = null
From what I have found in threads as late as 2013, this does not appear to be possible.
Is that still the case in the Summer 2014 release?
It would appear that (for my needs) the best way to execute this type of query would be to:
- SELECT Name, (SELECT name FROM Contacts) FROM Account
- Then programmatically check the size of the returned set of Contacts
Is this my best option? I know that I could:
- SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Contact)
But the actual objects that I want to interogate are more that the 50k limit for this type of query.
Thanks.
Bryan Hunt
- Bryan Hunt
- August 20, 2014
- Like
- 1
- Continue reading or reply
Location based SOQL query using AJAX toolkit
<apex:page >
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="../soap/ajax/25.0/connection.js" ></script>
<script type="text/javascript">
$(document).ready(function() {
sforce.connection.sessionId = '{!$Api.Session_ID}';
var query = "SELECT Id FROM Contact WHERE DISTANCE(Location__c, GEOLOCATION(42.0, -76.0), 'mi') < 10";
console.log(query);
var res = sforce.connection.query(query);
console.log(res);
});
</script>
</apex:page>
The post request is returning a 500 error, with the message, "No such column 'Location__c' on entity 'Contact'." However, there is a field called Location__c; furthermore, this query works just fine from the Developer Console. Can anyone see what might be going on here?
- Cheyne
- August 20, 2014
- Like
- 1
- Continue reading or reply
Unable to Understand behaviour of login hour restrictions
I am unable to understand the behaviour of the feature login hour restrictions.
If a users profile can login from 4pm to 5pm and a user logs in at 4.30 pm then what happens at 5.01pm?
Some have said that it automatically logs out,
some assume that the session goes on but he can only view.Once he tries for any DML operation,hez logged out
Can anyone help me out on this?
Thanks
- SFDC coder
- August 19, 2014
- Like
- 1
- Continue reading or reply
Trigger.oldMap.keySet()
Can anyone tell me what is trigger.oldmakp.keyset() and give me sample example for that
Please Help
- SS Karthick
- July 25, 2014
- Like
- 1
- Continue reading or reply
An Introduction to Environments (aka orgs)
Hi All
A new article has just been published on Developer Force:
- An Introduction to Environments (link) - There are several types of environments available to you while developing and testing on Force.com. This article provides an outline of these environments. It will discuss the various editions, best practices and design considerations, and recommend particular environments during the application life-cycle.
As always, any feedback is welcome.
Thanks,
Jon
- Jon Mountjoy_
- April 23, 2009
- Like
- 3
- Continue reading or reply