Ajax (1) Apex Class (12) Apex Trigger (2) Community (2) Home Page (1) HTML (4) Integration (3) JS (7) KB (1) Label (1) Licenses (1) Listing (1) Log (1) OOPs (5) Sharing (1) Static Resource (1) Test Class (3) URI (1) Visualforce (10)

Monday 23 February 2015

Enabling Super User Access in Communities


Enabling Super User Access in Communities | Salesforce

Enabling Super User Access in Communities

Enable super user access so that partner users in communities can access additional records and data.
Available in: EnterprisePerformanceUnlimited, and Developer Editions

User Permissions Needed
To enable Super User Access:“Customize Application”

If your community is set up with Partner Community user licenses, this setting applies. You can also grant super user access to users with Customer Community Plus licenses. For more information, see Grant Super User Access to Customer Users in Your Community.

Granting super user access to external users in your community lets them access additional data and records, regardless of sharing rules and organization-wide defaults. Super users have access to data owned by other partner users belonging to the same account who have the same role or a role below them in the role hierarchy. Super user access applies to cases, leads, custom objects, and opportunities only, but external users have access to these objects only if you exposed them using profiles or sharing and added the tabs to the community during setup.

  1. Click Customize | Communities | Settings.
  2. Select Enable Partner Super User Access.
  3. Click Save.

You can now assign super user access.

To disable super user access, deselect Enable Partner Super User Access. If you re-enable this feature, all users who were assigned super user access before the feature was disabled will automatically get super user access again.



Sunday 22 February 2015

Hiding Dropdown Values using javascript on community

Create Custom link Javacript:

{!REQUIRESCRIPT("/communityName/resource/1424668417000/krrish")}

Uploaded static resource:
Name: krrish.js
Code:
setTimeout(function(){
var optionDrop = document.getElementById("00N40000002IC8J");
for (i = 0; i < optionDrop.options.length; i++) {
  if(optionDrop[i].value=='Actional' || optionDrop[i].value=='DataXtend SI'|| optionDrop[i].value=='Savvion'||optionDrop[i].value=='Sonic'||optionDrop[i].value=='DCM'||optionDrop[i].value=='POS'||optionDrop[i].value=='ObjectStore'||optionDrop[i].value=='Other'||optionDrop[i].value=='GCE'||optionDrop[i].value=='CIS'||optionDrop[i].value=='EDI'||optionDrop[i].value=='Hosting Services')
    {
   optionDrop[i].style.display= "none";
   }
}},1000);

Monday 16 February 2015

How do I add myself as a member of a Community if the Manage Link is missing?

How do I add myself as a member of a Community if the Manage Link is missing?


Knowledge Article Number: 000212095 


Description
In the Spring '15 Release it is now required that your profile be listed as a member of the Community in order to Manage it. If your profile is not listed as a Member then the new Manage Link will not be visible. The following walkthrough shows you how to add your profile back into the Community using the Apex Data Loader tool. 


Resolution
CREATE THE CSV FILE FOR INSERT:

Step 1: Gather your ParentID (Profile) and NetworkID (Community). The following Screen shots demonstrate how to gather this. 

Img 1: Profile ID can be copied from the URL of the Profile detail page.

User-added image

Img 2: NetworkID can be gathered by right clicking on the URL for the Community in the All Communities page in setup. Select Inspect Element and it should give you a console view below the page with the NetworkID highlighted.

User-added image

2. Create a .csv using a program such as Microsoft Excel and include the following Columns:

NETWORKID
PARENTID

3. Input the ID's that you gathered from Step 1 and add them to your csv file. Please see the following screen capture:

Img 3: Spreadsheet showing the correct formatting.

CSV Format

4. Save your file to your computer.

INSERT USING DATA LOADER

1. Download and install the Data Loader tool. Please see the following help article on how to do this:

https://help.salesforce.com/HTViewSolution?id=000005247&language=en_US

2. Open Data Loader and then click on Insert which takes you to the login screen. Login using your Salesforce username and password. See Following Image:

Img 4: Data Loader Login.

User-added image

3. After you receive the Login completed successfully message click next. You should now be at the "Select Salesforce object" page. Click the checkbox next to "Show all Salesforce objects" and Select Network Member Group from the picklist.

4. On the same page Click Browse to add the file location of the CSV file you just saved to your computer. Click Next once you have done this.

5. You will be presented with a Data Selection window showing how many records will be updated. See the following:

Img 5: Records to be updated.

User-added image

6. Click OK. You should now be on the Mapping portion of the process. Click Create or Edit a Map.

7 Click Auto-Match Fields to Columns and click OK.

8. Click Next.

9. Final step is to specify where to save the Success and Error files when the process completes. Click Browse to do this and click Finish.

Now check the All Communities page in setup to confirm that you now see the "Manage" link on the row of the affected Community. 

Friday 13 February 2015

Column Toggle Table

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>

<div data-role="page" id="pageone">
  <div data-role="header">
    <h1>Column Toggle Table</h1>
  </div>
  
  <div data-role="main" class="ui-content">
     <p>The "column toggle table" will hide columns when there is not enough width to display the data.</p>
    <p>In this example we have used the well-known Northwind sample database. Below is a selection from the "Customers" table.</p>
    <h4>Slowly resize the width of your browser window. The layout will adjust itself to fit the "new" width of the browser. OR, you can use the "Columns..." button to choose which column should be hidden or shown.</h4>
    <table data-role="table" data-mode="columntoggle" class="ui-responsive" id="myTable">
      <thead>
        <tr>
          <th data-priority="6">CustomerID</th>
          <th>CustomerName</th>
          <th data-priority="1">ContactName</th>
          <th data-priority="2">Address</th>
          <th data-priority="3">City</th>
          <th data-priority="4">PostalCode</th>
          <th data-priority="5">Country</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>1</td>
          <td>Alfreds Futterkiste</td>
          <td>Maria Anders</td>
          <td>Obere Str. 57</td>
          <td>Berlin</td>
          <td>12209</td>
          <td>Germany</td>
        </tr>
        <tr>
          <td>2</td>
          <td>Antonio Moreno Taquería</td>
          <td>Antonio Moreno</td>
          <td>Mataderos 2312</td>
          <td>México D.F.</td>
          <td>05023</td>
          <td>Mexico</td>
        </tr>
        <tr>
          <td>3</td>
          <td>Around the Horn</td>
          <td>Thomas Hardy</td>
          <td>120 Hanover Sq.</td>
          <td>London</td>
          <td>WA1 1DP</td>
          <td>UK</td>
        </tr>
        <tr>
          <td>4</td>
          <td>Berglunds snabbköp</td>
          <td>Christina Berglund</td>
          <td>Berguvsvägen 8</td>
          <td>Luleå</td>
          <td>S-958 22</td>
          <td>Sweden</td>
        </tr>

      </tbody>
    </table>
  </div>

  <div data-role="footer">
    <h1>Footer Text</h1>
  </div>
</div> 

</body>
</html>

Wednesday 11 February 2015

just found another list of uri mappings:

Standard object based pages:

/d: Detail- Detailing a single record and with its associated records 
/m: Hover- HoverDetail page that uses a mini layout and no header/footer 
/e: editPage Allowing the editing of a single record 
/p: printableView- In a relatively unadorned format, detailing a single record and all of its associated records. Does not have a help link, since you can't click links on paper.
/o: Overview of a single entity. 
/l: list- A filtered list of a single entity 
/x: Printable list: A filtered list of a single entity. Does not have a help link, since you can't click links on paper.
/r: Refresh list: A stripped down version of a list filtered by ids 
/s: special: Special is used for "other" pages where you want to reuse parts of the edit/detail page
/h: history: Show the history (used only in forecasting) 
/a: Assign: Entity Owner Change page 
/c: calendar: Time-based (Calendar) view of list data 
/n: mini edit: Mini layout edit page 

Custom Objects based Pages

/d: Detail
/m: Hover
/e : Edit
/p: Printable View
/o: Overview
/l: List
/x: Printable List
/a: Assign
/r: Refresh List

Tuesday 10 February 2015

Email Logs

Email logs describe all emails sent through salesforce.com and can be used to help identify the status of an email delivery. Email logs are CSV files that provide information such as the email address of each email sender and its recipient, the date and time each email was sent, and any error code associated with each email. Logs are only available for the past 30 days.


Monday 9 February 2015

Working with Field Sets

Open topic with navigation

Working with Field Sets

You can use dynamic bindings to display field sets on your Visualforce pages. A field set is a grouping of fields. For example, you could have a field set that contains fields describing a user's first name, middle name, last name, and business title. If the page is added to a managed package, administrators can add, remove, or reorder fields in a field set to modify the fields presented on the Visualforce page without modifying any code. Field sets are available for Visualforce pages on APIversion 21.0 or above. You can have up to 50 field sets referenced on a single page.

Working with Field Sets Using Visualforce

Field sets can be directly referenced in Visualforce by combining the $ObjectType global variable with the keyword FieldSets. For example, if your Contact object has a field set called properNames that displays three fields, yourVisualforce page can reference the field data through the following iteration:
<apex:page standardController="Contact">      <apex:repeat value="{!$ObjectType.Contact.FieldSets.properNames}" var="f">           <apex:outputText value="{!Contact[f]}" /><br/>      </apex:repeat>  </apex:page>
You can also choose to render additional information, such as field labels and data types, through the following special properties on the fields in the field set:
Property NameDescription
DBRequiredIndicates whether the field is required for the object
FieldPathLists the field’s spanning info
LabelThe UI label for the field
RequiredIndicates whether the field is required in the field set
TypeThe data type for the field
For example, you can access the labels and data types for the fields in properNames like this:
<apex:page standardController="Contact">      <apex:pageBlock title="Fields in Proper Names">          <apex:pageBlockTable value="{!$ObjectType.Contact.FieldSets.properNames}" var="f">              <apex:column value="{!f}">                  <apex:facet name="header">Name</apex:facet>              </apex:column>               <apex:column value="{!f.Label}">                  <apex:facet name="header">Label</apex:facet>              </apex:column>               <apex:column value="{!f.Type}" >                  <apex:facet name="header">Data Type</apex:facet>              </apex:column>           </apex:pageBlockTable>       </apex:pageBlock>   </apex:page>
If this Visualforce page is added to a managed package and distributed, subscribers can edit the properNames field set. The logic for generating the Visualforce page remains the same, while the presentation differs based on each subscriber’s implementation. To reference a field set from a managed package, you must prepend the field set with the organization’s namespace. Using the markup above, if properNames comes from an organization called Spectre, the field set is referenced like this:
{!$ObjectType.Contact.FieldSets.Spectre__properNames}

Working with Field Sets Using Apex

Fields in a field set are automatically loaded when your Visualforce page uses a standard controller. When using a custom controller, you need to add the required fields to the SOQL query for the page. Apex provides two Schema objects that allow you to discover field sets and the fields they contain, Schema.FieldSet and Schema.FieldSetMember. For information about these two system classes, see “FieldSet Class” in the Force.com Apex Code Developer's Guide.

Sample: Displaying a Field Set on a Visualforce Page

This sample uses Schema.FieldSet and Schema.FieldSetMember methods to dynamically get all the fields in the Dimensions field set for the Merchandise custom object. The list of fields is then used to construct a SOQL query that ensures those fields are available for display. The Visualforce page uses the MerchandiseDetails class as its controller.
public class MerchandiseDetails {        public Merchandise__c merch { get; set; }            public MerchandiseDetails() {          this.merch = getMerchandise();      }        public List<Schema.FieldSetMember> getFields() {          return SObjectType.Merchandise__c.FieldSets.Dimensions.getFields();      }        private Merchandise__c getMerchandise() {          String query = 'SELECT ';          for(Schema.FieldSetMember f : this.getFields()) {              query += f.getFieldPath() + ', ';          }          query += 'Id, Name FROM Merchandise__c LIMIT 1';          return Database.query(query);      }  }
The Visualforce page using the above controller is simple:
<apex:page controller="MerchandiseDetails">      <apex:form >          <apex:pageBlock title="Product Details">            <apex:pageBlockSection title="Product">                <apex:inputField value="{!merch.Name}"/>            </apex:pageBlockSection>                    <apex:pageBlockSection title="Dimensions">                <apex:repeat value="{!fields}" var="f">                    <apex:inputField value="{!merch[f.fieldPath]}" 
                      required="{!OR(f.required, f.dbrequired)}"/> </apex:repeat> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
One thing to note about the above markup is the expression used to determine if a field on the form should be indicated as being a required field. A field in a field set can be required by either the field set definition, or the field’s own definition. The expression handles both cases.

Field Set Considerations

Fields added to a field set can be in one of two categories:
  • If a field is marked as Available for the Field Set, it exists in the field set, but the developer hasn’t presented it on the packaged Visualforce page. Administrators can display the field after the field set is deployed by moving it from the Available column to the In the Field Set column.
  • If a field is marked as In the Field Set, the developer has rendered the field on the packaged Visualforce page by default. Administrators can remove the field from the page after the field set is deployed by removing it from the In the Field Set column.

The order in which a developer lists displayed fields determines their order of appearance on a Visualforce page.

As a package developer, keep the following best practices in mind:
  • Subscribers with installed field sets can add fields that your page didn’t account for. There is no way to conditionally omit some fields from a field set iteration, so make sure that any field rendered through your field set works for all field types.
  • We recommend that you add only non-essential fields to your field set. This ensures that even if a subscriber removes all fields in the field set, Visualforce pages that use that field set still function.
Note
Field sets are available for Visualforce pages on API version 21.0 or above.
© Copyright 2000–2015 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.

 

Hide dropdown values using jquery

<apex:page id="pageId" standardController="Case">

<html>
<head>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" />
<script>
$(document).ready(function(){

//alert('Hello'+document.getElementById('00Nf0000000uXUX').value);
    $( "#00N40000002IC8J option[value=Sonic]" ).wrap( "<span>" );
   $( "#selectlist option[value=4]" ).wrap( "<span>" );
});
</script>
</head>
<body>

<select id="selectlist" name="selectproduct" >
<option value=""> --- Select product  --- </option>
<option value="Actional">Product 1</option>
<option value="2">Product 2</option>
<option value="3">Product 3</option>
<option value="4">Product 4</option>
</select>
<input id="mytext" type="text" value="dgdfbg"/>

</body>
</html>

</apex:page