• Prasanthi
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
Hi 

I am working on communities.  I have a requirement to log users directly into the salesforce by clicking on a URL.
How to create a URL which redirects the user to the following page
https://strides-nyrr.cs8.force.com/STRIDEStest/Home_Page

I created the URL as 
https://strides-nyrr.cs8.force.com/STRIDEStest?un=USERNAME&pw=PASSWORD&startURL=%2FHome%5FPage
But for some reason it is redirecting me to the cutom login page rather than Home page.

Any inputs will be of great help. Thanks.
 
Hi,
I have a requirement where I need to display list of alerts sorted by last modified date. The problem here is there are 2 record types for Alerts and we are retreiving Alerts records for each record type in 2 different queries and ading them to the same list. Now we want to sort this final list by last modified date. I found that we can do this using a wrapper class that implemnts comparable but noticed that it returns the value not a list.

This is the code which is storing records into a list
public void alertUpdate()
    {
        alertsList=new List<Community_Content__c>();
        updatesList=new List<Community_Content__c>();
           
     // retreiving Alerts of Event record type   
        for(Community_Content__c comm: [SELECT Id,Alert_Text__c,Alert_Status__c,RecordTypeId,Update_Text__c, Update_Title__c ,Update_Status__c,LastModifiedDate
                                                  FROM Community_Content__c     
                                                  where RecordTypeId=:rtEvent.Id  
                                                  and (Alert_Status__c != 'Inactive' or Update_Status__c!='Inactive')
                                                  and (Alert_Text__c != null or Update_Text__c!=null)
                                                  and Event__c=:EventId order by LastModifiedDate desc])
                                        {
                                            if(comm.Alert_Status__c != 'Inactive' && comm.Alert_Status__c != null && comm.Alert_Text__c != null)
                                            alertsList.add(comm); // Adding alerts to a common list
                                            if(comm.Update_Status__c!= 'Inactive' && comm.Update_Status__c != null && comm.Update_Text__c!=null)
                                            updatesList.add(comm);
                                       }
    // retreiving alerts of Partner record type
    for(Community_Content__c comm1: [SELECT Id,Alert_Text__c,Alert_Status__c,RecordTypeId,Update_Text__c, 
                                    Update_Title__c ,Update_Status__c,Event_Partner__r.Accounts__c,LastModifiedDate
                                    FROM Community_Content__c     
                                    where RecordTypeId=:rtPartnerAlert.Id  
                                    and (Alert_Status__c != 'Inactive' or Update_Status__c!='Inactive')
                                    and (Alert_Text__c != null or Update_Text__c!=null)
                                    and Event__c=:EventId
                                    and Event_Partner__r.Accounts__c=:accountid order by LastModifiedDate desc]) 
                                    
                                    {
                                            if(comm1.Alert_Status__c != 'Inactive' && comm1.Alert_Status__c != null && comm1.Alert_Text__c != null)
                                            alertsList.add(comm1);  // Adding alerts to a common list
                                            if(comm1.Update_Status__c!='Inactive' && comm1.Update_Status__c!= null && comm1.Update_Text__c!=null)
                                            updatesList.add(comm1);
                                    }
    }

Now I want to sort alertsList by Last Modified Date.

Any help is deeply appreciated. Thank you.
Hi

I need a new Library to be created when an Account is inserted. Can this be acheived using Apex trigger?

Thanks

Hi

 

I have 4 fields – amount, cost, profit and profit %.

 

Profit = amount – cost

Profit % = profit/100 – upto 1 decimal place.

 

 

Is it possible if we enter profit and get profit % and vice versa… i.e  we enter the percentage and get profit.

 

Example – we enter 11.4% and the profit field is calculated to a value -1120.

And if other way around, we enter 1120 in profit, we get 11.4% in profit % field.

Hi,
I have a requirement where I need to display list of alerts sorted by last modified date. The problem here is there are 2 record types for Alerts and we are retreiving Alerts records for each record type in 2 different queries and ading them to the same list. Now we want to sort this final list by last modified date. I found that we can do this using a wrapper class that implemnts comparable but noticed that it returns the value not a list.

This is the code which is storing records into a list
public void alertUpdate()
    {
        alertsList=new List<Community_Content__c>();
        updatesList=new List<Community_Content__c>();
           
     // retreiving Alerts of Event record type   
        for(Community_Content__c comm: [SELECT Id,Alert_Text__c,Alert_Status__c,RecordTypeId,Update_Text__c, Update_Title__c ,Update_Status__c,LastModifiedDate
                                                  FROM Community_Content__c     
                                                  where RecordTypeId=:rtEvent.Id  
                                                  and (Alert_Status__c != 'Inactive' or Update_Status__c!='Inactive')
                                                  and (Alert_Text__c != null or Update_Text__c!=null)
                                                  and Event__c=:EventId order by LastModifiedDate desc])
                                        {
                                            if(comm.Alert_Status__c != 'Inactive' && comm.Alert_Status__c != null && comm.Alert_Text__c != null)
                                            alertsList.add(comm); // Adding alerts to a common list
                                            if(comm.Update_Status__c!= 'Inactive' && comm.Update_Status__c != null && comm.Update_Text__c!=null)
                                            updatesList.add(comm);
                                       }
    // retreiving alerts of Partner record type
    for(Community_Content__c comm1: [SELECT Id,Alert_Text__c,Alert_Status__c,RecordTypeId,Update_Text__c, 
                                    Update_Title__c ,Update_Status__c,Event_Partner__r.Accounts__c,LastModifiedDate
                                    FROM Community_Content__c     
                                    where RecordTypeId=:rtPartnerAlert.Id  
                                    and (Alert_Status__c != 'Inactive' or Update_Status__c!='Inactive')
                                    and (Alert_Text__c != null or Update_Text__c!=null)
                                    and Event__c=:EventId
                                    and Event_Partner__r.Accounts__c=:accountid order by LastModifiedDate desc]) 
                                    
                                    {
                                            if(comm1.Alert_Status__c != 'Inactive' && comm1.Alert_Status__c != null && comm1.Alert_Text__c != null)
                                            alertsList.add(comm1);  // Adding alerts to a common list
                                            if(comm1.Update_Status__c!='Inactive' && comm1.Update_Status__c!= null && comm1.Update_Text__c!=null)
                                            updatesList.add(comm1);
                                    }
    }

Now I want to sort alertsList by Last Modified Date.

Any help is deeply appreciated. Thank you.