-
ChatterFeed
-
54Best Answers
-
0Likes Received
-
0Likes Given
-
55Questions
-
415Replies
Opportunity Attachment Trigger help to set Attachment Attributes
I am trying to write a trigger to set an Opportunity Attachment attribute Private flag set to true, whenver an attachement is added/updated on opportuntiy record, I am new to trigger any help would be greatly appreciated.
thank you
Nagesh Vattikonda
- Nagesh Vattikonda5
- October 19, 2016
- Like
- 0
- Continue reading or reply
Images syntax not working with static source within force.com site
I created a force.com site but can't get two images to render onto the page. I have static resources setup correctly as the reset of the CSS and js is showing up correctly on the page, except the logo and background image.
This is my syntax used for the two images in question.
<section class="mbr-section mbr-parallax-background" style="background-image: url(assets/images/3-wide-2000x913-68.jpg); padding-top: 80px; padding-bottom: 80px;">
<div class="mbr-figure"><img src="assets/images/starbucks-1400x1400-6.png"></img></div>
I've even added these apex stylesheet syntax's to my visualforce page, but I need to modify the CSS Syntax to point to apex syntax in the static source:
<apex:stylesheet value="{!URLFOR($Resource.styles, 'assets/images/starbucks-1400x1400-6.png')}"/>
<apex:stylesheet value="{!URLFOR($Resource.styles, 'assets/images/3-wide-2000x913-68.jpg')}"/>Can someone help me with the CSS Syntax to point to the static source?
Thank you!
- HNT_Neo
- October 19, 2016
- Like
- 0
- Continue reading or reply
Best way to map values in a trigger - case vs else if
trigger MapDataCOMIndustry on Account (before insert, before update) { for(Account a1: Trigger.new){ if(a1.industry=='Government'){ a1.industry='Emergency Services'; } } }
Now I have to do that for a long list of industries, see below. What is the best way to write this in the trigger? Can I use something like a "case" method? Or does it need to be a bunch of else if statements?
trigger MapDataCOMIndustry on Account (before insert, before update) { for(Account a1: Trigger.new){ if(a1.industry=='Government'){ a1.industry='Emergency Services'; } else if(a1.industry=='Agriculture'){ a1.industry='Agriculture & Fisheries'; } else if(a1.industry=='Apparel'){ a1.industry='Other'; } else if(a1.industry=='Banking'){ a1.industry='Finance'; } } }
- Katherine Rowe
- October 07, 2016
- Like
- 0
- Continue reading or reply
Deployment Component Error: No such column 'Single_Donor__c' on entity 'OpportunityLineItem'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name.
error is
No such column 'Single_Donor__c' on entity 'OpportunityLineItem'. 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.
if(quoteRecordtype=='Primary Cells Request'){ olist = [Select Id, OpportunityId, SortOrder, PricebookEntryId, Quantity,ETA__c, TotalPrice, UnitPrice, ListPrice, ServiceDate, Description, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Sales_Discount__c,opportunity.recordtype.name, Age__c,Anticoagulant__c,Cell_Isolation__c,Cells_per_Vial__c,Multiple_Donors__c,Single_Donor__c,Product_State__c,Desired_Cell_type__c, Donor_Blood_Type__c,End_Age__c,Ethnicity__c,Gender__c,Healthy_Tissue_Type__c,Product_Specifications__c, Medication_Constraints__c,Other_Info__c,Medication_Constraints_Other__c,Specific_Donor_s__c,HLA_Type__c,ADCC_Status__c, Other_Requirements__c,additional_testing__c,Spec_Description__c,Smoker__c,Unit_Cost_Price__c,Discount,CurrencyISOCode, IsDeleted , PricebookEntry.Name, PricebookEntry.Product2id, Shipping_Cost__c, PricebookEntry.Product2.recordtype.name, PricebookEntry.Product2.Part_Id__c From OpportunityLineItem where OpportunityId = :quote.Opportunity__c and product_sector__c = 'Primary Cells']; }
Thanks.
- Ram Arza
- September 09, 2016
- Like
- 0
- Continue reading or reply
Visibility of records to a records,| uncertain reasons
I have a custom object which is private and it has 3 lookups.
There are 200 records for this object in total but a user can see 100 records.
I have checked sharing criterias but the user is not part of this group, so i was thinking may it is related to lookup records.
thank you for suggestion !
- Ab
- September 01, 2016
- Like
- 0
- Continue reading or reply
Related List component causing Insufficient Privileges
<apex:page standardController="Order__c"> <apex:relatedList list="Cases"/> </apex:page>
This is in one of my sandbox orgs. I have System Admin permissions. Yet, I get an Insufficient Privileges error on page load. The Cases related list does work on the standard layout. I am not sure which permission I should change. Thanks!
- Patrick Mayer 4
- July 16, 2015
- Like
- 0
- Continue reading or reply
Help with Trigger
I am stuck on a trigger. I want this to populate the Inside Sales Representative on the record being saved. However I am getting an error:
Review all error messages below to correct your data.
Apex trigger OpportunityISR caused an unexpected exception, contact your administrator: OpportunityISR: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.OpportunityISR: line 5, column 1
Here is the Trigger Code:
trigger OpportunityISR on Opportunity (before insert){
Opportunity oppty;
Set<Id> OpptyId= new Set<Id>();
if(oppty.Inside_Sales_Representative__c == null) {
oppty.Inside_Sales_Representative__c = Userinfo.getUserId();
System.debug('Setting Sales Representative to ' + Userinfo.getUserId());
} else {
if(Trigger.isInsert) {
oppty.Inside_Sales_Representative__c = Userinfo.getUserId();
System.debug('Setting Opportunity Owner to ' + Userinfo.getUserId());
}
}
}
- kev388
- June 06, 2014
- Like
- 0
- Continue reading or reply
Date to string one day less
I converted my date field in string, so I can updated my other field in account.
for (Account acc: [SELECT Id, Data_pedido_AR__c, Data_pedido_SA__c FROM Account WHERE id IN: ids]){
for (Case c: trigger.new) {
if(c.motivo__c == 'Formandos AR' && c.Data_pedido_AR__c != null && Trigger.oldMap.get(c.id).Data_pedido_AR__c != c.Data_pedido_AR__c){
Datetime d = Date.Valueof(c.Data_pedido_AR__c);
String dateStr = d.format('dd/MM/yyyy');
System.debug('::::::::::: ' + dateStr) ;
acc.Data_pedido_AR__c = dateStr;
}
update acc;
It works fine but in my account my field is one day less.
If I put c.Data_pedido_AR__c = 20/05/2014
I get acc.Data_pedido_AR__c = 19/05/2014
Why?
- EvertonSzekeres
- May 20, 2014
- Like
- 1
- Continue reading or reply
Controller Field not updated
Hello,
I have been looking at an unusual situation.
I'm editing a record, specifically a lookup field on the record (which has up to this point been null). I have an action support (onchange) on the field that triggers a rerender on a picklist field that gets its options from a function in the controller that uses the lookup field value in a SOQL query.
The problem is that the value of the lookup field is still NULL when the query runs in the function.
However, if I fill in the lookup field, save and edit again, this time if I change the lookup field, the value IS up to date in the controller when I go and do the query.
What can be causing this? what can I do?
How can I get the value in the input field in a reliable way?
Here is the APEX Page and the Controller. (nPrescripcion.Medicamento__c is the lookup field that is not up to date in the controller when I run the query, I know this based on a system.debug statement)
<apex:page standardController="Prescripcion_Paciente__c" showHeader="false" sidebar="false" extensions="PrescripcionExtension"> <apex:form style="padding-left:25px;padding-right:25px;padding-top:25px;"> <apex:pageBlock title="Prescripción" tabstyle="Tratamiento__c" mode="edit" > <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save" /> <apex:commandButton action="{!cancel}" value="Cancelar" id="btn_Cancel"/> </apex:commandButton> </apex:pageBlockButtons> <apex:pageBlockSection id="MedicamentoVE" title="Medicamento" showHeader="true" collapsible="false" columns="2" > <apex:inputField label="Principio Activo" id="iPrincipioActivo" required="true" value="{!Prescripcion_Paciente__c.Medicamento__c}"> <apex:actionSupport event="onchange" reRender="iMarca1,iMarca2" /> </apex:inputField> <apex:selectList value="{!Prescripcion_Paciente__c.Marca_Comercial_1__c}" size="1" id="iMarca1" required="false"> <apex:selectOptions value="{!MarcasComerciales}"/> </apex:selectList> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
public class PrescripcionExtension { private Prescripcion_Paciente__c nPrescripcion; public ApexPages.StandardController stdCtrl { set; get; } public PrescripcionExtension (ApexPages.StandardController controller) { this.nPrescripcion= (Prescripcion_Paciente__c)controller.getRecord(); stdCtrl=controller; } public List<SelectOption> getMarcasComerciales() { List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('','--Ninguna--')); options.add(new SelectOption('Otra','Otra')); system.debug(nPrescripcion.medicamento__c); Tratamiento__c[] nMeds = [Select marcas__c from Tratamiento__c where id=:nPrescripcion.medicamento__c]; if (nMeds.size()>0){ if (nMeds[0].marcas__c!=null && nMeds[0].marcas__c!='') { String[] marcas = nMeds[0].marcas__c.split(';'); for (Integer j=0;j<marcas.size();j++) { options.add(new SelectOption(marcas[j],marcas[j])); } } } return options; } }
- dfpitt
- May 06, 2013
- Like
- 0
- Continue reading or reply
How to Use Custom Setting To Get Name Of Static Resource To Set In <apex:includeStript
Hello,
I have a custom setting which stored the name of a JavaScript file. I wish to get the name from the custom setting and include it when referencing/including a JavaScrpt file in my visualforce page.
I tired to do the following
<apex:includeScript value="{!URLFOR($Resource[MyCustomObject__c.getInstance(Site.getName()).javaScriptFileName__c])}"/>
and
<apex:includeScript value="{!$Resource.[MyCustomObject__c.getInstance(Site.getName()).javaScriptFileName__c]}"/>
but these would not save correctly.
For the above requirement, should this be possible, to get a custom setting value at the same time as trying to set it as a resource to load with my visualforce page?
Thanks in advance for any help.
- SalesRed
- May 03, 2013
- Like
- 0
- Continue reading or reply
Including image on VF page
I'm looking to create a simple data sheet for an individual record that includes an image created and uploaded by a user. I'd like the user to be able to use the standard "Notes & Attachments" to add the image to the record, but I don't see any examples of being able to embed a Notes & Attachments image in a VF page. Is this possible? How can I avoid the user having to either (A) edit a static resource or (B) upload to a different server and then paste the URL?
- ethanone
- February 25, 2013
- Like
- 0
- Continue reading or reply
User Personlization Features in a Visualforce based HOME page
Has anyone worked in developing a typical Web Portal kind HOME page within SFDC?
We are trying to figure out best way to design this solution which should show multiple subsections within home page
1. One widget for Chatter feed
2. another widget for my alerts
3. one subsection for showing document links pertaining to User role in org
This is not hard coded VF but each application user should be able to personalize this page as per his/her preferences, not limited to below
1. Choosing which widget to add in their HOME page view
2. Choosing placement of Widget on HOME page (top left, bottom right)
3. Skins and Themes of HOME page
If anyone has done something similar and can share relevant experience as to how they handled it, any roadblock faced etc, it will be greatly helpful.
Thanks
Satgur
- Satgur
- March 15, 2012
- Like
- 0
- Continue reading or reply
Get the instance URL for a Visualforce page
Hi,
I have a VisualForce page with a link:
https://na1.salesforce.com/apex/Visualforce_Page
Soon we are migrating from na1 to another instance and would like to know how to automatically retrieve the Salesforce Instance to do the same changes in all the visualforce pages.
I have tried to use relative links as in any custom link:
/apex/Visualforce_Page
but is not working
I have found this link below
Does anyone knows how should I replace
https://na1.salesforce.com/apex/Visualforce_Page
So next month with the instance change all will keep working?
Thank you
- Depton
- March 13, 2012
- Like
- 0
- Continue reading or reply
create a hyper link if the value entered is a url in <apex:inputTextarea>
Hi can anyone help me with creating a hyper link it the value entered is a url in the textbox.
thanks in advance to anyone who helps :)
- AnshulJain
- March 12, 2012
- Like
- 0
- Continue reading or reply
I wanna make a reset button on vf page, that clears the values given in the form
Hi,
I've made a custom search page. Its has a <apex:form> which contains the paramaters of search. I wanna create a reset button, that does two things. Firstly it should clear all the values given in the <apex:form> and then it sould render the lower <apex:pageblocksection> that displays the serach results. Please help me!!!!!
- shrey.tyagi88@tcs.com
- March 08, 2012
- Like
- 0
- Continue reading or reply
Loop and objects
<body>
Hi,
I want to do something like this in Page:
for (j=0; j< {!getGetMyDossiersIntilak.size}; j++ ) { geocoder.geocode( { 'address':'{!getGetMyDossiersIntilak[j].Ville__c}' }, function(results, status)
But it's not working because of the variable "j" in {!getGetMyDossiersIntilak[j].Ville__c} . If I put an integer number instead as "0" it will work but I want to make it work with a variable.
Some help please :)
</body>
- nextdoor
- March 07, 2012
- Like
- 0
- Continue reading or reply
Code sample required - Salesforce integration with Java application
Hi,
Can anyone explain me the steps to be followed to invoke an apex webservice from the Java application? It would be grateful if you attach some code samples or reference.
Regards,
SuBaa
- subaa
- February 21, 2012
- Like
- 0
- Continue reading or reply
Conditional highlighting in reports
I don't know exactly where to post this, so here it is....
I woud like to have a custom object report that takes the value of a field (#red, #yellow, or #green) and highlights the background of that record in that colour, in the report. It's not a summary field; it's a field that would be set by the record owner. It's intended to make it easier for the execs to zoom in on which records are in trouble.
Any idea of how to do this?
- DSimpson
- February 14, 2012
- Like
- 0
- Continue reading or reply
Visualforce Dashboard
Is there a way to reconstruct/recreate a dashboard in a visualforce page?
I am happy with all of the standard Salesforce dashboard components but I need to display them in a way other than the standard three column format. Is this possible? We have several large flat screen monitors posted on our sales floor but the three column layout doesn't use all of the horizontal real estate on the screen and some of the componenets are cut off becaue there isn't as much vertical space.
I essentially need to restyle the existing dashboard to fit the horizontal layout of the monitors. Our execs are requesting more visual metrics and they will not be visible in the standard layout. If anyone can give me some suggestions or point me to some code samples I'd really appreciate it.
Full disclosure: I am not a coder. I know enough HTML and CSS to be dangerous and I can implement/tweak just about any Javascript I find out in the wild. Thanks in advance.
-Natty
- NattyForce
- September 20, 2011
- Like
- 0
- Continue reading or reply
testing coverage for a controller extension
static testMethod void AssetAtRiskTest(){
Account acc = new Account(name = 'foo');
insert acc;
ApexPages.StandardController sc = new ApexPages.StandardController(acc);
PageReference pageRef = sc.view();
AssetAtRisk a = new AssetAtRisk(sc);
test.startTest();
test.setCurrentPage(pageRef);
pageRef = a.autoRun();
test.stopTest();
}
so this is my test code minus the assertions of course. The issue is that when the autorun function is running the following line always produces null.
String theId = ApexPages.currentPage().getParameters().get('id');
I would expect this line to set theId to the Id of the new account I created in the test method, however this is not the case. Am I missing something simple here?
- sroberts_ME
- August 12, 2011
- Like
- 0
- Continue reading or reply
Unable to generate sitemap.xml for community in sandbox
Any pointers on what might be wrong? The community is published and active in sandbox.
Thanks in advance !
- Edwin Vijay
- April 19, 2017
- Like
- 0
- Continue reading or reply
getDmlMessage returning complete error message and not truncated one
try{ update(itemsToUpdate); showsuccess = true; } catch(DmlException e){ for(integer i=0; i < e.getNumDml(); i++){ ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,e.getDmlMessage(i))); } showsuccess = false; return null; }
Error message:
OppLnItemTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 0064000000f8EeIAAU; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, The selected product does not exist in EDW yet.Please update your selection or try again later.: [] Class.TriggerHandlerBase.updateObjects: line 172, column 1 Class.TriggerHandlerBase.processObjects: line 61, column 1 Class.TriggerDispatcherBase.execute: line 128, column 1 Class.OppLnItemDispatcher.afterUpdate: line 78, column 1 Class.TriggerFactory.execute: line 43, column 1 Class.TriggerFactory.createTriggerDispatcher: line 19, column 1 Trigger.OppLnItemTrigger: line 2, column 1
I only want to display the error message: 'The selected product does not exist in EDW yet.Please update your selection or try again later'
Any help is appreciated. THANKS
- Edwin Vijay
- September 14, 2016
- Like
- 0
- Continue reading or reply
Data Extract from Salesforce has become much faster since May 12
We use a ETL tool to extract data from several salesforce objects on a daily basis. Since May 12 2016 on our NA2 instance there has been a significant decrease in the extraction time (jobs which took 30 minutes now only take 15 minutes). While this is great new, i was wondering what upgrades from Salesforce might have caused this? Any help is highly appreciated.
Thank You!!!!
- Edwin Vijay
- June 17, 2016
- Like
- 0
- Continue reading or reply
Can Reports open in 'Salesforce Classic' when i have 'Salesforce Lightning' switched ON
- Edwin Vijay
- March 30, 2016
- Like
- 0
- Continue reading or reply
Unable to retrieve and deploy all WORKFLOW components
We are using jenkins and SVN for source control. Below are the steps for the issue i am facing. Any help is greatly appreciated.
- I used the salesforce ANT tool to retrieve ALL workflow and pageLayout components from production.
- I used the retrived folder to deploy the same to production again.
- Error thrown:
- Workflow - Question : Cannot create workflow directly; must create the CustomObject first
- Workflow - SocialPost : Cannot create workflow directly; must create the CustomObject first
- Workflow - Reply : Cannot create workflow directly; must create the CustomObject firs
- Page Layout - FeedItem-Feed Item Layout: Layout must have at least 1 section
- Page Layout - SocialPost-Social Post Layout: Layout must have at least 1 section
- Edwin Vijay
- August 25, 2015
- Like
- 0
- Continue reading or reply
How to recreate a standard New/Edit page in Visualforce
I want to use the existing page layout and not manually define each field in the visualforce page.
Any help is highly appreciated.
- Edwin Vijay
- September 11, 2014
- Like
- 0
- Continue reading or reply
Cannot find symbol get
Here is the error i get,
helloworldservlet.java:145: cannot find symbol
symbol : method get(java.lang.String)
location: class com.sforce.soap.partner.sobject.SObject
I have the necessary imports, not sure what might be the problem.. Any ideas?
- Edwin Vijay
- March 09, 2012
- Like
- 0
- Continue reading or reply
Calling Controller method from extension class
Hello,
I am trying to call a controller's method in my extension class and was able to do it with the class.methodname syntax.
However, when i try to use the pagereference returned by the method i am unable to save the class with a error message "Unable to process the requested change"
Here is how my class looks like, this is the one that works
Public void savestep7() { savemeeting(); controller.save(); }
The one that does not work
Public Pagereference savestep7() { savemeeting(); Pagereference p = controller.save(); return p; }
- Edwin Vijay
- March 08, 2012
- Like
- 0
- Continue reading or reply
Salesforce Full License Vs Platform License
Hello,
How do i create a summary report which groups the users based on whether they are a FULL License or a PLATFORM License?
Had to do this using the data loader, is there a way to do this with standard reports?
Thanks!
- Edwin Vijay
- February 14, 2012
- Like
- 0
- Continue reading or reply
Cannot find symbol getField
Here is the error message.
Cannot find symbol
symbol : method getField(java.lang.String)
location: class com.sforce.soap.partner.sobject.SObject
I used the getId() method and the code works, only when i use getField the code doesn't.... Any pointers appreciated
- Edwin Vijay
- February 03, 2012
- Like
- 0
- Continue reading or reply
Visualforce Page on Blackberry - javascript issue
Hi All,
- Tried using visibility:hidden. It doesn't work as well.
- Tried document.getElementById('sample').setAttribute("style","display:block;"). Doesn't work.
Any help is much appreciated.
- Edwin Vijay
- August 23, 2011
- Like
- 0
- Continue reading or reply
Weird: Insufficient Privileges : You do not have the level of access.
Hello All,
I have a Visualforce Page which when viewed as an Admin works fine, the page has a rerender portion when on selecting a value from a drop down a couple of text boxes get rerendered.
I logged in as a different user and the page shows up fine, when i change the drop down the rerender gets called and i end up getting the message
"Insufficient Privileges You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. "
The VF page, the apex class, the extension class, the objects used (have C R E D), all have the permissions for this profile. Also, all fields of the associated objects are visible to this profile.
With this error message i am unable to get any clue of what is happening actually, it's just supposed to rerender a few text boxes which are not associated with any access privileages.
Moreover, the debug log says "SUCCESS" and all getter and setter methods are called fine. Its only when the page refreshes itself that something goes wrong somewhere.
Please let me know your thoughts.
Thanks,
Edwin
- Edwin Vijay
- March 29, 2011
- Like
- 0
- Continue reading or reply
Roll up Summary field not visible on Visualforce Page
- Edwin Vijay
- November 24, 2010
- Like
- 0
- Continue reading or reply
A Weird Behaviour - What might be the cause?
I just did a small visualforce page and saw that the date picker appears by default, i do not understand from where it came.. See Image below
Removed the apex:form tags and it disappears.. Did anyone face such similar issue???
- Edwin Vijay
- October 06, 2010
- Like
- 0
- Continue reading or reply
Authenticate Login to Salesforce
Hi All,
We have SSO enabled. When a user clicks on a link in our website, i would like to open up a visualforce page.
Since its through SSO, i just give the URL and the link opens up with no issues.
But i would like to authenticate the login of the user before showing the visualforce page, since its not always necessary that the user logs in through SSO before clicking the link.
One thought that came to my mind,
- Create a HTML page.
- Add this page to the link.
- Call a javascript function which validates the login of the user.
- If login is YES, display the Visualforce Page as a frame.
- If login is NO, display an error message.
Any thoughts or pointers to code samples would be highly appreciated.
Thank you,
Edwin
- Edwin Vijay
- August 12, 2010
- Like
- 0
- Continue reading or reply
Toolbar development
Hi all,
I am about to develop a toolbar for Chatter.
http://sites.force.com/answers/ideaView?id=087300000007p6mAAA . Exactly the idea of this user. I have a set of questions to determine if this is possible.
- Is there a way to show automatic notifications in the toolbar. If so, how can it be acheived ( should i call an external webservice everytime a new feed is created??)
Please forgive me, i dont know much about webservices except that they are used to send and receive data...
Any guidance is appreciated..
Thanks
- Edwin Vijay
- August 02, 2010
- Like
- 0
- Continue reading or reply
Chatter Survey app does not install
Hi All,
I tried installing this app from the appexchange and it does not install..
http://sites.force.com/appexchange/listingDetail?listingId=a0N30000003GJVoEAO
Any help is appreciated!!!
Thanks!
- Edwin Vijay
- July 23, 2010
- Like
- 0
- Continue reading or reply
Feeds in Home Page Vs Feeds in Profile Page
Hi All,
My requirement is simple... The chatter component on the Home Page has to be hidden. This is because we already have a lot of coponents in our home page and we actually do not have enough real estate for chatter...
I found a solution for this. I created a sidebar component, and hid the style "div" of the chatter component using "display:none;"... I also placed a button in the sidebar which says "Show Chatter" and when clicked the user is redirected to the Profile Tab....
But, i noticed that the feeds that show up in your home page (includes feeds from users you follow), is different from the feeds that show up in your Profile page (includes only feeds you post, or from records you follow)...
Is there a way to make the Profile Page show feeds in the same way as it shows in the Home Page...
Thanks in advance!!!
- Edwin Vijay
- July 09, 2010
- Like
- 0
- Continue reading or reply
document.write causes the UI to look weird
Hi All,
I have a custom application which has been developed using Visualforce. Everything works fine with the old User Interface theme.
I turned on the new User Interface theme, and the UI looks too bad. Luckily, i was able to narrow down on one particular line which has been causing this problem.
We have a javascript function which is used to track site visitors. This function has the following lines
<script language="JavaScript" type="text/javascript">
<!--
var s_code=s.t();if(s_code)document.write(s_code)
//-->
</script>
The colored part is a valid single line comment format in javascript, but not in visualforce. Hence, i had to remove the colored part and the function works as expected.
With the new UI, the document.write(s_code) statement causes my visualforce page to extend beyond the pageblock placeholder.
A sample of the image is below. Any suggestions highly appreciated.
Thanks,
Edwin
- Edwin Vijay
- June 17, 2010
- Like
- 0
- Continue reading or reply
New User Interface - Custom CSS Styling Issues
Dear All,
We have an application which consists of a set of Visualforce pages. We have used our own CSS files to apply custom look and feel to the pages.
Now, with the introduction of the new UI, our visualforce pages look messy. I debugged the pages and found out that our visualforce pages have a fixed width and all elements inside the page are aligned relative to the fixed width.
Here is a screenshot
However, the new UI displays a white block and our page does not fix into this white block.
<div id="Wrapper" class="leftbox">
The width of this div is 1200px - fixed in the CSS. If i make the div's width "auto" then all other elements get misaligned, however the white block of the new UI extends to fit my page.
Thanks for any help that you can provide...
Regards,
Edwin
- Edwin Vijay
- May 28, 2010
- Like
- 0
- Continue reading or reply
Can anyone help me write Test Class for mentioned Apex Class
Event Trigger Handler
public class EventTriggerHandler {
public static String comma = ',';
public static void AfterInsert(Map<id, Event> EventMap)
{
try
{
String NameTitle ='';
String Names;
List<EventRelation>EveRelationList=New List<EventRelation>();
EveRelationList = [SELECT Id, RelationId,EventId FROM EventRelation WHERE EventId In : eventMap.keyset() and RelationId != null];
system.debug('AfterInsert count_____'+EveRelationList.size());
Set<Id> WhoIds = New set<Id>();
for(EventRelation eveRel : EveRelationList){
WhoIds.add(eveRel.RelationId);
system.debug('WhoIds after insert_____'+WhoIds);
}
List<Contact> ConList = New List<Contact>();
ConList=[Select Id,Title,FirstName,LastName, Name FROM Contact WHERE Id In : WhoIds and Title != null and Name != null];
for(Contact c : ConList){
if(c.Title!= null)
{
NameTitle = NameTitle+c.Name + '(' + c.Title + ')' + comma ;
}
}
Names = NameTitle.removeEnd(comma);
System.debug('Names' + Names);
List<Event> eventList = new List<Event>();
for (Event e : [select id, Title__c from Event where Id in: eventMap.keyset()])
{
e.Title__c = Names;
eventList.add(e);
}
update eventList;
}
catch(exception e)
{
throw e;
}
}
}
Event Trigger
trigger EventTrigger on Event (before insert, before update, after insert) {
if (Trigger.IsBefore) {
if (Trigger.isInsert) {
}
if (Trigger.isUpdate) {
}
}
if(Trigger.IsAfter)
{
if (Trigger.isInsert) {
EventTriggerHandler.AfterInsert(trigger.newMap);
}
}
}
- Bharat S
- June 17, 2019
- Like
- 0
- Continue reading or reply
javascript was working yesterday but now is not
So I had two buttons that were working fine up until yesterday and now both of them are coming back with the same exact error message. They both do the same thing, allow an attachment to a list of e-mail addresses while date stamping a value. Their last modified date was 5/16/2016 and now they are both not working. Here is my code, I haven't run any updates. I am also willing to change this button as long as the same things can be accomplished.
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")} location.replace('/email/author/emailauthor.jsp?retURL=/{!Opportunity.Id}&rtype=003&p24={!Opportunity.OwnerEmail}&p4=(___EMAIL ADDRESSES REMOVED PURPOSELY___)&template_id=239291302&p6={!Opportunity.Name}'); var oppObj = new sforce.SObject("Opportunity"); oppObj.Id = '{!Opportunity.Id}'; var build = new Date(); var month = build.getMonth(); var day = build.getDate(); var year = build.getFullYear(); var today = new Date(year,month,day); try { oppObj.CL2_Binder_Date__c = today; sforce.connection.update([oppObj]); } catch(e) { console.log(e.message); }
- SFDC2 Admin2 7
- November 02, 2016
- Like
- 0
- Continue reading or reply
Opportunity Attachment Trigger help to set Attachment Attributes
I am trying to write a trigger to set an Opportunity Attachment attribute Private flag set to true, whenver an attachement is added/updated on opportuntiy record, I am new to trigger any help would be greatly appreciated.
thank you
Nagesh Vattikonda
- Nagesh Vattikonda5
- October 19, 2016
- Like
- 0
- Continue reading or reply
Images syntax not working with static source within force.com site
I created a force.com site but can't get two images to render onto the page. I have static resources setup correctly as the reset of the CSS and js is showing up correctly on the page, except the logo and background image.
This is my syntax used for the two images in question.
<section class="mbr-section mbr-parallax-background" style="background-image: url(assets/images/3-wide-2000x913-68.jpg); padding-top: 80px; padding-bottom: 80px;">
<div class="mbr-figure"><img src="assets/images/starbucks-1400x1400-6.png"></img></div>
I've even added these apex stylesheet syntax's to my visualforce page, but I need to modify the CSS Syntax to point to apex syntax in the static source:
<apex:stylesheet value="{!URLFOR($Resource.styles, 'assets/images/starbucks-1400x1400-6.png')}"/>
<apex:stylesheet value="{!URLFOR($Resource.styles, 'assets/images/3-wide-2000x913-68.jpg')}"/>Can someone help me with the CSS Syntax to point to the static source?
Thank you!
- HNT_Neo
- October 19, 2016
- Like
- 0
- Continue reading or reply
cant use multiple If statements in formulas
Hi Everyone,
I am using the developer edition and my question is regarding adding multiple If statements to formulas within an object.
I am trying to write a formula to assign a value to certain feilds so I can create a score for each account and rate them base on the score.
For example, one of the creiteria for the score is a feild name, "Number of properties" which happens to be 30 I want to assign a score of 25.
using if : IF(logical_test, value_if_true, value_if_false)
Heres what i got so far:
IF((number_of_property__c <= 5), 5, 0)
IF((5 < number_of_property__c) <= 10), 10, 0)
IF((10 < number_of_property__c) <= 20),15, 0)
IF((20 < number_of_property__c) <= 30),20, 0)
IF((30 < number_of_property__c)),25, 0)
i keep getting a "Error: Syntax error. Extra IF" on the second IF on line 2
if there is a better way to do this or if you know why im getting this error please let me know anything helps
- Subs K
- October 18, 2016
- Like
- 0
- Continue reading or reply
Migration using ANT tool.
How can i get Reports and dashboards in to my local folder?
How can i retrieve them from one org?
Also email templates?
Do i need to indivdually get field updates and other?or just workflow rule brings them?
Thank you .
- Linda 98
- October 18, 2016
- Like
- 0
- Continue reading or reply
Getting Error "'OpportunityProjectItems__r' is not a valid child relationship name for entity Project " on visual force page while clicking project to open. Can you suggest how to resolve this?
This is happening only for one profile
- vasundhara rani
- October 13, 2016
- Like
- 0
- Continue reading or reply
Unable to Display Knowledge Article Images(Rich Text Area) using JSP
I am using JSP and Rest Api to access Knowledge Articles.
I get the articles but the images are broken.
I changed the url in all img tags as https://["domainName"].cs15.force.com/servlet/rtaImage?eid=ka**********&feoid=*********&refid=*********
Still I dont see the images in the Knowledge article.
Can somebody help?
Thanks,
Jayesh
- Jayesh_Tejwani
- October 12, 2016
- Like
- 0
- Continue reading or reply
Need to count Related Records on a Custom Object.
I am an admin, I am trying to create a field that counts total number of Acconts for custom object "Building". There is no relationship between these two objects.
I'm not sure of the best way to accomplish this. Any suggestions would be helpful!
- Sruthi Manchala
- October 07, 2016
- Like
- 0
- Continue reading or reply
Best way to map values in a trigger - case vs else if
trigger MapDataCOMIndustry on Account (before insert, before update) { for(Account a1: Trigger.new){ if(a1.industry=='Government'){ a1.industry='Emergency Services'; } } }
Now I have to do that for a long list of industries, see below. What is the best way to write this in the trigger? Can I use something like a "case" method? Or does it need to be a bunch of else if statements?
trigger MapDataCOMIndustry on Account (before insert, before update) { for(Account a1: Trigger.new){ if(a1.industry=='Government'){ a1.industry='Emergency Services'; } else if(a1.industry=='Agriculture'){ a1.industry='Agriculture & Fisheries'; } else if(a1.industry=='Apparel'){ a1.industry='Other'; } else if(a1.industry=='Banking'){ a1.industry='Finance'; } } }
- Katherine Rowe
- October 07, 2016
- Like
- 0
- Continue reading or reply
Populate PickList data with custom field
It's my first post on salesforce community .Brand new in salesforce .
I want to populate picklist data from custom field .
I Created one custom object City and City name is field just create some record .
Now i want to populate city name inside picklist .Is there any way to do this without code .
Thanks in advance !!
- Gautam Kumar 63
- October 04, 2016
- Like
- 0
- Continue reading or reply
Render outputtext value if account field equals/contains string
I'm composing an email template that will have variable text only if the account subtype (custom field) validates against a set value for premium customers. The end results would be something like:
I have tried every combination of IF and CONTAINS I can think of, defining the premium text as both an inline value and as the contents of a containing tag, including the examples below:
<apex:outputtext value=" and you have access to our premium services" rendered="{!CONTAINS(Account.Sub_Type__c, "Premium Customer")}" />
<apex:outputtext value=" and you have access to our premium services" rendered="{!IF(CONTAINS(Account.Sub_Type__c, "Premium Customer"), true, false)}" />
<apex:outputtext rendered="{!IF(CONTAINS(Account.Sub_Type__c, "Premium Customer"), true, false)}"> and you have access to our premium services</apex:outputtext>
Is this a syntax issue, is this a problem with outputText? Can I not validate account fields in an email to a contact? Any help you can provide would be appreciated.
- Matthew Parker 6
- September 30, 2016
- Like
- 0
- Continue reading or reply
Create Knowledge Article from Attachment using Apex
We have a requirment where we have an attachment and on certain condition we will have to create a Knowledge Article with the attachment.
Any leads would be quite helpful.
Thanks in advance!!
- Gaurav Pandey 5
- September 29, 2016
- Like
- 0
- Continue reading or reply
Dynamically generated Sitemap.xml ?
Hi All,
Does Site.com support a way to dynamically generate a public accessible sitemap.xml file based on the sitemap you have created with site.com studio? If so, how?
Ideally it should be following the sitemaps.xml standard (http://www.sitemaps.org/protocol.html)
Or must we build one manually instead?
Any help and insight is greatly appreciated.
Thank you,
Yuri Lausberg
- Yuri Lausberg
- July 06, 2012
- Like
- 0
- Continue reading or reply