-
ChatterFeed
-
2Best Answers
-
0Likes Received
-
0Likes Given
-
13Questions
-
28Replies
Too many DML statments:21
I am getting the "too many dml statements" error when I do a bulk update. I realize that the problem is that I have an insert statement inside a for loop but I am unsure of how to resolve the issue. How do I get the fields I want to update into a map or list so that I can then update them all at once? I am confused about the syntax...Here is the portion of my code that is giving me a problem... thanks!!!!!
///Part 2 B update //if health, update the health market if (HealthGo) { for(Account a: accts){ a.Health_Market__c=Market; a.Health_Renewal_Date__c=RenewalDate; a.Health_Underwriter_Assigned__c = Underwriter; update accts; } } else{ } //if dental, update the dental market if (DentalGo) { for(Account a: accts){ a.Dental_Market__c=Market; a.Dental_Renewal_Date__c=RenewalDate; update accts; } }
-
- fredka
- February 09, 2010
- Like
- 0
- Continue reading or reply
pageblockTable displayed differently in different browser, some borders are missing in blank cell
Hi, pageblockTable is displayed differently in IE & Firefox & others, specifically some borders are missing in some blank cells.
Showing correctly:
How to make it display the border for all cells? i have border="1" in myVF markup.
Thanks.
-
- CTU007
- February 05, 2010
- Like
- 0
- Continue reading or reply
Vmforce or JVMForce ?
-
- AnshulVerma
- May 01, 2010
- Like
- 0
- Continue reading or reply
My Experiments with Salesforce
Hi,
After a long time I have been finally able to devote sometimes to set my blog up and post article on it. I will be adding more and more information as per my experience continuously. Please mind that whatever I would be writing in my blogs would be purely on my experience and would not be in any case influenced by Salesforce team.
Link for my blog is:- http://mightycoder.blogspot.com/2010/02/development-time-in-sfdc-vs-net-and.html
Hope you like it and follow it.
Thanks,
Anshul Verma
-
- AnshulVerma
- February 22, 2010
- Like
- 0
- Continue reading or reply
How to hide Search, Advanced Search and Recent Items options
We are developing a fully customized Force.com application, which uses Visualforce totally.
We want to restrict user to view "search" and "recent Items" options. We have closed all the tabs for the user but if user fiddles with the URL box of browser and enters a wrong url, user comes to a custom visualforce error page (provided by salesforce.com), therein user can view the "recent items" and can also edit them. Moreover, there is a link for advanced search, on clicking it user can search for some objects.
Please provide necessary information.
Regards,
Anshul Verma
-
- AnshulVerma
- December 18, 2008
- Like
- 0
- Continue reading or reply
Error Message: Application not available
I faced a random issue today, while testing my application i found that my application was not accessible and recieved an error message "Application not available".
Although, other accounts on the same server (na5) were running successfully.
Can somebody please throw some light on it.
Thanks and Regards,
A.V.
-
- AnshulVerma
- September 05, 2008
- Like
- 0
- Continue reading or reply
-
- AnshulVerma
- September 05, 2008
- Like
- 0
- Continue reading or reply
How to upload file automatically
There is a feature requirement in our application, that requires file to be uploaded on server just by clicking a button.
Is there any option in Apex/ Visualforce/SControls using which we can upload file automatically. Any technique, wether using Javascript/ AJAX.. would do.. its urgent??
Thanks in Advance.
A.V.
-
- AnshulVerma
- July 10, 2008
- Like
- 0
- Continue reading or reply
How to upload file automatically
There is a feature requirement in our application, that requires file to be uploaded on server just by clicking a button.
Is there any option in Visualforce using which we can upload file automatically. Any technique, wether using Javascript/ AJAX.. would do.. its urgent??
Thanks in Advance.
A.V.
-
- AnshulVerma
- July 10, 2008
- Like
- 0
- Continue reading or reply
Apex properties not working correctly
I have a combo box(in visualforce). Following is the code for the combobox:-
In Apex I've given below two sets of code
1) New Properties:- property made according to Apex Script 13.0.
2) Old Properties:- property made according to scripts older than Apex Script 13.0.
###############################################################################
//------------------------- New Properties ----------------------------------
public String CurrencyMaster
{
get { return this.m_currencyMaster; }
set { this.m_currencyMaster=value; }
}
//-----------------------------------------------------------------------------
//------------------------- Old Properties ----------------------------------
public String getCurrencyMaster() { return m_currencyMaster; }
public void setCurrencyMaster(String value) { m_currencyMaster = value; }
//-----------------------------------------------------------------------------
###############################################################################
Now, the problem is that I am successfully getting the value of selected item in case of "Old Properties" but if I use "New Properties", its value doesn't gets set. It gives me a Null value.
Please Explain????
Thanks in Advance.
A.V.
-
- AnshulVerma
- July 08, 2008
- Like
- 0
- Continue reading or reply
How to restrict access to Salesforce pages to a user
I'm developing an application using Visualforce and Apex. We are developing a whole new User Interface and the user would use that itself. How can we restrict users to access only our visualforce pages and nothing else (even if user tried to navigate default Salesforce.com pages by placing the correct path of any other page e.g. home page in the address bar).
E.g. i have a page called messages (visualforce), now i don't want user to access any of the pages available by default from Salesforce (e.g. home page etc.). What i want is that, even if user enters the correct path of home page in the navigation bar, the application should detect it and stop him to do so.
Thanks in advance.
Regards,
A.V.
-
- AnshulVerma
- July 03, 2008
- Like
- 0
- Continue reading or reply
How to restrict users to access certain pages
I'm developing an application using Visualforce. We are developing a whole new User Interface and the user would use that itself. How can we restrict users to access only our visualforce pages and nothing else (even if user tried to navigate default Salesforce.com pages by placing the correct path of any other page e.g. home page in the address bar).
E.g. i have a page called messages (visualforce), now i don't want user to access any of the pages available from Salesforce (e.g. home etc.). What i want is even if users enters the correct path of home page in the navigation bar, the application should detect it and stop him to do so.
Thanks in advance.
Regards,
A.V.
-
- AnshulVerma
- July 02, 2008
- Like
- 0
- Continue reading or reply
Static variables not acting as static
As I see static variables (in Java, C/C++, C# etc.) static variables are values that remain persistent throughout the application, it can be read/set in all sessions and would access the same variable(the value would persist across the whole application). But, when I was working with the static members of Apex classes I found that their values do not persist and
Please refer the following code
//Static class
Class ABC
{
public static Integer myVal;
static
{
myVal = 0;
System.debug('static constructor is called');
}
}
Visualforce page
All
value = {!val}
Apex Page Controller
Class SampleCon
{
public PageReference test()
{
System.debug('----------------val='+ ABC.myval);
CommonHelper.myval = CommonHelper.myval + 2;
System.debug('----------------val='+ ABC.myval);
CommonHelper.myval = CommonHelper.myval + 2;
System.debug('----------------val='+ ABC.myval);
CommonHelper.myval = CommonHelper.myval + 2;
System.debug('----------------val='+ ABC.myval);
return null;
}
}
Now, what happens is that each time test is initiated ABC.myval comes as zero. As far as my experience with other technologies (.NET, Java etc.), i think that statics should persist their values.
Please suggest if there is something that i'm missing.
Thanks in advance,
Anshul Verma
-
- AnshulVerma
- June 23, 2008
- Like
- 0
- Continue reading or reply
How to persist values i.e. access values organization wide and user session wide
In my application(apex) i want:-
1)Certain values to be accessible to whole organization. Like an array of all countries and states etc. that would be used by all the users.
2) Certain values to be accessible in entire user's session. i.e. once set for one user session would be accessible to all classes when called from the same session. e.g. if I place user's company id in session/cache then it should be accessible across multiple pages(wherever user navigates). something like we do with Cache/Sessions in .NET/Java.
Please reply how to achieve the above mentioned features.
Thanks in advance,
A.V.
-
- AnshulVerma
- June 23, 2008
- Like
- 0
- Continue reading or reply
Selecting Objects by placing ID field in IN Clause of SOQL
I want to search certain objects based on the ID's that have been stored in a string (coma separated), as we do in SQL
SELECT <fields> FROM <Table_name> WHERE ID IN ( <Comma seperated ID's> ).
I have tried to do the same in SOQL but didn't succeed in doing so. Although, when i execute the SOQL query in SOQL Explorer it runs fine and returns correct data back.
-> Secondly, while searching for probable solutions, I found the concept of Polymorphic keys in Salesforce. But, I was not able to find much data on that. Can somebody please give more information on that.
Any help would be apreciated.
Thanks,
AV
-
- AnshulVerma
- May 27, 2008
- Like
- 0
- Continue reading or reply
Auto index deterministic formula field?
- Heman Pagey
- February 01, 2017
- Like
- 0
- Continue reading or reply
CORS Issue while connecting to Salesforce from JavaScript (both from simple HTML and Visualforce)
var requestUrl = 'https://login.salesforce.com/services/oauth2/token'; requestUrl += '?username=USERNAME&password=PASSWORD_SECURITY_TOKEN&grant_type=password&client_id=CLIENT_ID_FROM_CONNECTED_APP&client_secret=AGAIN_FROM_CONNECTED_APP;We tried connecting using JQuery AJAX call and JSforce libraries. We have also whitelisted the required domain in Salesforce via Setup --> Security Controls --> CORS.
We tried connecting to salesforce via the intranet site as well as another salesforce org using the same code. for both of the situations we are getting below error.
In case if image does not load
The origin is there in the Request Header as checked in Browser Console, however, the 'Access-Control-Allow-Origin' parameter is not there in response header from Salesforce.
Am I missing any setting here or it is not something Salesforce currently supports? Any help appreciated, thanks.
- Kshitij Lawate
- January 05, 2016
- Like
- 1
- Continue reading or reply
Making two lists out of a scope of records
- AnonTestQuest
- July 15, 2015
- Like
- 0
- Continue reading or reply
Trailhead - Process Builder - Time-Based Actions Challenge
I am getting this reason: The 'Set Case to Escalated' Workflow field update action was not found
It states in the Challenge: NOTE: Since Workflow rules only fire on record save, normally you would implement this with a time-triggered workflow action...so I created it as a Time-Based action.
Has anyone completed this Challenge successfully?
- Andy Corbett
- April 23, 2015
- Like
- 0
- Continue reading or reply
What is main use for Permission sets?
Hi All,
When we can use permission set ?Give Examples
Thanks,
Vicky
- vickySFDC
- June 04, 2013
- Like
- 0
- Continue reading or reply
- kittu9
- May 13, 2013
- Like
- 1
- Continue reading or reply
How can i get details of related to ie the WhatId of Task Object in SOQL.
Hi,
How can i get details of related to ie the WhatId of Task Object in SOQL.
CustomObject has a field as Name
Example : Task t1 is related to CustomObject
SOQLQuery could be [SELECT id,whatid from Task];
This will result me in taskid and the customObject record id but what if i need that complete record of customObject.
Appriciate any inputs on this in advance
Thanks.
- snippets@sf
- February 17, 2013
- Like
- 0
- Continue reading or reply
Login to Force.com Sites from a custom webpage
Hi,
I have create Force.com Sites login and enabled it for our Customer Portal Users and it is working fine. We created the Site Login page using the standard page provides by Salesforce and customized css and designs for the page keeping the core functions and code of the page intact.
We provide the link to the login page to our users or redirected them to the login page when they clicked on the links in our website.
Now we have a requirement where we want the login available in the same page instead of a link. (meaning no redirects to the existing login page) For example like the Facebook login page. So when the user go to our website
http://ourwebsite.com/customerportal, they will have the login, forgotpassword and new user registration options there. So they can enter their username and password there and then go to the portalHome page.
The existing loginpage (visualforce and apexcontroller) still works fine. Need to move the login to our website which is using ASP .Net and C#.
Can this by achieved? What is the best way to get this done?
Thanks
KD
- KD119
- September 08, 2011
- Like
- 0
- Continue reading or reply
Unable to refresh resource...
Hi,
Am unable to refresh any of the resources in the IDE from the server.
When am trying to refresh a page from the web, getting an Exception saying:
Unable to refresh resource 'MileaeExension.cls':
com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor
Please assist to rectify the issue.
Thanks in advance,
VNath
- crocodile
- September 22, 2010
- Like
- 1
- Continue reading or reply
Best way to host images for CMS type site?
I'm curious what is the best way to host images for CMS type sites. Let's say I have a custom object called Building. It has some fields such as Height, Number of Floors, Year Built, etc. I'd also like to attach an image of the building to the record. Then I have a custom visualforce component that pulls all this data and image into a nice clean output.
There appears to be no good way to handle the images. RTF are not an option as the output is impossible to work with. Attaching as documents is like building something with toothpicks and bubble gum as it requires exact naming of the documents so they can be queried properly.
There used to be an idea for an image field type that would address this issue perfectly. Upload a single image to a field and then when outputting this field you would get a simple <img> tag. Ideally there would also be something like this: http://sites.force.com/ideaexchange/ideaView?c=09a30000000D9xt&id=08730000000BrdBAAS
- TehNrd
- May 10, 2010
- Like
- 0
- Continue reading or reply
need to compare date field in query string
Hi,
Here I am doing some crazy stuff. I get givenDateTime from controller and capturing it to a dattime variable using constructor of BatchApex. I want to use this dattime variable in quey. But when I use 'dtGMT' variable in quey i got some conversion errors. so, I converted GMT time(default sFDC object store GMT time) to MST time. then its working fine. But now i thought I did crazy stuff for date.. Do any work around for this without converting from GMT to MST.
Appreciate any suggestions. Following is the sample code I created.
global BatchMemberList (ID CampId, dateTime givenDateTime)
{
CampaignId=CampId;
dtGMT= givenDateTime;
}
global Database.Querylocator start(Database.BatchableContext BC)
{
//converting GMT to MST and getting individaul values from the datetime
String dtMST = dtGMT.format('yyyy-MM-dd HH:mm:ss', 'MST');
String Year = String.valueOf(dtMST.substring(0, 4));
String Month = String.valueOf(dtMST.substring(5, 7));
String Day = String.valueOf(dtMST.substring(8, 10));
String Hours = String.valueOf(dtMST.substring(11, 13));
String Mins = String.valueOf(dtMST.substring(14, 16));
String Secs = String.valueOf(dtMST.substring(17, 19));
system.debug('dtGMT'+dtGMT);
//Datetime format
system.debug('dtPST'+dtMST);
string stringDateFormat = Year + '-' + Month
+ '-' + Day+'T'+Hours + ':'
+Mins + ':' + Secs+'Z';
system.debug('stringDateFormat'+stringDateFormat);
//Query
query = ' select First_Name__c,Last_Name__c,State__c, '+
' Zip_Postal_Code__c,Comments__c ' +
' from Member_List_Stage__c '+
' where createdDate > '+stringDateFormat+'' ;
- feelsfdc
- February 09, 2010
- Like
- 0
- Continue reading or reply
Too many DML statments:21
I am getting the "too many dml statements" error when I do a bulk update. I realize that the problem is that I have an insert statement inside a for loop but I am unsure of how to resolve the issue. How do I get the fields I want to update into a map or list so that I can then update them all at once? I am confused about the syntax...Here is the portion of my code that is giving me a problem... thanks!!!!!
///Part 2 B update //if health, update the health market if (HealthGo) { for(Account a: accts){ a.Health_Market__c=Market; a.Health_Renewal_Date__c=RenewalDate; a.Health_Underwriter_Assigned__c = Underwriter; update accts; } } else{ } //if dental, update the dental market if (DentalGo) { for(Account a: accts){ a.Dental_Market__c=Market; a.Dental_Renewal_Date__c=RenewalDate; update accts; } }
- fredka
- February 09, 2010
- Like
- 0
- Continue reading or reply
How to upload *.csv file from client???
Hi all,
I have an issue about upload a *csv file to Force.com. My customers want to upload a *csv file to force.com but do not like to use dataloader, I must develop VisualForce page that allows customers can upload file, so anyone can help me this problem??? Please!!!
- Phantom
- February 08, 2010
- Like
- 0
- Continue reading or reply
pageblockTable displayed differently in different browser, some borders are missing in blank cell
Hi, pageblockTable is displayed differently in IE & Firefox & others, specifically some borders are missing in some blank cells.
Showing correctly:
How to make it display the border for all cells? i have border="1" in myVF markup.
Thanks.
- CTU007
- February 05, 2010
- Like
- 0
- Continue reading or reply
Outbound Message not hitting my server
Also, there are no entries in the outbound messaging monitor.
How do I verify that messages are being sent? Is there a log that shows every outbound message and the message body?
- Adomatic
- January 28, 2010
- Like
- 0
- Continue reading or reply
Setting the http response status code on a visualforce page
I've been pouring over the docs and forums but haven't been able to determine if there's a way to set the http response code on a call to a visualforce page.
For example, I'd like to return 500 if I encounter an error in my Apex code and 200 if everything works.
Thanks,
- Ron Wild
- March 01, 2009
- Like
- 0
- Continue reading or reply
Salesforce.com Content in Developer Edition Org
- md1
- February 24, 2009
- Like
- 0
- Continue reading or reply