• Michael Alamag 2
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Hi,

Im trying to get the value of the selectchecboxes using javascript to check if user selected atleast one option in checkboxes. But I always get an undefined value.


Here's my code.
 <apex:selectcheckboxes id="valuesettings" styleClass="font-regular-checkboxes-container" layout="pageDirection" label="Value Settings" value="{!VSItems}">                   
                                        <apex:selectoptions value="{!VSOptions}"> </apex:selectoptions>       
                                    </apex:selectcheckboxes>

<script> 
        // JavaScript function to check the value entered in the inputField
        function checkField() {
            var val = document.getElementById('{!$Component.deal.valuesettings}').value;
            if (val == 0 ) {
                alert('val is '+val);
               
            }
            else alert('Please enter some text'+val);
        }
        </script>
 
Hi!  I have a URL 
CustomerSuccess_Private_CommForumPage?amp%3bs=0tok0000000cujnoas&t=0tok0000000cu2toas

I can get the value of parameter 't' using this 
String topId = internal.getParameters().get('t');
but when I try to get the value of parameter 's', I always get the value of null.

By the way, I've noticed that the symbol (&) in url changed into amp%3b.
I am using a URL Rewriter for my community site and I just found out these:
In global list<PageReference> generateUrlFor() I can do this query 
                                String gid = internal.getParameters().get('id');
                                //Select the Group Name
                                CollaborationGroup groups = [SELECT Name FROM CollaborationGroup WHERE id =: gid LIMIT 1]; 
But in global PageReference mapRequestUrl() I can't do this query
                               String groupName = path.remove(0).replaceAll('_',' ');
                               //Select the ID of the CollaborationGroup that matches the name from the URL
                               CollaborationGroup colGroup = [SELECT id FROM CollaborationGroup WHERE Name =: groupName LIMIT 1];

Can anyone help me to solve this cause I need to get the colGroup.id and pass it just like this in mapRequestUrl()
return new PageReference(GROUP_VISUALFORCE_PAGE + colgroup.Id); 
I sent this in to SalesForce support as well but figured I'd ask here after they were unable to resolve the situation quickly.  I am convinced that the solution to this problem must be something simple but it is buried in SalesForce documentation somewhere and I'm too inexperienced with SF to know where to look.  

I'm trying to modify an existing login routine to redirect a user to a resource automatically.  Said another way, if a user bookmarks a particular resource on my site, I want to be able to redirect them to log in, then after succesfully logging in, I want them to be redirected back to the resource they were originally trying to access.  

Here is the code I am working with currently (extremely simple) and a screenshot of a log of the code running.  The relevant parts are highlighted.  
https://www.evernote.com/l/ANz7-J53DQpPP4jUQw_YikXkwM8HmnGBLB0

Here is the relevant documentation that guided me to this solution

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_sites.htm#apex_System_Site_login
https://help.salesforce.com/apex/HTViewHelpDoc?id=sso_provider_addl_params_start.htm&language=en_US

I'm missing something, because the startUrl appears to be completely ignored.  Users are redirected to log in, the url they came from is logged, and then they are redirected back to the site's "home" page every time.  Thanks for reading!  
Hello All,
I have following vf code which populates the checkbox on browser as given below.
VF Code:
      <Apex:pageBlockSection title="Products" columns="1" id="pbsec55" >
            <apex:selectCheckboxes id="products" value="{!product}">
                <apex:selectOptions value="{!productOption}" id="items"></apex:selectOptions>
        </apex:selectCheckboxes>        
        </Apex:pageblockSection>         

Browser 
User-added image

QA:
I want that before this form is submitted at least on check box must be checked. Would like to do checkbox validation using javascript.
Also, what are different ways I can to do checkbox validation on visualforce page?
 
We just upgraded/migrated our Customer Portal to the new Customer Communities platform (but kept the Customer Portal licenses and did not migrate to new Communities licenses) and now when we create a new Community User the Welcome email is not sending at all - regardless of whether or not you check "Generate new password and notify user immediately" or not - have tried both ways on initial creation and either way it does not send the welcome email.

In the Manage Communities Setup option we do have "Send welcome email" checked and created a new email template to be used with it. The template is active and Available for Use. All of the Portal Profiles and permissions have been given access to the new Community. 

When I first Published the new Community I did not have the Manage Communities Setup option "Send welcome email" checked because I didn't want to blow up all the existing Users' inbox. We were already sending an email to customers announcing the upgraded Community. But then once it was Published and the new email template was created the setting was checked back to "Send welcome email".

What does work is after you create the new user and leave "Send welcome email" unchecked, Save it. Then go back and click 'Edit' and now check "Send welcome email". That will then send the email template set for the 'Forgot Password' and 'Change Password' options in the Manage Communities Setup options.

And apparently, SFDC changed how they treat these emails from Portal to Communities, but does not mention this in any documentation. In Portals an auto-generated password used to be contained directly in the email template, inserted at the bottom.

Now, in the new Communities, that auto-generated password is no longer included, but they changed how they do this for security reasons (winter 14 release update apparently) and instead of sending a username and password in the email they now send a special link that allows people to click and change their password.

The trick is that your forgot your password email template needs to include this special merge field (undocumented anywhere by SFDC from what I found):

{!Community_Url}

If you include that it will be replaced with a special url that allows the user to change their password and logs them in. Thread where I first found this out: http://salesforce.stackexchange.com/questions/17887/communities-forgot-password-emails

This is being successfully included in the 'Forgot Password' and 'Change Password' email templates that were created. So when I go back to the newly created User and click 'Edit' and now check "Send welcome email", it does send the email template set for the 'Forgot Password' and 'Change Password' options to the new user and they are able to get in after setting their password.

Any ideas or help you can provide??

Thanks,
Alex