-
ChatterFeed
-
2Best Answers
-
0Likes Received
-
0Likes Given
-
25Questions
-
27Replies
Trigger doesn't update lookup field on related record
Hi everyone!
I have three objects that are linked together (Account, Project__c, Space__c). Both the Project and the Space have a lookup to an Account and the Project looks up to a Space. What I want to do is when I populate the Account on the Project record it will update the related Space with that same Account.
Here's my code:
trigger PopulateCurrentTenant on Project__c (after insert, after update) { Set<id> tenantIds = new Set<id>(); Set<id> spaceIds = new Set<id>(); for (Project__c p : Trigger.new){ tenantIds.add(p.Account__c); spaceIds.add(p.Space__c); } // query for all the tenant records for the unique tenantIds in the records // create a map for a lookup / hash table for the user info List<Account> tenants = [Select Id, Name from Account Where Id in :tenantIds]; Map<id, Account> tenantsMap = new Map<id, Account>(); for(Account a : tenants){ tenantsMap.put(a.Id,a); } List<Space__c> spaces = [Select Id, Name, Account__c from Space__c Where Id in :spaceIds]; Map<id, Space__c> spacesMap = new Map<id, Space__c> (); for(Space__c s : spaces){ spacesMap.put(s.Id,s); } // iterate over the list of records being processed in the trigger and // set the Existing Tenant on the Space after being inserted or updated for (Project__c p : Trigger.new){ Space__c thisSpace = spacesMap.get(p.Space__c);
Account thisTenant = tenantsMap.get (p.Account__c);
thisSpace.Account__c = thisTenant;
} }
The code deploys fine but there's only one issue: it doesn't do a thing; nothing happens when I edit a project. it just doesnt update the related space with the account.
Are the maps empty? Am I querying the data incorrectly?
Thank you in advance for your help!
-
- DDS
- September 15, 2010
- Like
- 0
- Continue reading or reply
Assign controller variable value in Visualforce page on page load
We're using Visualforce pages more and more here, but we've been working around something for a while that I think is probably pretty simple.
Many times, we have multiple visualpage pages that use different controllers (or extensions) based on the record type, or how many records we want to pull.
I see there are several different examples using javascript / params to have a user pass a variable value to a controller - we've been successful there. But I would simply like to set the variable value when the page loads, so for instance if they go to a page that is supposed to display only 30 records, verses a page that is supposed to display 180 records. Is there a simple way to pass this value to a controller variable using the <apex:page action=""> perhaps?
-
- jg@hhs
- September 13, 2010
- Like
- 0
- Continue reading or reply
Convert string to Blob properly
Hi All,
I am getting binary (.doc) file from external API by my APEX code.
Then I convert it to Blob format and save as an attachment.
When I try to download and open it with Word editor it tells this file is corrupted.
My code to convert string from external API to Blob:
Blob body = Blob.valueOf(httpResponse.getBody()); insert new Attachment( Name = filename, Body = body, ParentId = parentId);
How can I save it in a right format? I saw there are a lot of special characters in response from external API like:
PK!Ҩ0�� [Content_Types].xml �(��V�n�0�W�?D�V�@���8�ql�J?����ؖ����Q�BB��HQ��ٙݍ��*ς8��^�ehiT��1��t�Y�Qh%2�!fk�l8����k>����l�h8�r�𡱠�Kb\.�^ݔ[!?�x�۽��h�,0� z#.U���W�_�xbj��C�c�cy�����6K�@�Z� ��$I%(#�9Q��uF��TZ���M��$b�a��"m�2�7�m�!��(����������SUWs�;r.R��P���p����TA7�����h����j�Sw�u(��3�s���C�b�
Regards,
Mikhail
-
- miha198206
- October 04, 2012
- Like
- 0
- Continue reading or reply
Pagination for SOSL query
Hi,
Is it possible to make a SOSL query to retrieve more than 200 records? How can I make a paging to retrieve the records in small batched using SOSL?
Thank you.
Mikhail
-
- miha198206
- May 28, 2012
- Like
- 0
- Continue reading or reply
How to add images to flow screen in Flow Designer
Hello,
I have a few screens in my Visual Workflow and I would like to add images to some of the screens. I haven't found such capabilities. How can I achieve my goal?
Thanks,
Mikhail
-
- miha198206
- March 19, 2012
- Like
- 0
- Continue reading or reply
REQUIRED_FIELD_MISSING, Required fields are missing: [Library]: [Library]
Hello,
We have a managed package with functionality to insert CollaborationGroup record, It works fine in Managed Package Dev instance but in some other instances where that package is installed it shows 'REQUIRED_FIELD_MISSING, Required fields are missing: [Library]: [Library]' error during insert operation.
What is the reason of this error?
Source code (createResumePoolChatterGroup() method is called):
public static void createResumePoolChatterGroup() { CollaborationGroup resumePoolChatterGroup = getResumePoolChatterGroup(); if (resumePoolChatterGroup == null) { insert new CollaborationGroup(Name = 'Resume Pool', CollaborationType = 'Public'); } } private static CollaborationGroup getResumePoolChatterGroup() { List<CollaborationGroup> groupList = [ SELECT Id FROM CollaborationGroup WHERE Name = 'Resume Pool' LIMIT 1]; return (groupList.size() > 0) ? groupList[0] : null; }
Thanks,
Mikhail
-
- miha198206
- March 16, 2012
- Like
- 0
- Continue reading or reply
Error when escape '&' symbol in SOSL FIND statement
I have a code to find 'Why & not' keyword:
String query = 'FIND \'Why \\& not\' IN ALL FIELDS RETURNING Contact LIMIT 200'; List<sObject> sObj = Search.query(query)[0];
I escaped '&' symbol but when I run this code I get the error:
line 1:10 mismatched character '\' expecting '''
How can I solve it?
Thanks.
-
- miha198206
- April 07, 2011
- Like
- 0
- Continue reading or reply
Give access to Contact object for Site Guest User
Hello,
On my site I should get contact records but in my instance Contacts have 'Controlled by Parent' value and accounts have 'Private' value in Organization-Wide Defaults settings. What is the easiest way to give access to Contacts for Site Guest User in that case? I can't change Organization-Wide Defaults settings for account and contact.
-
- miha198206
- November 01, 2010
- Like
- 0
- Continue reading or reply
Can't apply css styles when renderAs="PDF"
I try to create the page from here: http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_page.htm
I've made a page:
<apex:page renderAs="pdf"> <style> body { font-family: Arial Unicode MS; font-size:72px;} </style> <h1>Congratulations</h1> <p>This is your new PDF</p> </apex:page>
But styles was not applied. How can I use css in PDF? Why does this code sample not work for me?
Thanks a lot.
Mikhail
-
- miha198206
- September 15, 2010
- Like
- 0
- Continue reading or reply
An unexpected error has occurred. Your solution provider has been notified.
Hello,
I developed a managed package. And some of my clients experience an error :
Argument 1 cannot be null
An unexpected error has occurred. Your solution provider has been notified. (TWE)
How can I find the reason of this error, at least line in source code where error has occured?
Thanks,
Mikhail
-
- miha198206
- September 09, 2010
- Like
- 0
- Continue reading or reply
Authorization Required page when error on the page
Users of the site are experiencing Authorization Required page in case of the error on the page. In documentation https://na7.salesforce.com/help/doc/user_ed.jsp?loc=help&target=sites_error_pages.htm§ion=integrate I found the following:
Authorization Required Page—The page users see when trying to access pages for which they do not have authorization.
Generic Error Page—The page users see when encountering generic exceptions.
I'd like to shiw to the users Generic Error Page when error has occured. How can I achive this?
Thanks.
Mikhail Ivanov
-
- miha198206
- September 06, 2010
- Like
- 0
- Continue reading or reply
DML commit when errors in trigger
I have a trigger. In this trigger I have a line:
contact.addError( 'Candidate \'' + contactQuery + '\' is already exists. This candidate can\'t be inserted. Existed candidate was updated');
After this line of code I put other line of code to update other record. Something like:
otherContact.Name = 'Test Name'; update otherContact;
Since I have an 'addError' statement in this trigger my 'update otherContact' statement is terminated. How can I update record in this case?
addError
-
- miha198206
- August 06, 2010
- Like
- 0
- Continue reading or reply
Tags development
I've create code to add tags to contacts programmatically
if (personalTagSelected != null)
{
TagDefinition personalTag = [
SELECT Name
FROM TagDefinition
WHERE id = :personalTagSelected];
ContactTag tag = new ContactTag(ItemId = id, Name = personalTag.Name, Type = 'Personal');
insert tag;
}
if (publicTagSelected != null)
{
TagDefinition personalTag = [
SELECT Name
FROM TagDefinition
WHERE id = :publicTagSelected];
ContactTag tag = new ContactTag(ItemId = id, Name = personalTag.Name, Type = 'Public');
insert tag;
}
string[] newPersonalTagsList = newPersonalTags.split(',');
for (string newPersonalTag : newPersonalTagsList)
{
newPersonalTag = newPersonalTag.trim();
ContactTag tag = new ContactTag(ItemId = id, Name = newPersonalTag, Type = 'Personal');
insert tag;
}
string[] newPublicTagsList = newPublicTags.split(',');
for (string newPublicTag : newPublicTagsList)
{
newPublicTag = newPublicTag.trim();
ContactTag tag = new ContactTag(ItemId = id, Name = newPublicTag, Type = 'Public');
insert tag;
}
But I get an exception:
An internal server error has occurred An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.
Thank you again for your patience and assistance. And thanks for using salesforce.com!
Error ID: 261134118-25955 (-1455206483)
How can I solve it?
-
- miha198206
- May 24, 2010
- Like
- 0
- Continue reading or reply
Show columns in related list
I've made a custom object (Asset) which has a lookup field to Case object. I added Assets related list to Case page layout and select in Assets related list 5 columns. Then I saved page layout. But when I go to Case detail page I see Name field in Assets related list only. What can be the reason of this? How to solve it?
Mikhail
-
- miha198206
- May 20, 2010
- Like
- 0
- Continue reading or reply
Different field types in search criteria
Hello,
I want to make custom search visualforce page. And give to users ability to select field name (like Account Owner, Expiration Date, etc.) then select operator (like equals, not equals, etc.) then select value (for Account Owner it should show lookup, for Expiration Date it should show date selection calendar).
What is the easiest way to achieve this?
Thanks.
-
- miha198206
- May 11, 2010
- Like
- 0
- Continue reading or reply
Certified Salesforce.com administrator/developer is looking for offsite jobs. My rate is $20/hour.
Hello,
My name is Mikhail Ivanov and I am from Belarus.
I am a senior certified administrator and developer on Salesforce.com platform. I work in IT industry for already 8 years. I am looking for opportunities to work as an administrator and developer in projects on Force.com platform.
I do Salesforce.com projects for 2,5 years. I have the following certificates ‘Salesforce.com Certified Administrator’ and ‘Salesforce.com Certified Force.com Developer’. Also I am the #1 rank on oDesk Salesforce test (Please see it here http://www.odesk.com/users/Salesforce-com-ranked-oDesk-test-CRM-Certified-Professional_~~101ae687537ebfa4?sid=49002&recent=no&tot=32&pos=3#tests).
Also I have a wide experience and knowledge in websites development including ASP.NET 3.5, MVC, Web Services and integration with a lot of applications. I am able to make integrations of SalesForce.com with other applications using web services or other approaches.
My clients are from USA, Netherlands, Australia and Germany.
My rate is $20/hour.
If I can provide you with any further information on my background and qualifications, please let me know.
I look forward to hearing from you.
Regards,
Mikhail Ivanov
Email: mikhail.ivanov@itasabc.com
Skype: miha1982062
-
- miha198206
- May 11, 2010
- Like
- 0
- Continue reading or reply
Certified Salesforce.com administrator/developer is looking for offsite jobs. My rate is $20/hour.
Hello,
My name is Mikhail Ivanov and I am from Belarus.
I am a senior certified administrator and developer on Salesforce.com platform. I work in IT industry for already 8 years. I am looking for opportunities to work as an administrator and developer in projects on Force.com platform.
I do Salesforce.com projects for 2,5 years. I have the following certificates ‘Salesforce.com Certified Administrator’ and ‘Salesforce.com Certified Force.com Developer’. Also I am the #1 rank on oDesk Salesforce test (Please see it here http://www.odesk.com/users/Salesforce-com-ranked-oDesk-test-CRM-Certified-Professional_~~101ae687537ebfa4?sid=49002&recent=no&tot=32&pos=3#tests).
Also I have a wide experience and knowledge in websites development including ASP.NET 3.5, MVC, Web Services and integration with a lot of applications. I am able to make integrations of SalesForce.com with other applications using web services or other approaches.
My clients are from USA, Netherlands, Australia and Germany.
My rate is $20/hour.
If I can provide you with any further information on my background and qualifications, please let me know.
I look forward to hearing from you.
Regards,
Mikhail Ivanov
Email: mikhail.ivanov@itasabc.com
Skype: miha1982062
-
- miha198206
- May 11, 2010
- Like
- 0
- Continue reading or reply
Save error: Unable to perform save on all files
Hello.
'Save error: Unable to perform save on all files: An unexpected error has occurred. Please try again, or check the log file for details'
I received this error in Force.com IDE when I tried to save APEX class. How can I see log file?
Thanks,
Mikhail
-
- miha198206
- May 03, 2010
- Like
- 0
- Continue reading or reply
Certified Salesforce.com administrator/developer is looking for offsite jobs. My rate is $20/hour
Hello,
My name is Mikhail Ivanov and I am from Belarus.
I am a senior certified administrator and developer in Salesforce.com. I work in IT industry for already 8 years. I am looking for opportunities to work as an administrator and developer in projects on Force.com platform.
My experience in Salesforce.com is 2,5 years. I have the following certificates ‘Salesforce.com Certified Administrator’ and ‘Salesforce.com Certified Force.com Developer’. Also I am the #1 rank on oDesk Salesforce test (Please see it here http://www.odesk.com/users/Salesforce-com-ranked-oDesk-test-CRM-Certified-Professional_~~101ae687537ebfa4?sid=49002&recent=no&tot=32&pos=3#tests).
Also I have a wide experience and knowledge in websites development including ASP.NET 3.5, MVC, Web Services and integration with a lot of applications. I am able to make integrations of SalesForce.com with other applications using web services or other approaches.
My clients are from USA, Netherlands, Australia and Germany.
My rate is $20/hour.
If I can provide you with any further information on my background and qualifications, please let me know.
I look forward to hearing from you.
Regards,
Mikhail Ivanov
Email: mikhail.ivanov@itasabc.com
Skype: miha1982062
-
- miha198206
- April 19, 2010
- Like
- 0
- Continue reading or reply
Certified Salesforce.com administrator/developer is looking for offsite jobs. My rate is $20/hour.
Hello,
My name is Mikhail Ivanov and I am from Belarus.
I am a senior certified administrator and developer in Salesforce.com. I work in IT industry for already 8 years. I am looking for opportunities to work as an administrator and developer in projects on Force.com platform.
My experience in Salesforce.com is 2,5 years. I have the following certificates ‘Salesforce.com Certified Administrator’ and ‘Salesforce.com Certified Force.com Developer’. Also I am the #1 rank on oDesk Salesforce test (Please see it here http://www.odesk.com/users/Salesforce-com-ranked-oDesk-test-CRM-Certified-Professional_~~101ae687537ebfa4?sid=49002&recent=no&tot=32&pos=3#tests).
Also I have a wide experience and knowledge in websites development including ASP.NET 3.5, MVC, Web Services and integration with a lot of applications. I am able to make integrations of SalesForce.com with other applications using web services or other approaches.
My clients are from USA, Netherlands, Australia and Germany.
My rate is $20/hour.
If I can provide you with any further information on my background and qualifications, please let me know.
I look forward to hearing from you.
Regards,
Mikhail Ivanov
Email: mikhail.ivanov@itasabc.com
Skype: miha1982062
-
- miha198206
- April 08, 2010
- Like
- 0
- Continue reading or reply
From sandbox to production
Hello.
What is the easiest way to transfer changes from sandbox to production? Don't know what to do. Is there any other way in addition to using Force.com IDE?
Thanks
-
- miha198206
- April 02, 2010
- Like
- 0
- Continue reading or reply
Certified Salesforce.com administrator/developer is looking for offsite jobs. My rate is $20/hour.
Hello,
My name is Mikhail Ivanov and I am from Belarus.
I am a senior certified administrator and developer in Salesforce.com. I work in IT industry for already 8 years. I am looking for opportunities to work as an administrator and developer in projects on Force.com platform.
My experience in Salesforce.com is 2,5 years. I have the following certificates ‘Salesforce.com Certified Administrator’ and ‘Salesforce.com Certified Force.com Developer’. Also I am the #1 rank on oDesk Salesforce test (Please see it here http://www.odesk.com/users/Salesforce-com-ranked-oDesk-test-CRM-Certified-Professional_~~101ae687537ebfa4?sid=49002&recent=no&tot=32&pos=3#tests).
Also I have a wide experience and knowledge in websites development including ASP.NET 3.5, MVC, Web Services and integration with a lot of applications. I am able to make integrations of SalesForce.com with other applications using web services or other approaches.
My clients are from USA, Netherlands, Australia and Germany.
My rate is $20/hour.
If I can provide you with any further information on my background and qualifications, please let me know.
I look forward to hearing from you.
Regards,
Mikhail Ivanov
Email: mikhail.ivanov@itasabc.com
Skype: miha1982062
-
- miha198206
- March 30, 2010
- Like
- 0
- Continue reading or reply
Pagination for SOSL query
Hi,
Is it possible to make a SOSL query to retrieve more than 200 records? How can I make a paging to retrieve the records in small batched using SOSL?
Thank you.
Mikhail
- miha198206
- May 28, 2012
- Like
- 0
- Continue reading or reply
How to add images to flow screen in Flow Designer
Hello,
I have a few screens in my Visual Workflow and I would like to add images to some of the screens. I haven't found such capabilities. How can I achieve my goal?
Thanks,
Mikhail
- miha198206
- March 19, 2012
- Like
- 0
- Continue reading or reply
Hiring a Salesforce Application Developer (Apex, Visualforce, Force.com) (remote candidates welcome)
Primary Intelligence (www.primary-intel.com) is seeking an experienced application developer with Salesforce, Force.com, Apex, VisualForce and Triggers experience to join our team and lead the development, integration and maintenance of our force.com applications supporting Sales, Sales Management and Sales Support business processes.
This position will become the lead developer of a new, cutting-edge solution we have introduced as part of our solution set. You can review the first version here: Version 1.0
Our clients have recognized immense value from the barebones v1.0 product available to them today and Primary Intelligence needs a developer to join our team and take over the development of this key product. We have a robust product roadmap for the next 18 months for this product and now need to find the right person to lead the development efforts for v2.0 and beyond.
Local and remote candidates accepted (anywhere in the U.S.or Canada).
Review the full details of the opportunity here: Job Description
Feel free to contact me with any questions.
Ken Allred
kallred@primary-intel.com
- KenAllred
- September 12, 2011
- Like
- 0
- Continue reading or reply
Custom Visualforce Pages - Need a Quote
My organization (using enterprise edition) is looking for two custom visualforce pages. I would appreciate a quote on the following items:
Visualforce page for Lead Conversion that shows additional required fields for the conversion process
Visualforce page to combine the Account & Opportunity records into one screen to improve workflow for our users
It is really up in the air right now on exactly what we need, but based off the above, any ball park figure would be appreciated.
- stollmeyera
- April 26, 2011
- Like
- 0
- Continue reading or reply
Looking for custom app developer for Distribution/Inventory Mangement
We need this application to run on a mobile app device as well.
We have currently on Quickbooks which need to move to the cloud:
- All Clients (800 to 900 approx)
- Invoice balances/history/current
- What was sold (Approx. 25 products to choose from)
- When it was sold
- Product expiration dates (these are perishable food products)
- Company balance
The Overview of Operations:
Distributor (Me) --> Driver (Truck Inventory)---> Ending Client (800 to 900)
Between these 3 areas everyone should have access to REAL-TIME inventory, finances and related information. I want to be able to drill down on clients to see any current details. If there is an issue it will be "open" or "closed" for that client.
I am very serious about this project. Hope to hear from you soon.
Thanks
- QISanalyst
- April 22, 2011
- Like
- 0
- Continue reading or reply
Well Rounded Salesforce.com Consultant Required
AcuComp is a fast-growing national firm that sells our system to property-casualty insurance agencies to help them separate themselves from their competition.
We are looking to hire a Salesforce.com consultant to help replicate our current web-based application in the Salesforce.com Cloud environment.
You will be working directly with the technical manager of the current system throughout the entire length of the project.
Requirements:
1. Salesforce.com Architecture, Design, and Development experience
2. Visual Force, Apex experience
3. Data Migration experience
4. Must be able to work remotely with limited supervision
5. Must be task driven and respectful to committed deadlines.
We are looking for an individual with a wide variety of Salesforce.com skills. The individual needs to be competent with each skill listed above, but does not need to be an expert.
Must be available to start as soon as possible and be able to devote a majority of their work-time to the project until it is complete.
Qualified and interested candidates should email us at nias@monarchbizdev.com to learn more and submit your resume for consideration.
- acucomp
- April 10, 2011
- Like
- 0
- Continue reading or reply
Looking for freelance development support for portals
We have several projects taking place over the next 8 weeks and likely more beyond that. We would like to develop long term relationships with freelancers for these projects and new ones as they come up. We are looking for the following:
- 2-3 years of professional experience Salesforce development and configuration.
- Must have good knowledge and extensive work experience in development & implementation of multiple SFDC projects.
- A proven functional/technical professional with at least 2 full lifecycle Salesforce.com implementations.
- Admin-301, Dev-401 Salesforce certifications required. Dev-501 recommended.
- Strong programming (Apex, .net, or Java) background with web development experience.
- Strong experience with Integrations to other systems - social media & mobile a PLUS.
- Ability to translate business requirements into Technical Specifications.
- Outstanding written and verbal communication skills and attention to detail.
- Plone, Drupal or Joomla would be a plus
We are located in Westchester County, NY and would prefer that some work take place on site, but telecommuting is an option.
- Montrose
- March 17, 2011
- Like
- 0
- Continue reading or reply
Sr. developer or Technical Lead or Practice Manager needed to set up offshore operations
We are a Salesforce partner looking for an entrepreneurial individual with EXCELLENT technical skills and at least 2 years of experience with Salesforce to help set up an offshore operation.
This will be a hands-on position with responsibility to start and grow a team of Salesforce developers. Preference will be given to full time candidates. Initially, you will yourself be providing billable services to customers so you HAVE to know Salesforce inside and out! Also you MUST have excellent written and verbal English skills.
You may be located anywhere in Asia or Eastern Europe (India, Romania, Philippines, Argentina or South America)
Compensation - Competitive Salary + Equity
Please contact me at sandeepb"at"acutedge"dot"com if you are interested.
- sbanga - acutedge
- February 18, 2011
- Like
- 0
- Continue reading or reply
Request for Quotes
We are ISV partners looking for a developer to build a social networking platform with the following specs:
1) Subscriptions for Force.com paid "superusers" would be automatically tied to billing/deductions via Paypal or some other payment source.
2) Limited access standard users can sign up for Chatter Free accounts via a publicly accessible website so there is no need to internally "create" an account for just anybody.
Please include portfolio/links to examples of other Force.com development - preferably Chatter.
- BF7
- January 26, 2011
- Like
- 0
- Continue reading or reply
filtering users in apex code(Class) on users license type
Hi,
I have a requirement to filter users on the basis of user's license type.
I am able to access profile license type field in apex explorer but while using the same field in system log or apex class, it throws an error "no such fields on prfile"
kindly help
- rahularora
- September 15, 2010
- Like
- 0
- Continue reading or reply
Apex:inputField not work correctly for lookup field.
I have a very simple VF page, trying to insert a new record, but the Apex:inputField didn't work for lookup field.
Following is the sample code:
<apex:page controller="contactController"> <apex:form > <apex:pageBlock> <apex:pageBlockTable value="{!contacts}" var="con"> <apex:column value="{!con.Id}" headerValue="FP #"> <apex:facet name="footer"> <apex:commandLink value="Add" action="{!add}"/> </apex:facet> </apex:column> <apex:column value="{!con.AccountId}" headerValue="account"> <apex:facet name="footer"> <apex:inputField value="{!contact.AccountId}" required="true"/> </apex:facet> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
public class contactController { public assigntravelrates() { Contact = new Contact(); Contacts = [select Id, AccountId from Contact limit 2]; } public List<contact> Contacts { get; set; } public Contact Contact { get; set; } public void add() { insert Contact; } }
when I first time clicks the lookup icon and clicks the add link, it throws a error says "you must enter a value", then I choose the account again, it throws the "required field missing" error which is correct.
Did anyone have met the same issue?
- harry.31
- September 15, 2010
- Like
- 0
- Continue reading or reply
Can't apply css styles when renderAs="PDF"
I try to create the page from here: http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_page.htm
I've made a page:
<apex:page renderAs="pdf"> <style> body { font-family: Arial Unicode MS; font-size:72px;} </style> <h1>Congratulations</h1> <p>This is your new PDF</p> </apex:page>
But styles was not applied. How can I use css in PDF? Why does this code sample not work for me?
Thanks a lot.
Mikhail
- miha198206
- September 15, 2010
- Like
- 0
- Continue reading or reply
Trigger doesn't update lookup field on related record
Hi everyone!
I have three objects that are linked together (Account, Project__c, Space__c). Both the Project and the Space have a lookup to an Account and the Project looks up to a Space. What I want to do is when I populate the Account on the Project record it will update the related Space with that same Account.
Here's my code:
trigger PopulateCurrentTenant on Project__c (after insert, after update) { Set<id> tenantIds = new Set<id>(); Set<id> spaceIds = new Set<id>(); for (Project__c p : Trigger.new){ tenantIds.add(p.Account__c); spaceIds.add(p.Space__c); } // query for all the tenant records for the unique tenantIds in the records // create a map for a lookup / hash table for the user info List<Account> tenants = [Select Id, Name from Account Where Id in :tenantIds]; Map<id, Account> tenantsMap = new Map<id, Account>(); for(Account a : tenants){ tenantsMap.put(a.Id,a); } List<Space__c> spaces = [Select Id, Name, Account__c from Space__c Where Id in :spaceIds]; Map<id, Space__c> spacesMap = new Map<id, Space__c> (); for(Space__c s : spaces){ spacesMap.put(s.Id,s); } // iterate over the list of records being processed in the trigger and // set the Existing Tenant on the Space after being inserted or updated for (Project__c p : Trigger.new){ Space__c thisSpace = spacesMap.get(p.Space__c);
Account thisTenant = tenantsMap.get (p.Account__c);
thisSpace.Account__c = thisTenant;
} }
The code deploys fine but there's only one issue: it doesn't do a thing; nothing happens when I edit a project. it just doesnt update the related space with the account.
Are the maps empty? Am I querying the data incorrectly?
Thank you in advance for your help!
- DDS
- September 15, 2010
- Like
- 0
- Continue reading or reply
Using Style Sheet on VF Page
I have the following text file I uploaded as a static resource:
.centertext { text-allign: center; }
I am using the tabbed account and I have a controller extension that exposes some lists (because I want to split a custom object into 3 tabs based on record type.) I am trying to center 2 of the columns in the below section of the VF page (Base Members and Current Members) .. I added the reference at the top of the VF page to the static resource as follows:
<apex:page standardController="Account" extensions="EnrollmentAcctExt" showHeader="true" tabStyle="account" standardStyleSheets="false"> <apex:stylesheet value="{!URLFOR($Resource.AccountStyle, 'AccountStyle.css')}"/>
and here is my pageblock that brings in the listing... however, the base members field is not centering:
<apex:tab label="Health Enrollment" name="HealthEnrollment" id="HE" styleclass="AcctListStyle"> <apex:pageBlock mode="edit" title="Health Enrollment Current"> <apex:form > <apex:commandButton action="{!NewEnrollHealth}" value="New"/> </apex:form> <apex:pageblockSection id="key" title=""> <apex:pageblockTable value="{!healthsummaryactive}" var="hs"> <apex:column headervalue="Health Enrollment Name"> <apex:outputLink value="/{!hs.id}">{!hs.Name}</apex:outputLink> </apex:column> <apex:column headervalue="Year"> <apex:outputField value="{!hs.Year__c}"/> </apex:column> <apex:column headervalue="Market"> <apex:outputField value="{!hs.Market__c}"/> </apex:column> <apex:column headervalue="Category"> <apex:outputField value="{!hs.Category__c}"/> </apex:column> <apex:column headervalue="Status"> <apex:outputField value="{!hs.Status__c}"/> </apex:column> <apex:column headervalue="Base Members"> <apex:outputField value="{!hs.Base_Members__c}" styleClass="centertext"/> </apex:column> <apex:column headervalue="Current Members"> <apex:outputField value="{!hs.Current_Members__c}"/> </apex:column> </apex:pageblocktable> </apex:pageblockSection> </apex:pageblock>
Do I have something in the wrong place or is my css file wrong? Any help is greatly appreciated!!!! Thanks!!
Fred
- fredka
- September 15, 2010
- Like
- 0
- Continue reading or reply
Assign controller variable value in Visualforce page on page load
We're using Visualforce pages more and more here, but we've been working around something for a while that I think is probably pretty simple.
Many times, we have multiple visualpage pages that use different controllers (or extensions) based on the record type, or how many records we want to pull.
I see there are several different examples using javascript / params to have a user pass a variable value to a controller - we've been successful there. But I would simply like to set the variable value when the page loads, so for instance if they go to a page that is supposed to display only 30 records, verses a page that is supposed to display 180 records. Is there a simple way to pass this value to a controller variable using the <apex:page action=""> perhaps?
- jg@hhs
- September 13, 2010
- Like
- 0
- Continue reading or reply
DML commit when errors in trigger
I have a trigger. In this trigger I have a line:
contact.addError( 'Candidate \'' + contactQuery + '\' is already exists. This candidate can\'t be inserted. Existed candidate was updated');
After this line of code I put other line of code to update other record. Something like:
otherContact.Name = 'Test Name'; update otherContact;
Since I have an 'addError' statement in this trigger my 'update otherContact' statement is terminated. How can I update record in this case?
addError
- miha198206
- August 06, 2010
- Like
- 0
- Continue reading or reply
Show columns in related list
I've made a custom object (Asset) which has a lookup field to Case object. I added Assets related list to Case page layout and select in Assets related list 5 columns. Then I saved page layout. But when I go to Case detail page I see Name field in Assets related list only. What can be the reason of this? How to solve it?
Mikhail
- miha198206
- May 20, 2010
- Like
- 0
- Continue reading or reply
Need a Freelance Developer for a "Trigger" Project - Other opportunities
Hi All,
We're a small start-up and don't have a lot of technical staff - and there's one big SF.com project we want to do - but do not have the technical stuff to pull off in a quality way.
I need a developer who can basically set up a custom program for us.
I can provide more detailed description, but in effect what we want is as follows:
- Customer completes a form which creates a new record in SF (this we can already do!!)
- That action triggers a succession of automated emails, daily - for 30 days or UNTIL the user buys the product (is converted from a lead in SF.com to a Contact.)
- The emails must be personalized (Name fields, etc.) to that individual, and we should be able to test this thing in advance to make sure it works.
Anyone out there up for assisting with this project? We have budget and a schedule which I am happy to discuss with qualified developers.
I will need some sort of references. Hope you understand!!
Thanks,
--CHJones
- CHJones
- August 04, 2009
- Like
- 0
- Continue reading or reply
Looking for sforce expert
sfroce API
the new Ajax toolkit
s-control development
Javascript
HTML
- Remend
- November 10, 2005
- Like
- 0
- Continue reading or reply