• FastSnail
  • NEWBIE
  • 205 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 10
    Likes Received
  • 0
    Likes Given
  • 62
    Questions
  • 52
    Replies
Hello everyone,
I still use Eclipse IDE, Neon 3 V4.6.3. Since last week, it does not longer 'Refresh from server' in my SandBox instance. Strangely enough, I can still create a new project in SandBox and it fetches all the elements fine (Classes, Triggers, ...) which are brought into the project, but it fails in getting the code / refreshing the elements, therefore the project fails.
It still works perfect on Production instance.
I am in the process of migrating to VS Code, but I find it less friendy than Eclipse.
how can I get IDE to work a little longer?
Thanks in advance for your help,
Jerome
Hello everyone,
I get the ‘This site is attempting to open a pop-up window – Block - Allow’ on Safari only, in the below context. Can anyone help me to get rid of it?  Thanks in advance.
A VF page (Item) has an ‘Show’ icon that, when clicked,  is opening a NEW VF page (Gallery) to display the pictures of the item, in a separate window/tab.
Before calling Gallery, Item inserts an encrypted cookie (picRecId) build with an Apex method (encryptCookie), that is decrypted by Gallery constructor with another Apex method (decrytCookie).

It looks like this:
Item VF page:
‘oncomplete’ makes sure that when Gallery opens, the picRecId cookie has been inserted. This works fine on all platform BUT I get the pop-up blocker on Safari (iPad/iPhone).
<img src="https://.../showpictureicon" />
<apex:actionSupport event="onclick" action="{!encryptCookie}"
oncomplete="window.open('gallery', 'gallery')" reRender="itemAopNul" >
<apex:param name="picRecId" value="{!ref.id}" />
</apex:actionSupport>

The turnaround I am using for now, which I feel is not robust enough:
Below works with ‘onsubmit’. The pop-up blocker does not appear, but there is a risk that the picRecId cookie is not yet inserted when ‘Gallery’ loads = no good.
Furthermore, trials and error shows me that if the timer is set to 3000, rather than 1000, the pop-up blocker does appear, fur unclear to me reason. If set to 100, the cookie is not inserted on time.
<img src="https://.../showpictureicon" />
<apex:actionSupport event="onclick" action="{!encryptCookie}"
onsubmit="setTimeout(function(){window.open('gallery', 'gallery');}, 1000);" reRender="itemAopNul" >
<apex:param name="picRecId" value="{!ref.id}" />
</apex:actionSupport>

Is there any solution that 1)Makes sure that the picRecId cookie is inserted BEFORE Gallery loads and 2)The pop-up block does not appear?
Thanks again in advance for your help.
All the best,
Jerome
Hello everyone,
My component:
apex:component layout="block" access="global" language="{!lan}" id="ac" >
apex:attribute name="selA" type="String" default="" description="" />
apex:attribute name="SOList" type="map" default="" description="" />

apex:selectList value="{!selA}" size="1 id="aslLinOrgMan" >
apex:selectOption itemValue="" itemLabel="Select" />
/apex:selectList>
What I would like to do is dynamically building the list <apex:selectOption> with the itemValue/itemLabel passed in the SOList map attribute, or through another approach if this is not a good one.
Is there a way to achieve this? If so, how?
Thanks in advance for your support,
All the best,
Jerome
Hello everyone,
Thanks in advance for your help.  Below used to work for the past 10 years without any problem. Now, only one cookie is inserted out of the 2, unless retPag is set to null ??????.  Am I missing something?  Thanks in advance for your help.

---------------------
public without sharing class CNTes{
public CNTes(){
}
public PageReference creCoo(){
PageReference retPag;
cookie coo1 = new Cookie('coo1', 'coo1val', '/', -1, true);
cookie coo2 = new Cookie('coo2', 'coo2val', '/', -1, true);
ApexPages.currentPage().setCookies(new Cookie[]{coo1, coo2});
coo1 = ApexPages.currentPage().getCookies().get('coo1');
coo2 = ApexPages.currentPage().getCookies().get('coo2');
system.debug('CNTes.creCoo() finds coo1='+coo1+', coo2='+coo2);
retPag = null;   ///In that case, both coo1 and coo2 are inserted, as expected
retPag = new PageReference('/CNTes2'); ///In that case, only coo2 is inserted ????????
///Below in both cases, both cookie are found correctly ?????????????
CNTes.creCoo() finds coo1=System.Cookie[coo1=coo1val;path=/;expires=-1;isSecure=true], coo2=System.Cookie[coo2=coo2val;path=/;expires=-1;isSecure=true]
return retPag;
}
}
//////////////////////////////////////////////
public VOID reaCoo(){
cookie coo1 = ApexPages.currentPage().getCookies().get('coo1');
cookie coo2 = ApexPages.currentPage().getCookies().get('coo2');
system.debug('CNTes.reaCoo() finds coo1='+coo1+', coo2='+coo2);
///when retPag != null, coo1 is definitely NOT inserted????
CNTes.reaCoo() finds coo1=null, coo2=System.Cookie[coo2=coo2val;path=/;expires=-1;isSecure=false]
}
}
--------------------------------------------------
Page CNTes:
<apex:page controller="CNTes" docType="html-5.0" sidebar="false" showheader="false" >P
<apex:form>
<apex:outputPanel id="aopNul" />
<apex:commandButton value="Insert cookies" action="{!creCoo}" reRender="aopNul" />
</apex:form>
</apex:page>
---------------------------------------------
Page CNTes2:
<apex:page showHeader="false" sidebar="false" controller="CNTes" >
<apex:form>
<apex:outputPanel id="aopNul" />
<apex:commandButton value="Read cookies" action="{!reaCoo}" reRender="aopNul" />
</apex:form>
</apex:page>
 
Hello;
I am facing a strange behavior of my apex code in Production, which does not occur in Sandbox. I can't pinpoint the issue.
Basically an apex class insert a record, which triggers a 'Before Insert' trigger, and then an 'After Insert' trigger.
The Before Trigger runs fine, but the After Insert trigger is never actuated, and the apex 'insert record' returns a 'Entity_is_Deleted'.
The user/profile is able to insert the record using another apex class in Production, so this is not a security/visibility/right issue.
Any idea?  Thanks in advance for getting back to me.
All the best,
Jerome
 
Hello everyne,
My customer portal users receive the above pop-up window before being able to login. In 100% of the time, they have to click continue.
Furthermore, whether they click on 'Don't ask again on this device' or not, this popup always appears.
How can I remove this verification / message / popup?
Thanks in advance for gettng back to me.
Have a great weekend,
Jerome
Hello everyone;
I have the following code running fine in Sandbox for all users, and in Production fo all users BUT for public site/guest user.
CCNUSADMIN_CurrencyRates cache is set to Public.
------------
PageReference curRatPR = new PageReference('/resource/CCNUSADMIN_CurrencyRates');
curRatList = curRatPR.getContent().toString().split(',', 0); 
---------
When accessed by the guest user, the following error, on the getContent() line:
avax.net.ssl.SSLPeerUnverifiedException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
---------
My Site SFDC URL is: http://ccnus.force.com/  which is redirected to a custom URL 'us.classiccarnetwork.org', served by a SSL certificate that runs OK. Any idea why I get this message and more important, what I need to do to allow the Public Site user to access this static resources?
Thanks in advance for your help. Best regards,
Jerome
Hello everyone,
Despite having read dozen posts on the blog, I can't configure my custom URL for my site.  What I want to do is I believe 100% standard. I might have a glitch somewhere. I have only one site. My site URL in the SITES main page is: http://ccnus.force.com/ for a site named CCNUSSITE.
I have one VF page for that site named  CNHelGen
Then in the CCNUSSITE detail page, the 'Require Secure Connections (HTTPS)' checkbox is checked. See CCNUSSITE detail page in link:  http://www.classiccarnetwork.eu/0DEV/CCNUS-CCNUSSITE1.jpg
I have 2 'standard' Custom URL for that site (which I guess are created by SFDC):
- ccnus.force.com, which does not allow to access the site because no HTTPS: Eg: https://ccnus.secure.force.com/CNHelgen returns SSL error,
- ccnus.secure.force.com: which allows to access the page on the site. Eg: https://ccnus.secure.force.com/CNHelGen  works fine.
Now, I want to replace the ‘ccnus.secure.force.com’ by my custom domain:  ‘classiccarnetwork.org’ so that CNHelGen page can be accessed by ‘classiccarnetwork.org/CNHelGen’
As of now, there are pages published under classiccarnetwork.org, but they will be removed.  The goal is for CCNUSSITE pages to replace all the classiccarnetwork.org content.
I have created a custom domain ‘classiccarnetwork’ and I have created the Custom URL ‘classiccarnetwork’ to link CCNUSSITE with this custom domain. See links  below.
http://www.classiccarnetwork.eu/0DEV/CCNUS-CLASSICCARNETWORTK-DOMAIN-CustomURL1.jpg
My understanding is that now ‘classiccarnetwork/CNHelGen’  should display my former https://ccnus.secure.force.com/CNHelGen  page. Am I correct? It does not. https://classiccarnetwork.org/CNHelGen  returns nothing.
What also puzzles me is that:
1. from the CCNUSSITE detail page,  ‘Active Site Home Page’ CNHelGen [Preview]  returns https://classiccarnetwork--c.eu3.visual.force.com/apex/CNHelGen    Why does this return this strange URL?
2. 'Preview as Admin' of the classiccarnetwork.org Custom URL returns the link http://classiccarnetwork.org//sites/servlet.SiteDebugMode?sitedebugmode=z&rand=16066   which returns the 'error' in the link below
http://www.classiccarnetwork.eu/0DEV/CCNUS-CLASSICCARNETWORK-PreviewAsAdmin.jpg
I guess that you understand by now that I am lost. Thanks in advance for your support.
Best regards,
Jerome
Hello,
Can you remove the Setup link in the picture below.  If yes, how?
User-added image
Unchecking 'Setup and Configuration' option in the user profile is NOT the answer.
Thanks in advance for your support,
Jerome
 
Hello,
We want to create a VF Email template that access the owner of a record, even in fact the contact associated to this user, as this is a Portal user. I can't get it to work. It is not done through RecipientType but through relatedToType
<messaging:emailTemplate relatedToType="MySObject__c" subject="the subject is ......
{!relatedTo.Owner.name} works fine in the VF template.
But:
- {!relatedTo.Owner.CompanyName} and all user.CustomFields__c return 'Error: Invalid field Company for SObject Name.'
- {!relatedTo.owner.contact} does not work either.
Thanks in advance for your help, A workaround is appreciated.
Jerome
Hello everyone,
We use the Customer Portal with users using Customer Portal Manager Custom Licences who are set with Salesforce1 User = NO. uses use mobile devices such as iPad to access our portal.Our Customer Portal has VF custom pages, the first one being a component of the home page, right column.
Back to a few days, users could login and were accessing the Portal and embedded VF pages without problem.
Since the V40 (I guess), users are welcomed with these 'Open link in salesforce using mobile browser' pop-up. See link below
http://www.classiccarnetwork.eu/0DEV/CustomerPortal-OpenLinkIssue.jpg
How can we avoid these? I looked everywhere and I could not find the answer.
Thanks in advance for your help,
Jerome
 
Hello everyone,
I confess that this is not a pure VF question; it is more HTML, but I have been struggling on it for too long and this is the only forum I use. So thanks in avance for your help. I am tryng to set-up a 'dynamic' header that adapt to VF flexibility of content. I have tried every HTML concept I know of: float, overflow:hidden; white-space:no-wrap, inline-block, ...
This link explains my goal.    https://www.ccnus.org/various/tmp/ComponentHeader.pdf
Thanks again,
Jerome
 
Custom labels are accessible in JS when script is embedded in page. Below works fine
<apex:page>
<script>
$(document).ready(function(){
alert('{!$Label.myLabel}');   ///Displays 'myLabel content' just fine
});
<script>
</apex:page>
I want to externalize the javascript to an external file:
<apex:page>
<script src="https://www.ccnus.org/various/jquery/jquery-1.11.1.min.js"></script>
<script src="https://www.ccnus.org/........./myexternal.js" ></script>
</apex:page>
Myexternal.js :
$(document).ready(function(){
alert('{!$Label.myLabel}');   ///renders {!$Label.myLabel} rather than myLabel content
});
I have tried everything I could think of. No aval. How do you get it to work?
Thanks in advance for your help,
Jerome
Hello everyone,
The log trace of my public site user / Guest License worked fine through the Administration Setup | Monitoring | Debug Logs up to last week. It does not anymore, although tracing all the other users is fine. Any idea?
Thanks in advance for your help,
Jerome
Hello everyone. I can't believe that I am starting this discussion as it sounds crazy, illogical, insane. Still I have spent 10 hours, sent about 200 Emails with the template and I can't figure it out. The problem happens with ONE VF Email template. I am successfully using dozens of similar VF Email template using the SAME components, with no problem.
This particular template stops working when some particular words are used in the template. 'using' is one of them.
Here are the elements. First a component that I am using in all my templates without problem.
<apex:component access="global" language="{!lan}" id="CNOrgOwnAddBlo" >
<apex:attribute name="att" type="CNOrganization__c" description="" />
<apex:attribute name="lan" type="String" description=""  />
<apex:outputText value="{!att.name}" escape="true" /><br/>
<apex:outputText value="{!att.LinkCNAddressBilling__r.AddQualif__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.AddQualif__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.Street1__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.Street1__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.Street2__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.Street2__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.City__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.City__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.RegionState__c}&nbsp;" rendered="{!att.LinkCNAddressBilling__r.RegionState__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.ZipCode__c}" rendered="{!att.LinkCNAddressBilling__r.ZipCode__c != '' }" />
<br/>
<apex:outputField value="{!att.LinkCNAddressBilling__r.Country__c}" />
</apex:component>
Then this particular template (just the piece to explain the problem).
The template below with ‘toto’ in the cell works fine. Now, replace ‘toto’ with ‘usi’, ‘usin’, ‘usinge’, ‘using2’, …. and all works fine (case1 in document attached). BUT replace with ‘using’ and the template stops working. The debug log does not show anything abnormal: just ‘using’ where is it supposed to be in the email. Still, the email does not fire (case2 in document attached).
<messaging:emailTemplate relatedToType="CNPosition__c" language="{!relatedTo.DocumentLanguage__c}" subject="{!$Label.CNWelcomeToTheCCNAdministratorComunity}" id="CNSubEvePubEmaTem" >
<messaging:htmlEmailBody>
<table align="center" width="600" style="width:600px;margin-left:auto;margin-right:auto;" >
<tr><td>
<c:CNOrgOwnAddBlo att="{!relatedTo.LinkCNOrgAcc__r}" lan="{!relatedTo.DocumentLanguage__c}" />
</td></tr>
<tr><td>
toto
</td></tr>
</table>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Now, if it helps someone diagnose the problem, simply remove the <br/> in the component <apex:outputText value="{!att.LinkCNAddressBilling__r.City__c}<br/>" and it all works fine with ‘using’ (case3 in document attached).
Because I realize it sounds crazy, the link below shows a few screenshots.
http://www.ccnfr.org/various/20160903-VFTemplateInsane.pdf
Well, thanks a lot for trying to figure this one out.
Jerome
Hello everyone,
I have created a custom label named 'fieldNameHelp' for each of my SFDC custom field. These custom labels are translated and used in VF pages.  I would like to re-use these custom labels to populate the standard HelpText of each field, so that the same help message can be displayed in the standard SFDC user interface.
Option1: direct insert of '$Label.OrgNameRegisteredHelp' in the field HelpText input field does not work. Any workaround?
Option2: The .stf files contains both the field HelpText and the custom label translated value. Example below of the .stf file in en_US
Language code: en_US
Type: Source
# KEY     LABEL
...
CustomField.Organization__c.NameRegistered.HelpText       OrgNameRegistered
...

CustomLabel.OrgNameRegisteredHelp           The fiscal name used for invoices, fiscal documents. Includes llc, corp, sarl, ...
...
Has anyone has an idea of how I can replace OrgNameRegistered with 'The fiscal name used for invoices, fiscal documents. Includes llc, corp, sarl, ...'
I don’t think that Excel or XML editors can cut it. Any help is appreciated.
Thanks in advance,
Jerome
Hello everyone,
The VF Email template below used to work, in Sandbox and Production. The image is now broken. Has anything changed ?
Works fine as HTML. Thanks in advance for your help,
Jerome
<messaging:emailTemplate relatedToType="CNOrder__c" subject="toto" id="CNOrdConEma" >
<messaging:htmlEmailBody >
Test
</messaging:htmlEmailBody>
<messaging:attachment filename="toto" renderAs="pdf" >
<img src="https://www.ccnus.org/stylesheet/icon/balls32.png"  />
</messaging:attachment>
</messaging:emailTemplate>
Hello everyone,
I am facing a new behavior in the user debug log. I get one line such as below:
16:41:29.18 (18684983)|USER_INFO|[EXTERNAL]|00520000001LzfN|admin@ccnfr.org.ccnussb|Eastern Standard Time|GMT-04:00
for each access to a sObject field in the page, either in the VF page such as {!sObject record} OR accessed through Javascript. Problem is that I get 50+ of these lines in some busy pages and the log quits before the end at a line like this.
????????  Does anyone have the same issue?
Any idea? Is this a bug?  Can I remove these lines through the filters?  i tried all day long, with no sucess; Even setting Apex debug level to none brings these lines back.
Thansks in advance for your help.
Jerome
Hello everyone,
My VF page without controler is built out of 2 Components, each one with its own controller.
Each component displays the same list of records, built through a SOQL method, in an ApexPageBlock, itself in an OutputPanel, with a Delete button for each record in the table.
When I delete a record in Component1, I want:
- the list to be updated in the Compoent1. This is easy,
- the list to be updated in the Component2, through a reRender or the like, without reloading the entire page.
Am I clear enough? What is the best Apex / VF method to achieve this?
Thanks in advance for your support, Best regards,
Jerome
Hello everyone,
Thanks in advance for your help on this strange one. One of my classes is sending Messaging.SingleEmailMessage using a VF Email template to Contact. I am facing a stange behavoir. In all cases, the email is created correctly, and showd as fired, based on the debug-log.
BUT when the contact email is a '@gmail.com' address, the email is - I guess - not sent. It is not received for sure. Change the contact email to a '@yahoo.com' or something else and it all works fine.
Other classes using the same contact with similar code but a different VF email template and the '@gmail.com' addresses send the email as expected. ?????????????????????
Any idea? Anyone had faced such a strange pattern? Thanks in advance for your help,
Jerome
 
Hello everyone,
We use the Customer Portal with users using Customer Portal Manager Custom Licences who are set with Salesforce1 User = NO. uses use mobile devices such as iPad to access our portal.Our Customer Portal has VF custom pages, the first one being a component of the home page, right column.
Back to a few days, users could login and were accessing the Portal and embedded VF pages without problem.
Since the V40 (I guess), users are welcomed with these 'Open link in salesforce using mobile browser' pop-up. See link below
http://www.classiccarnetwork.eu/0DEV/CustomerPortal-OpenLinkIssue.jpg
How can we avoid these? I looked everywhere and I could not find the answer.
Thanks in advance for your help,
Jerome
 
Hello everyone,
I am facing a new behavior in the user debug log. I get one line such as below:
16:41:29.18 (18684983)|USER_INFO|[EXTERNAL]|00520000001LzfN|admin@ccnfr.org.ccnussb|Eastern Standard Time|GMT-04:00
for each access to a sObject field in the page, either in the VF page such as {!sObject record} OR accessed through Javascript. Problem is that I get 50+ of these lines in some busy pages and the log quits before the end at a line like this.
????????  Does anyone have the same issue?
Any idea? Is this a bug?  Can I remove these lines through the filters?  i tried all day long, with no sucess; Even setting Apex debug level to none brings these lines back.
Thansks in advance for your help.
Jerome
Hello everyone,
I jusr read the document 'Tips for Reducing Formula Size'; Still I can't find a way to reduce the size of my custom formula fied. Any idea will be helpful. The goal is to present to the user the 'Duration' of an event based on the DateStart and DateFinish, in the shortest possible way, meaning:
Mon. May 18, 2015, Fri. Jun. 17, 2016 -  Year is different
Mon. May 18, Wed. Jun. 17, 2015 – same year, but monthis  different
Mon. 18-Wed. 20, May 2015 – same year and month, but day is different
Mon. May 18, 2015 – same day
Below my current formula that exceed the Compiled 4,000 bytes allowance. below DS__c is DateStart__c, DF__c is DateFinish, D1-7 is day in the week (Mon-Sun), M1-12 is month in the year (Jan-Dec)
Again, thanks for any idea (but doing a Workflow which I would like to avoid).

If (DS__c = DF__c,  /* Mon. Apr. 17, 2015 */
CASE( MOD( DF__c - DATE( 1900, 1, 7 ), 7 ), 0, $Label.D7, 1, $Label.D1, 2, $Label.D2, 3, $Label.D3, 4, $Label.D4, 5, $Label.D5, $Label.D6 )
+'. '+
CASE (MONTH(DF__c), 1, $Label.M1, 2, $Label.M2, 3, $Label.M3, 4, $Label.M4, 5, $Label.M5, 6, $Label.M6, 7, $Label.M7, 8, $Label.M8, 9, $Label.M9, 10, $Label.M10, 11, $Label.M11, $Label.M12)
+'. '+
TEXT(DAY(DF__c))
+', '+
TEXT(YEAR(DF__c))
,
IF (YEAR(DS__c) == YEAR(DF__c),     /* Same year: Mon. 17-Tue. 18, Apr. 2015,  */
IF (MONTH(DS__c) == MONTH(DF__c), /* same year, same month: Mon. 17-Tue. 18, Apr. 2015 */
CASE( MOD(DS__c - DATE(1900, 1, 7 ), 7 ), 0, $Label.D7, 1, $Label.D1, 2, $Label.D2, 3, $Label.D3, 4, $Label.D4, 5, $Label.D5, $Label.D6 )
+'. '+
TEXT(DAY(DS__c))
+'-'+
CASE( MOD( DF__c - DATE( 1900, 1, 7 ), 7 ), 0, $Label.D7, 1, $Label.D1, 2, $Label.D2, 3, $Label.D3, 4, $Label.D4, 5, $Label.D5, $Label.D6 )
+'. '+
TEXT(DAY(DF__c))
+', '+
CASE (MONTH( DS__c), 1, $Label.M1, 2, $Label.M2, 3, $Label.M3, 4, $Label.M4, 5, $Label.M5, 6, $Label.M6, 7, $Label.M7, 8, $Label.M8, 9, $Label.M9, 10, $Label.M10, 11, $Label.M11, $Label.M12)
+'. '+
TEXT(YEAR(DF__c))
,                                                  /* Same year, different months: Mon. Apr. 17-Wed. May 20, 2015 */
CASE( MOD(DS__c - DATE( 1900, 1, 7 ), 7 ), 0, $Label.D7, 1, $Label.D1, 2, $Label.D2, 3, $Label.D3, 4, $Label.D4, 5, $Label.D5, $Label.D6 )
+'. '+
CASE (MONTH( DS__c), 1, $Label.M1, 2, $Label.M2, 3, $Label.M3, 4, $Label.M4, 5, $Label.M5, 6, $Label.M6, 7, $Label.M7, 8, $Label.M8, 9, $Label.M9, 10, $Label.M10, 11, $Label.M11, $Label.M12)
+'. '+
TEXT(DAY(DS__c))
+'-'+
CASE( MOD( DF__c - DATE( 1900, 1, 7 ), 7 ), 0, $Label.D7, 1, $Label.D1, 2, $Label.D2, 3, $Label.D3, 4, $Label.D4, 5, $Label.D5, $Label.D6 )
+'. '+
CASE (MONTH( DF__c ), 1, $Label.M1, 2, $Label.M2, 3, $Label.M3, 4, $Label.M4, 5, $Label.M5, 6, $Label.M6, 7, $Label.M7, 8, $Label.M8, 9, $Label.M9, 10, $Label.M10, 11, $Label.M11, $Label.M12)
+'. '+
TEXT(DAY(DF__c))
+', '+
TEXT(YEAR(DF__c))
)
,                                                     /* Different year, month irrelevant: Mon. Apr. 17, 2015-Wed. May 20, 2016 */
CASE( MOD(DS__c - DATE( 1900, 1, 7 ), 7 ), 0, $Label.D7, 1, $Label.D1, 2, $Label.D2, 3, $Label.D3, 4, $Label.D4, 5, $Label.D5, $Label.D6 )
+'. '+
CASE (MONTH( DS__c), 1, $Label.M1, 2, $Label.M2, 3, $Label.M3, 4, $Label.M4, 5, $Label.M5, 6, $Label.M6, 7, $Label.M7, 8, $Label.M8, 9, $Label.M9, 10, $Label.M10, 11, $Label.M11, $Label.M12)
+'. '+
TEXT(DAY(DS__c))
+', '+
TEXT(YEAR(DS__c))
+'-'+
CASE( MOD( DF__c - DATE( 1900, 1, 7 ), 7 ), 0, $Label.D7, 1, $Label.D1, 2, $Label.D2, 3, $Label.D3, 4, $Label.D4, 5, $Label.D5, $Label.D6 )
+'. '+
CASE (MONTH( DF__c ), 1, $Label.M1, 2, $Label.M2, 3, $Label.M3, 4, $Label.M4, 5, $Label.M5, 6, $Label.M6, 7, $Label.M7, 8, $Label.M8, 9, $Label.M9, 10, $Label.M10, 11, $Label.M11, $Label.M12)
+'. '+
TEXT(DAY(DF__c))
+', '+
TEXT(YEAR(DF__c))
)
)
 
Hello everyone,
I am struggling with the following. Thanks in advance for your help.
Goal: My contact object allows to load a picture of the contact. In a related list of contacts, I need:
- the picture of the contact to be displayed if it exists. The contact.URLPicture1__c URLType field is auto-populated by a trigger with https://www.ccnfr.org/personsb/contactId.jpg  . A PHP mechanism allows to load a real picture on the server at this address.
- OR a default picture such as https://www.ccnfr.org/personsb/CCNPersonDefaultPicture.jpg  if the picture had not been loaded yet.
How can I  acheive this?
My VF page so far, which does not work (except when  there is only ONE contact in the list).
Is a wrapper a solution? Thanks in advance for your suggestions / help.

<apex:pageBlock >
<apex:pageBlockTable value="{!contactList}" var="con" id="contable" >
<apex:column  >
<img src="{!con.URLPicture1__c}" style="display:none;" id="URLPic1" onload="pic1F()" />
<img src="https://www.ccnfr.org/personsb/ccnvehicledefaultpicture.jpg" style="display:inline;" id="URLDefPic1" />
<script>
var URLPic1JS = document.getElementById("URLPic1");
var URLDefPic1JS = document.getElementById("URLDefPic1");
function pic1F(){  ///if this runs, it is because URLPicture1__c exist = the real picture that I need to display
URLPic1JS.style.display = 'inline';
URLDefPic1JS.style.display = 'none';
}
</script>
</apex:column>
</apex:pageBlockTable>

All suggestions are welcome. Thanks. Jerome
Hello,
I know how to pass record Id to Apex:component from a VF pages using attribute.  I have been struggling for 2 days now in trying to achieve the same with a VF Email template. Thanks in advance for your help. Jerome
The controller:
public class CNPerUpdNdFCon{
public Id perId = ApexPages.currentPage().getParameters().get('Id');
public Person__c per {get;set;}
public CNPerUpdNdFCon(){
per = [select Id, name, NameFirst__c from Person__c where id =: perId];
}
public VOID updPer(){
update per;
List<messaging.SingleEmailMessage> SingleEmailMessageList = new messaging.SingleEmailMessage[1];
SingleEmailMessageList[0] = new Messaging.SingleEmailMessage();
SingleEmailMessageList[0].setTemplateID('00XF0000001KurK');        //HARD CODED.
SingleEmailMessageList[0].setTargetObjectId('003F00000150NyX');   //jmaison92@gmail.com  Goal is just to send the Email to a contact
Messaging.sendEmail(SingleEmailMessageList, false);
}
}
The VF Page. After I click Update, the Email is indeed send to jmaison92@gmail BUT how do I get the per.NameFirst__c to be passed to the custom component?
<apex:page controller="CNPerUpdNdFCon" showHeader="false" sidebar="false">
<!--    https://c.na10.visual.force.com/apex/cnperupdndf?id=a02F00000055p2C   -->
<apex:form >
<apex:inputField value="{!Per.NameFirst__c}" />
<apex:commandButton value="Update" action="{!updPer}" />
</apex:form>
</apex:page>
The Component:
<apex:component access="global">
<apex:attribute name="NdF" description="FirstName" type="String"/>
Nom de famille in Component:{!NdF}
</apex:component>
The VF Email Template: 
<messaging:emailTemplate recipientType="Contact"  subject="We updated your First Name" >
<messaging:htmlEmailBody >
The Contact this Email is sent to is:{!recipient.name}<br/>
Your New First Name is <c:CNPerNdF /><br/>
Your would know it if I knew how to populate NdF="{!????}" in Custom Component Above.
</messaging:htmlEmailBody>
</messaging:emailTemplate>

Again it is all here: How to I populate the attribute in the component to get the per.FirtsName__c   ?
Thanks in advance for your help,
Jerome

Hello,

I am stuck on something that I feel very strange. Any input is apprecaited.
We run a batch process that sends Order Confirmation Messaging.SingleEmailMessage. Emails.
2 Emails are sent using the same VF Template ( setTemplateID('00XW0000000QOD5') ) in the same Messaging.sendEmail(new Messaging.SingleEmailMessage[] { ordConEma , ordConEmaCopy }); using:
- ordConEma.setTargetObjectId(contact.Id) // the person who needs to receive the Email
- ordConEmaCopy.setTargetObjectId(user.id); //the Admin, in order to keep a copy of the Email in a mailbox
The VF Template includes:
- an messaging HTML Part
- an messaging attachment rendered as PDF, exact copy of the HTML part.
The VF Templates uses an Image Custom Component that brings back a contactId related URL from an external site.
The external site is declared in the Remote Site Conf.
This component is included in both the HTML Part and the attachment.
The problem:
The userId receiver receives the Email and the attachment perfectly, with both images displayed

BUT
The contactId receiver does NOT received the Email, although it is queued properly according to the Debug log.
Trying to pinpoint the problem:
IF I remove the Image Component from the messaging.attachment, if all works fine with both Emails (but obviously, I do not have the image in my PDF for the ContactId = my customer = no good)
IF I remove the external image server from the remote sites, both Email are sent properly, but obviously got a missing Picture icon in my PDF of the ContactId and it is no good either.
Question:
I do not understand why userId receiver works perfect and contactId cannot receive the Email, which is built properly according to the debug log.
Thanks in advance for your support. Best regards,
Jerome Hardy

Hello everyone,

Is there is way / turnaround to build Custom Labels that refers to other Custom Labels, such as in below, which does not work:

Thanks in advance,

Jerome

 

Below is the English Translated Value of the custom Label "GlossaryMain"

 

<h1>Glossary</h1>
<p>Below are the terms used in the platform</p>
<ul>
<li>{!$Label.GlossaryPerson}</li>
<li>{!$Label.GlossaryOrganization}</li>
</ul>

Hello everyone,

I give up after 3 days of struggling with this. Below is simplified of what I want to do.

My goal is sending an Email template that is running a custom component that uses its own controller.

I want the custom component controller to collect the data required for the template while the Email template controller is only responsible of getting the right contactId, all this is order to be able to reuse my component in multiple templates.

I can't get it to work. What am I missing? Is there a simpler way than what is below? Your help is really appreciated.

Jerome

The Email template Controller:

global with sharing class SenConVFTemCont {
global ID conId = ApexPages.currentPage().getParameters().get('conid');
public Contact contact;
global SenConVFTemCont(){
getContact();
}
public Contact getContact(){
return contact = [Select Id, Email from Contact where Id =: conId];
}
public VOID senConVFTem(){
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setTemplateID('00XF0000001KrA8');
email.setTargetObjectId(contact.Id);
Messaging.sendEmail(new Messaging.singleEmailMessage[] {email} );
}
}

The Email page lauching the Email through button with URL = '/apex/SenConVFTem?conid={!contact.id}'

<apex:page controller="SenConVFTemCont" action="{!senConVFTem}" sidebar="false" showheader="false" id="SenConVFTem">
</apex:page>

The component controller

 

global with sharing class NameTableCont {
global ID conID;
global ID conIdCom;
global Contact contact;
global NameTableCont(){
//conId='a03F0000009RKZj'; //testing purpose of component out of VF template
getContact();
}
global ID getConId(){return ConID;}
global VOID setConIdCom(ID data){conIdCom=data;}

 

global contact getContact(){
return contact = [Select Id, name from Contact where id =: conIdCom];
}
global VOID setContact(Contact data){contact=data;}
}

The component

 

<apex:component access="global" controller="NameTableCont" id="NameTable" >
<apex:attribute name="IdConAP" type="Contact" description="This is the Id of the contact" assignTo="{!contact}" access="global" />
<p>This is the Component table</p>
line1:{!contact.name}<br/>
<p>End of Component table</p>
</apex:component>

The VF template

 

<messaging:emailTemplate subject="Here is your business card" recipientType="Contact" relatedToType="Account" id="PositionBusinessCard">
<messaging:htmlEmailBody >
HTML Email Body Position Business Card<br/>
<c:NameTable IdConAP="{!RelatedTo.Id}" /><br/>  Question: what does {!RelatedTo.Id} really do?
</messaging:htmlEmailBody>
</messaging:emailTemplate>

What I want as a result is below, but what I get is an empty line1 when I get the thing to send an Email

-------------

 

From: noreply@salesforce.com [mailto:noreply@salesforce.com] On Behalf Of ADMIN
Sent: Thursday, November 07, 2013 10:31 AM
To: jmaison92@gmail.com
Subject: Here is your business card

 

 

 

HTML Email Body Position Business Card

 

This is the Component table

 

line1:Jacques Maison

 

End of Component table

----------------------

 

Again: thanks for your help.

Jerome

Hello everyone,
I still use Eclipse IDE, Neon 3 V4.6.3. Since last week, it does not longer 'Refresh from server' in my SandBox instance. Strangely enough, I can still create a new project in SandBox and it fetches all the elements fine (Classes, Triggers, ...) which are brought into the project, but it fails in getting the code / refreshing the elements, therefore the project fails.
It still works perfect on Production instance.
I am in the process of migrating to VS Code, but I find it less friendy than Eclipse.
how can I get IDE to work a little longer?
Thanks in advance for your help,
Jerome
Hello everyone,
I get the ‘This site is attempting to open a pop-up window – Block - Allow’ on Safari only, in the below context. Can anyone help me to get rid of it?  Thanks in advance.
A VF page (Item) has an ‘Show’ icon that, when clicked,  is opening a NEW VF page (Gallery) to display the pictures of the item, in a separate window/tab.
Before calling Gallery, Item inserts an encrypted cookie (picRecId) build with an Apex method (encryptCookie), that is decrypted by Gallery constructor with another Apex method (decrytCookie).

It looks like this:
Item VF page:
‘oncomplete’ makes sure that when Gallery opens, the picRecId cookie has been inserted. This works fine on all platform BUT I get the pop-up blocker on Safari (iPad/iPhone).
<img src="https://.../showpictureicon" />
<apex:actionSupport event="onclick" action="{!encryptCookie}"
oncomplete="window.open('gallery', 'gallery')" reRender="itemAopNul" >
<apex:param name="picRecId" value="{!ref.id}" />
</apex:actionSupport>

The turnaround I am using for now, which I feel is not robust enough:
Below works with ‘onsubmit’. The pop-up blocker does not appear, but there is a risk that the picRecId cookie is not yet inserted when ‘Gallery’ loads = no good.
Furthermore, trials and error shows me that if the timer is set to 3000, rather than 1000, the pop-up blocker does appear, fur unclear to me reason. If set to 100, the cookie is not inserted on time.
<img src="https://.../showpictureicon" />
<apex:actionSupport event="onclick" action="{!encryptCookie}"
onsubmit="setTimeout(function(){window.open('gallery', 'gallery');}, 1000);" reRender="itemAopNul" >
<apex:param name="picRecId" value="{!ref.id}" />
</apex:actionSupport>

Is there any solution that 1)Makes sure that the picRecId cookie is inserted BEFORE Gallery loads and 2)The pop-up block does not appear?
Thanks again in advance for your help.
All the best,
Jerome
Hello everyone,
My component:
apex:component layout="block" access="global" language="{!lan}" id="ac" >
apex:attribute name="selA" type="String" default="" description="" />
apex:attribute name="SOList" type="map" default="" description="" />

apex:selectList value="{!selA}" size="1 id="aslLinOrgMan" >
apex:selectOption itemValue="" itemLabel="Select" />
/apex:selectList>
What I would like to do is dynamically building the list <apex:selectOption> with the itemValue/itemLabel passed in the SOList map attribute, or through another approach if this is not a good one.
Is there a way to achieve this? If so, how?
Thanks in advance for your support,
All the best,
Jerome
Hello;
I am facing a strange behavior of my apex code in Production, which does not occur in Sandbox. I can't pinpoint the issue.
Basically an apex class insert a record, which triggers a 'Before Insert' trigger, and then an 'After Insert' trigger.
The Before Trigger runs fine, but the After Insert trigger is never actuated, and the apex 'insert record' returns a 'Entity_is_Deleted'.
The user/profile is able to insert the record using another apex class in Production, so this is not a security/visibility/right issue.
Any idea?  Thanks in advance for getting back to me.
All the best,
Jerome
 
Hello everyne,
My customer portal users receive the above pop-up window before being able to login. In 100% of the time, they have to click continue.
Furthermore, whether they click on 'Don't ask again on this device' or not, this popup always appears.
How can I remove this verification / message / popup?
Thanks in advance for gettng back to me.
Have a great weekend,
Jerome
Hello everyone;
I have the following code running fine in Sandbox for all users, and in Production fo all users BUT for public site/guest user.
CCNUSADMIN_CurrencyRates cache is set to Public.
------------
PageReference curRatPR = new PageReference('/resource/CCNUSADMIN_CurrencyRates');
curRatList = curRatPR.getContent().toString().split(',', 0); 
---------
When accessed by the guest user, the following error, on the getContent() line:
avax.net.ssl.SSLPeerUnverifiedException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
---------
My Site SFDC URL is: http://ccnus.force.com/  which is redirected to a custom URL 'us.classiccarnetwork.org', served by a SSL certificate that runs OK. Any idea why I get this message and more important, what I need to do to allow the Public Site user to access this static resources?
Thanks in advance for your help. Best regards,
Jerome
Hello everyone,
Despite having read dozen posts on the blog, I can't configure my custom URL for my site.  What I want to do is I believe 100% standard. I might have a glitch somewhere. I have only one site. My site URL in the SITES main page is: http://ccnus.force.com/ for a site named CCNUSSITE.
I have one VF page for that site named  CNHelGen
Then in the CCNUSSITE detail page, the 'Require Secure Connections (HTTPS)' checkbox is checked. See CCNUSSITE detail page in link:  http://www.classiccarnetwork.eu/0DEV/CCNUS-CCNUSSITE1.jpg
I have 2 'standard' Custom URL for that site (which I guess are created by SFDC):
- ccnus.force.com, which does not allow to access the site because no HTTPS: Eg: https://ccnus.secure.force.com/CNHelgen returns SSL error,
- ccnus.secure.force.com: which allows to access the page on the site. Eg: https://ccnus.secure.force.com/CNHelGen  works fine.
Now, I want to replace the ‘ccnus.secure.force.com’ by my custom domain:  ‘classiccarnetwork.org’ so that CNHelGen page can be accessed by ‘classiccarnetwork.org/CNHelGen’
As of now, there are pages published under classiccarnetwork.org, but they will be removed.  The goal is for CCNUSSITE pages to replace all the classiccarnetwork.org content.
I have created a custom domain ‘classiccarnetwork’ and I have created the Custom URL ‘classiccarnetwork’ to link CCNUSSITE with this custom domain. See links  below.
http://www.classiccarnetwork.eu/0DEV/CCNUS-CLASSICCARNETWORTK-DOMAIN-CustomURL1.jpg
My understanding is that now ‘classiccarnetwork/CNHelGen’  should display my former https://ccnus.secure.force.com/CNHelGen  page. Am I correct? It does not. https://classiccarnetwork.org/CNHelGen  returns nothing.
What also puzzles me is that:
1. from the CCNUSSITE detail page,  ‘Active Site Home Page’ CNHelGen [Preview]  returns https://classiccarnetwork--c.eu3.visual.force.com/apex/CNHelGen    Why does this return this strange URL?
2. 'Preview as Admin' of the classiccarnetwork.org Custom URL returns the link http://classiccarnetwork.org//sites/servlet.SiteDebugMode?sitedebugmode=z&rand=16066   which returns the 'error' in the link below
http://www.classiccarnetwork.eu/0DEV/CCNUS-CLASSICCARNETWORK-PreviewAsAdmin.jpg
I guess that you understand by now that I am lost. Thanks in advance for your support.
Best regards,
Jerome
Hello,
We want to create a VF Email template that access the owner of a record, even in fact the contact associated to this user, as this is a Portal user. I can't get it to work. It is not done through RecipientType but through relatedToType
<messaging:emailTemplate relatedToType="MySObject__c" subject="the subject is ......
{!relatedTo.Owner.name} works fine in the VF template.
But:
- {!relatedTo.Owner.CompanyName} and all user.CustomFields__c return 'Error: Invalid field Company for SObject Name.'
- {!relatedTo.owner.contact} does not work either.
Thanks in advance for your help, A workaround is appreciated.
Jerome
Hello everyone,
We use the Customer Portal with users using Customer Portal Manager Custom Licences who are set with Salesforce1 User = NO. uses use mobile devices such as iPad to access our portal.Our Customer Portal has VF custom pages, the first one being a component of the home page, right column.
Back to a few days, users could login and were accessing the Portal and embedded VF pages without problem.
Since the V40 (I guess), users are welcomed with these 'Open link in salesforce using mobile browser' pop-up. See link below
http://www.classiccarnetwork.eu/0DEV/CustomerPortal-OpenLinkIssue.jpg
How can we avoid these? I looked everywhere and I could not find the answer.
Thanks in advance for your help,
Jerome
 
Custom labels are accessible in JS when script is embedded in page. Below works fine
<apex:page>
<script>
$(document).ready(function(){
alert('{!$Label.myLabel}');   ///Displays 'myLabel content' just fine
});
<script>
</apex:page>
I want to externalize the javascript to an external file:
<apex:page>
<script src="https://www.ccnus.org/various/jquery/jquery-1.11.1.min.js"></script>
<script src="https://www.ccnus.org/........./myexternal.js" ></script>
</apex:page>
Myexternal.js :
$(document).ready(function(){
alert('{!$Label.myLabel}');   ///renders {!$Label.myLabel} rather than myLabel content
});
I have tried everything I could think of. No aval. How do you get it to work?
Thanks in advance for your help,
Jerome
Hello everyone,
The log trace of my public site user / Guest License worked fine through the Administration Setup | Monitoring | Debug Logs up to last week. It does not anymore, although tracing all the other users is fine. Any idea?
Thanks in advance for your help,
Jerome
Hello everyone. I can't believe that I am starting this discussion as it sounds crazy, illogical, insane. Still I have spent 10 hours, sent about 200 Emails with the template and I can't figure it out. The problem happens with ONE VF Email template. I am successfully using dozens of similar VF Email template using the SAME components, with no problem.
This particular template stops working when some particular words are used in the template. 'using' is one of them.
Here are the elements. First a component that I am using in all my templates without problem.
<apex:component access="global" language="{!lan}" id="CNOrgOwnAddBlo" >
<apex:attribute name="att" type="CNOrganization__c" description="" />
<apex:attribute name="lan" type="String" description=""  />
<apex:outputText value="{!att.name}" escape="true" /><br/>
<apex:outputText value="{!att.LinkCNAddressBilling__r.AddQualif__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.AddQualif__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.Street1__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.Street1__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.Street2__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.Street2__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.City__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.City__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.RegionState__c}&nbsp;" rendered="{!att.LinkCNAddressBilling__r.RegionState__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.ZipCode__c}" rendered="{!att.LinkCNAddressBilling__r.ZipCode__c != '' }" />
<br/>
<apex:outputField value="{!att.LinkCNAddressBilling__r.Country__c}" />
</apex:component>
Then this particular template (just the piece to explain the problem).
The template below with ‘toto’ in the cell works fine. Now, replace ‘toto’ with ‘usi’, ‘usin’, ‘usinge’, ‘using2’, …. and all works fine (case1 in document attached). BUT replace with ‘using’ and the template stops working. The debug log does not show anything abnormal: just ‘using’ where is it supposed to be in the email. Still, the email does not fire (case2 in document attached).
<messaging:emailTemplate relatedToType="CNPosition__c" language="{!relatedTo.DocumentLanguage__c}" subject="{!$Label.CNWelcomeToTheCCNAdministratorComunity}" id="CNSubEvePubEmaTem" >
<messaging:htmlEmailBody>
<table align="center" width="600" style="width:600px;margin-left:auto;margin-right:auto;" >
<tr><td>
<c:CNOrgOwnAddBlo att="{!relatedTo.LinkCNOrgAcc__r}" lan="{!relatedTo.DocumentLanguage__c}" />
</td></tr>
<tr><td>
toto
</td></tr>
</table>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Now, if it helps someone diagnose the problem, simply remove the <br/> in the component <apex:outputText value="{!att.LinkCNAddressBilling__r.City__c}<br/>" and it all works fine with ‘using’ (case3 in document attached).
Because I realize it sounds crazy, the link below shows a few screenshots.
http://www.ccnfr.org/various/20160903-VFTemplateInsane.pdf
Well, thanks a lot for trying to figure this one out.
Jerome
Hello everyone,
I am facing a new behavior in the user debug log. I get one line such as below:
16:41:29.18 (18684983)|USER_INFO|[EXTERNAL]|00520000001LzfN|admin@ccnfr.org.ccnussb|Eastern Standard Time|GMT-04:00
for each access to a sObject field in the page, either in the VF page such as {!sObject record} OR accessed through Javascript. Problem is that I get 50+ of these lines in some busy pages and the log quits before the end at a line like this.
????????  Does anyone have the same issue?
Any idea? Is this a bug?  Can I remove these lines through the filters?  i tried all day long, with no sucess; Even setting Apex debug level to none brings these lines back.
Thansks in advance for your help.
Jerome
Hello everyone,
My VF page without controler is built out of 2 Components, each one with its own controller.
Each component displays the same list of records, built through a SOQL method, in an ApexPageBlock, itself in an OutputPanel, with a Delete button for each record in the table.
When I delete a record in Component1, I want:
- the list to be updated in the Compoent1. This is easy,
- the list to be updated in the Component2, through a reRender or the like, without reloading the entire page.
Am I clear enough? What is the best Apex / VF method to achieve this?
Thanks in advance for your support, Best regards,
Jerome
Hello eveyone,
Stange question, but all my Email Visualforce templates that used to work before do not work today. The problem is only with the Visualforce templates. The text-based templates work well. To be more specific, the emails are sent to the correct address, the subject line is OK, but the Body is not visible, neither in HTML nor Plaintext format; Attachement do not work either.  It feel kind of like there is a problem in the SFDC side. Am I missing something?
Any idea? Thanks for your support.
Best regards,
Jerome

Hi ,

 

I want to remove setup from user menu for one profile.

Please guide me to solve this.

 

Regards,

Aravind

9701508070

  • August 21, 2013
  • Like
  • 0