• Dev.Ashish
  • NEWBIE
  • 315 Points
  • Member since 2014

  • Chatter
    Feed
  • 10
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 83
    Replies
Hi folks,
          Can anyone tell me whats prupose of customer community login license and how they difffer from customer community license


Thanks in advance
Karthick
I've created a really simple pagination with search box and created a simple VF page with inline editing on the fields.
Now,depending on what I do between filling in a value in the field and clicking the Save button,it will affect whether the new value is saved or not.

So if I double click on the Last row, amend value, hit enter.The text turns orange and I get the undo icon as expected and Save, it saves the record.But when I edit and click Save for the previous records, the value goes back to its OLD value and is not updated.


Page :

public class PagingTasksController{

    public List<Task> tasks;
    public Integer CountTotalRecords{get;set;}
    public String QueryString {get;set;}
    public Integer OffsetSize = 0;
    private Integer QueryLimit = 3;
    public List<Task> lstTasks;
    public String searchText {get;set;} 
   
    public PagingTasksController (){
        //CountTotalRecords= [select count() from Task];
    }
   


    public List<Task> getTasks(){
        if(tasks == null){
            tasks = new List<Task>();
        }
        return tasks;
    }
   
    public void findTasks(){
        String qStr2 = 'Select count() from Task where Subject like \'%'+searchText+'%\' OR Status like \'%'+searchText+'%\'';
        CountTotalRecords = Database.countQuery(qStr2);
        queryTasks();
    }
   
    public void  queryTasks(){
        String qStr = 'Select OwnerId,Subject,Status,Priority from Task where Subject like \'%'+searchText+'%\' OR Status like \'%'+searchText+'%\' Order By Subject,Status limit ' + QueryLimit + ' offset ' + OffsetSize;
        tasks = Database.query(qStr);
        tasks.sort();

    }

    public Boolean getDisablePrevious(){
        if(OffsetSize>0){
            return false;
        }
        else return true;
    }

    public Boolean getDisableNext() {
        if (OffsetSize + QueryLimit < countTotalRecords){
            return false;
        }
        else return true;
    }

    public PageReference Next() {
        OffsetSize += QueryLimit;
        queryTasks();
        return null;
    }

    public PageReference Previous() {
        OffsetSize -= QueryLimit;
        queryTasks();
        return null;
    }

   public PageReference save() {
        update tasks;
        return ApexPages.CurrentPage();
    }
   
}

<apex:page controller="PagingTasksController">
    <apex:form >
        <apex:pageBlock title="Tasks" id="pgBlock">
           <apex:pageBlockButtons >
               <apex:commandButton action="{!save}" id="saveButton" value="Save"/>
               <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel"/>
           </apex:pageBlockButtons>
    
        <apex:inlineEditSupport showOnEdit="saveButton, cancelButton"
                    hideOnEdit="editButton" event="ondblclick"
                    changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
    
       <apex:inputText id="searchBox" value="{!searchText}"/>
        <apex:commandButton value="Search" reRender="pgTable,pgBlock" action="{!findTasks}"/>
        <apex:pageBlockTable value="{!Tasks}" var="tsk" id="pgTable" >
   <apex:column >
  <apex:outputLink value="{!URLFOR($Action.Task.Delete, tsk.id,['retURL'='/apex/task_test'])}" >Delete</apex:outputLink>
</apex:column>
          
                <apex:column value="{!tsk.Subject}"/>
                <apex:column value="{!tsk.Status}"/>
                <apex:column value="{!tsk.Priority}"/>
                <apex:column value="{!tsk.OwnerId}"/>
            </apex:pageBlockTable>
            <apex:pageBlockButtons >
                <apex:commandButton value="Previous" action="{!Previous}" rerender="pgTable,pgBlock"
                                    status="status" disabled="{!DisablePrevious}" />
                <apex:commandButton value="Next" action="{!Next}" reRender="pgTable,pgBlock"
                                    status="status" disabled="{!DisableNext}" />
                <apex:actionStatus id="status" startText="Please Wait..."/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
     <apex:enhancedlist type="Activity" height="800" rowsPerPage="50" customizable="False"/>
</apex:page>

    
Class :


public class PagingTasksController{

    public List<Task> tasks;
    public Integer CountTotalRecords{get;set;}
    public String QueryString {get;set;}
    public Integer OffsetSize = 0;
    private Integer QueryLimit = 3;
    public List<Task> lstTasks;
    public String searchText {get;set;} 
   
    public PagingTasksController (){
        //CountTotalRecords= [select count() from Task];
    }
     public List<Task> getTasks(){
        if(tasks == null){
            tasks = new List<Task>();
        }
        return tasks;
    }
   
    public void findTasks(){
        String qStr2 = 'Select count() from Task where Subject like \'%'+searchText+'%\' OR Status like \'%'+searchText+'%\'';
        CountTotalRecords = Database.countQuery(qStr2);
        queryTasks();
    }
   
    public void  queryTasks(){
        String qStr = 'Select OwnerId,Subject,Status,Priority from Task where Subject like \'%'+searchText+'%\' OR Status like \'%'+searchText+'%\' Order By Subject,Status limit ' + QueryLimit + ' offset ' + OffsetSize;
        tasks = Database.query(qStr);
        tasks.sort();

    }

    public Boolean getDisablePrevious(){
        if(OffsetSize>0){
            return false;
        }
        else return true;
    }

    public Boolean getDisableNext() {
        if (OffsetSize + QueryLimit < countTotalRecords){
            return false;
        }
        else return true;
    }

    public PageReference Next() {
        OffsetSize += QueryLimit;
        queryTasks();
        return null;
    }

    public PageReference Previous() {
        OffsetSize -= QueryLimit;
        queryTasks();
        return null;
    }

   public PageReference save() {
        update tasks;
        return ApexPages.CurrentPage();
    }
   
}

Am I coding my inline edit incorrectly? Can you see anything unusual?
Hi All,

I have a requirement, where pagination and search functionality has to be done.I did it but there are 2 pageblock values as under

<apex:pageblocktable value="{!SearchResults}" /> // for Search functionality and
another value is  {!tasks} // for pagination. I cannot use both the values which will be incorrect way of coding.How can i achieve both the functionalities ?

I have tried a lot but i couldnt find out how to get it. :(  Experts i need your help here to achieve my goal . My code as under . Have given full code for better understanding .


public with sharing class TaskListController{
  
     // Pagination staets
    public PageReference save() {
        return null;
    }
    public PageReference edit() {
        return null;
    }
        private integer counter=0;  //keeps track of the offset
        private integer list_size=3; //sets the page size or number of rows
        public integer total_size; //used to show user the total size of the list
        public string selectedPage{get;set{selectedPage=value;}
    }
     public TaskListController() {
        total_size = [select count() from Task]; //set the total size in the constructor
        selectedPage='0';
    }
    public Task[] getTasks() {
       if (selectedPage != '0') counter = list_size*integer.valueOf(selectedPage)-list_size;
        try {
            //we have to catch query exceptions in case the list is greater than 2000 rows
                Task[] taskList = [select Id,Subject, Status, Description
                                     from Task
                                     order by Id
                                     limit :list_size
                                    offset :counter];                  
                return taskList;
       
        } catch (QueryException e) {                           
                ApexPages.addMessages(e);                  
                return null;
        }       
    }
   
    public Component.Apex.pageBlockButtons getMyCommandButtons() {
       
        //the reRender attribute is a set NOT a string
        Set<string> theSet = new Set<string>();
        theSet.add('myPanel');
        theSet.add('myButtons');
               
        integer totalPages;
        if (math.mod(total_size, list_size) > 0) {
            totalPages = total_size/list_size + 1;
        } else {
            totalPages = (total_size/list_size);
        }
         integer currentPage;       
        if (selectedPage == '0') {
            currentPage = counter/list_size + 1;
        } else {
            currentPage = integer.valueOf(selectedPage);
        }
        Component.Apex.pageBlockButtons pbButtons = new Component.Apex.pageBlockButtons();       
        pbButtons.location = 'top';
        pbButtons.id = 'myPBButtons';
        Component.Apex.outputPanel opPanel = new Component.Apex.outputPanel();
        opPanel.id = 'myButtons';
                               
        //the Previous button will alway be displayed
        Component.Apex.commandButton b1 = new Component.Apex.commandButton();
        b1.expressions.action = '{!Previous}';
        b1.title = 'Previous';
        b1.value = 'Previous';
        b1.expressions.disabled = '{!disablePrevious}';       
        b1.reRender = theSet;
       opPanel.childComponents.add(b1);       
                       
        for (integer i=0;i<totalPages;i++) {
            Component.Apex.commandButton btn = new Component.Apex.commandButton();
           
            if (i+1==1) {
                btn.title = 'First Page';
                btn.value = 'First Page';
                btn.rendered = true;                                       
            } else if (i+1==totalPages) {
                btn.title = 'Last Page';
                btn.value = 'Last Page';
                btn.rendered = true;                           
            } else {
                btn.title = 'Page ' + string.valueOf(i+1) + ' ';
                btn.value = ' ' + string.valueOf(i+1) + ' ';
                btn.rendered = false;            
            }
           if (   (i+1 <= 5 && currentPage < 5)
                || (i+1 >= totalPages-4 && currentPage > totalPages-4)
                || (i+1 >= currentPage-2 && i+1 <= currentPage+2))
            {
                btn.rendered = true;
            }
                                    
            if (i+1==currentPage) {
                btn.disabled = true;
                btn.style = 'color:blue;';
            } 
           btn.onclick = 'queryByPage(\''+string.valueOf(i+1)+'\');return false;';
           opPanel.childComponents.add(btn);
           if (i+1 == 1 || i+1 == totalPages-1) { //put text after page 1 and before last page
                Component.Apex.outputText text = new Component.Apex.outputText();
                text.value = '...';       
                opPanel.childComponents.add(text);
            }
         }
       //the Next button will alway be displayed
        Component.Apex.commandButton b2 = new Component.Apex.commandButton();
        b2.expressions.action = '{!Next}';
        b2.title = 'Next';
        b2.value = 'Next';
        b2.expressions.disabled = '{!disableNext}';       
        b2.reRender = theSet;
        opPanel.childComponents.add(b2);
               
        //add all buttons as children of the outputPanel               
        pbButtons.childComponents.add(opPanel); 
       return pbButtons;

    }   
   
    public PageReference refreshGrid() { //user clicked a page number       
        system.debug('**** ' + selectedPage);
        return null;
    }
    public PageReference Previous() { //user clicked previous button
        selectedPage = '0';
        counter -= list_size;
        return null;
    }
   public PageReference Next() { //user clicked next button
        selectedPage = '0';
        counter += list_size;
        return null;
    }
    public PageReference End() { //user clicked end
        selectedPage = '0';
        counter = total_size - math.mod(total_size, list_size);
        return null;
    }
    public Boolean getDisablePrevious() { //this will disable the previous and beginning buttons
        if (counter>0) return false; else return true;
    }
    public Boolean getDisableNext() { //this will disable the next and end buttons
        if (counter + list_size < total_size) return false; else return true;
    }
    public Integer getTotal_size() {
        return total_size;
    }
    public Integer getPageNumber() {
        return counter/list_size + 1;
    }

    public Integer getTotalPages() {
        if (math.mod(total_size, list_size) > 0) {
            return total_size/list_size + 1;
        } else {
            return (total_size/list_size);
        }
    } // Pagination ends

      // Search functionality starts here
        
       public apexpages.standardController controller{get;set;}
       public Task l;
       public List<Task> searchResults {get; set; }

      public string searchText
      {
       get
       {
         if (searchText==null) searchText = '';
         return searchText;
       }
      set;
       }
     public TaskListController(ApexPages.StandardController controller)
     {
        this.controller = controller;
        this.l = (Task) controller.getRecord();
      }

    public PageReference search()
    {
      if(SearchResults == null)
      {
        SearchResults = new List<Task>();
      }
     else
     {
        SearchResults.Clear();
     }

  String qry ='Select Id, Subject,Status from Task where Subject like \'%'+searchText+'%\' OR Status like \'%'+searchText+'%\' Order By Subject,Status';
  SearchResults = Database.query(qry);
  searchResults.sort();
   //System.debug(SearchResults);
   return null;
    }
   }

  
 <!-- Page -->

 
<apex:page controller="TaskListController">
      <apex:form id="searchForm">
       <apex:PageBlock mode="edit">    
        <apex:actionFunction action="{!refreshGrid}" name="queryByPage" reRender="myPanel,myButtons" >
        <apex:param name="firstParam" assignTo="{!selectedPage}" value="" />
       </apex:actionFunction>
       <apex:dynamicComponent componentValue="{!myCommandButtons}"/>       
       <apex:outputPanel id="myPanel">
       <apex:pageMessages id="theMessages" />
       <apex:pageblockSection id="searchBlockSection">
          <apex:pageBlockSectionItem id="searchBlockSectionItem">
            <apex:outputLabel >Keyword</apex:outputLabel>
    <apex:panelGroup >
    <apex:inputtext id="searchTextBox" value="{!searchText}"> </apex:inputtext>
    <apex:commandButton Id="btnSearch" action="{!Search}" rerender="renderBlock" status="status" title="Search" value="Search">                    </apex:commandButton>
    </apex:panelGroup>
          </apex:pageBlockSectionItem>
    </apex:pageblockSection>
  
    <apex:actionStatus id="status" startText="Searching... please wait..."/>    
    <apex:pageBlocksection id="renderBlock" >
      <apex:pageblocktable value="{!SearchResults}" var="t" rendered="{!NOT(ISNULL(SearchResults))}" align="center">
            <apex:outputLink value="/{!t.Id}">{!t.Subject}</apex:outputLink>
            <apex:column value="{!t.Subject}"/>
            <apex:outputLink value="/{!t.Id}">{!t.Status}</apex:outputLink>
            <apex:column value="{!t.Status}"/>
            <apex:facet name="footer">Showing Page # {!pageNumber} of {!totalPages}</apex:facet>
      </apex:pageblocktable>   
  </apex:pageBlocksection>
   </apex:outputPanel>
   </apex:pageblock>
  </apex:form>
   <apex:enhancedlist type="Activity" height="800" rowsPerPage="50" customizable="False"/>
</apex:page>
Hi All,

We have a requirement where we need to show a Salesforce org with in an iframe in another salesforce org using Salesforce canvas. Could anyone let me know if this is possible using salesforce canvas? If yes, how we can achieve this.

Requirement is on the Case page layout we need to show another salesforce orgnanization's salesforce org.

Thanks,
Raghu
hi floks

i have one requirment 

if check box is checked and associate piclkist field is enble .and it's unchecked picklist field was disable .

how to do this requirment ?  
Guys Will you please explain me the following Validation rule, as I have very basic knowledge on date validation rules I am unable to understand the following date validation rule.  Currently we are stuck in this validation rule in cases, which are clearing basing on priority. We are giving support to our customers basing on priority, the following is our old priority and issue clearance for our customers and we have to apply new priority rules to serve our customers. 

IF(
ISNULL( FLAGS__ViewedFlag__c),
null,
DATETIMEVALUE(TEXT(
DATEVALUE(FLAGS__ViewedFlag__c+
CASE(TEXT(Priority),
'P1',
CASE(MOD(DATEVALUE(FLAGS__ViewedFlag__c)- DATE(1900, 1, 7),7),
1,1,
6,3,
0,2,
2,1,
3,1,
4,1,
3),
'P2',
CASE(MOD(DATEVALUE(FLAGS__ViewedFlag__c)- DATE(1900, 1, 7),7),

1,2,
6,4,
0,3,
2,2,
3,2,
4),
'P3',
CASE(MOD(DATEVALUE(FLAGS__ViewedFlag__c)- DATE(1900, 1, 7),7),
1,3,
6,5,
4,5,
5,5,
0,4,
2,3,
3,5,
5),
CASE(MOD(DATEVALUE(FLAGS__ViewedFlag__c)- DATE(1900, 1, 7),7),
6,9,
0,10,
7))))
I am trying to create a custom delete button on an objectA which deletes the particular record only if the value in fieldA matches the Role of the logged in user. If it does not match it needs to throw an error. I was trying to use 'OnClick javascript". Can anyone help me wit the code? Thanks!
hi floks ,

how to reslove this error pls help me

Compile Error: unexpected token: 'global'
Hello everyone,
            I am Karthick and I am new to the salesforce ..
Can anyone tell me What are the topics I have to learn for admin??
Please help
Is there a way to search a text field and create a List or Map with entries each time a specific string of characters is in the text field? I'm looking for a way to go through a text (not Rich) field and make merge field replacements, in much the same way the standard email templates work in SF.

Unlike a standard email, my text field can have fields from up to 4 objects + Sending User fields; an email template on steroids.

For instance:

{!Contact.FirstName} {!Contact.LastName}
{!Account.BillingStreet}
{!Account.BillingCity} etc...

Dear {!Contact.FirstName},

Account Name: {!Account.Name}

Possible {!Lead.Name} in here for good measure. This is my body. More fields possible down below. {!Custom_object__c.Field} too!

Sent by: {!User.FirstName} {!User.LastName}

I want a List/Map for each object in the above text field with the field merge field name in it.

List<String> contactFields as
{!Contact.FirstName}
{!Contact.LastName}
etc... 
List<String> accountFields
List<String> LeadFields
List<String> customerObjectFields
List<String> sendingUserFields

OR

Map<String, String> contactFields ('{!Contact.FirstName}', 'FirstName')
etc...
Map<String, String> accountFields ('{!Account.Name}', 'Name')

Once I have the Lists, I can do some trimming/looping to create SOQL statements and return the field values for the merge fields. In essence, I'm trying to loop through a single field.

I'll worry about doing the actual merge once I get over this hurdle as it will take another pass through the text field making replacements. I actually feel better about this one though—a while loop checking for ‘{!’ In the text field.

Thanks in advance!
~J

@Conga_Jereriah
hi,
i want to create web page on side.com with bootstarp like responsive themes.
can you help me how to create web page with bootstarp.
pls help me....
Hi All.....

I am trying to write a Visualforce page that needs to show some Lookup fields and its related fields.

We have a Custom Object called "Storyboard__c", and this object has to lookup fields

1. Field name: "Origin" , and the lookup object is also same "Storyboard__c", child relationship name is "Origin-Stroyboard"
2. Field name: "Ploting" , and the lookup object is also same "Storyboard__c" child relationship name is "Ploting-Stroyboard"

If I have a record in Storyboard called "Global" and its Origin called "Public Interest" in other words "Public Interest" is also a Storyboard and it will have its own "Origin" and "Ploting"

Now, the Main issue is - As both these fields are lookup fields to the same object I am getting confused and not understanding how to write the controller or class to get the information.

I Need to display in a Visualforce page the three levels of Origin and Ploting details for every story board
                  

file

Hi All,

I want to genertae a report which shows the numbner of logins by a active users in a month. How can this be achived?

Any help would be appreciated.

Regards,
Alok
  • September 17, 2014
  • Like
  • 0
In contact object i have field called MyExpenses(hidden field). This field is populated from CompanyExpenses/no.of.contacts

There two contacts now, So for each contact myExpeness is $100...companyExpensesis $200(constant)

Now if i create another new  contact then Myexpenses filed should be 200/3..

So i need to write trigger to update this hidden field when i create any new contact..

Please help to write this trigger

Thanks
Hi,
WE have a requirement where in the the created by field in the case comment should not be visible to the User??Can someone please guide me on how to do this?

Thanks

I am currently developing a CTI app for Salesforce using the new salesforce Open CTI API. I wanted to understand if there are any security concerns from salesforce if the JavaScript code inside the visual force page of my app makes a cross-domain call to the CTI web-services of my telephony system hosted on another server. Actually the kind of implementation I have for my demo app is I am making cross-domain calls to my CTI web-services hosted on a server for directing my telephony system to make outbound/inbound calls using the JavaScript code written in the visual force pages and use the apex classes to get customer details from sales force. I just wanted understand that is making a cross domain call from the visual force page a security risk according to sales force? Or is the above configuration accepted by sales force  security review process? Kindly note that the web-services will be hosted in a secure fashion over https. I am asking this query as I wish to host this app on App Exchange in future once it's fully developed.
I have two inline VF Pages on a page layout.My requirement is that i want to control the visibilty or access to those inline VF pages on the basisi of a set of users.
Means,only a set of users should see one inline VF page and others should see only the second one and not the first one.
Can anyone please suggest any solution
Hi

I know how to break a text in formula field ,  i gave 

Label1__c &  BR()  &  Label2__c

Now my question is  how should i separate two currency field ?

Month1__c     Month2__c

what should i use inbetween this two field to get in next line.

Thanks In advance
i have a page in php on wordpress,which is integrated with .php ,I am getting some values from that page into .php , I want same information in salesforce(Lead) from same page,  How can i do that ,using same Page without using Web2Lead
Hi,

I wont add column to initial list view of my object. It's possible? and How? It is possible create some list view for a custom object and visualize it for all user?

Thank you for your help.

Benny
Is there any way to parse diffrent types of .xls files into Salesforce ? Or any other way to convert them dynamically into .csv so that we can parse them easily.?
Hi All,

We have a plan to build a shopping cart application.For that we need to clarify some more doubts.Please check,

1. The customers will register from our UI to SFDC. What will be the user type?
2.  When we adding the user from our application that user can login with their credential to SFDC.
  Is that right way to adding customers to our application?
3.  If the users are not SFDC users, how can the customer authentication works?
Ho to share the all opportunty records from Salesforce orgA to salesforce org B using Batch class..
If you have any code can you please share me..

Hi Team,

I want to disable delete option from task. please assist on this.

Thanks,
Rohit Sharma