• shiva pendem
  • NEWBIE
  • 65 Points
  • Member since 2014

  • Chatter
    Feed
  • 2
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 40
    Replies
Hi all,

I've a VF page and its controller, 
I've used page action as below 
<apex:page action="{!validateUser}" 


in my controller i've a method like this

public pageReference validateUser(){

if(someconditionTrue)

        PageReference errorPage = new PageReference('apex/ErrorPage');
        errorPage.setRedirect(true);
        return errorPage;


}

else{


//I need to stay in this page.


}


I'm not sure sure how to code for stay in this page, because this page is always recursively called. 
Hello,

How can i achieve Module operand in Visualforce.

NUMBER % 2 == 0  //even
NUMBER % 2 == 1 //odd
Hi Friends,

Created dashbord on lighting in production org and the running user for that dashboard is inactive now. So when i am trying to open dashboard now using admin user it was showing error (the dashboard running user is inactive). Is there any way to change dashboard running user

I checked  for all the permission which are required to change running user and given to profile but still i am unable to change running user in both salesforce classic & Lighting Exp

Please help me if you know the solution for this

Thanks
Shiva
Hi friends,

I have a requirement to integrate with gmail from salesforce, Requirement is i will have a custom button on object detail page
when i click on the button gmail compose page should be opened and automatically attachment should be attached to Gmail compose page.
Attachment can be a vf page Pdf which we will generate on the fly or we will take from attachment.

Please let us know solution on this.


Thanks,
Shiva
Hi Friends,

I have a requirement on knowledge articles display on the visualforce page and also have to give self relationship to the same article type. ,That means one article can be associated with multiple articles like child and parent . Since saleforce has not provided to create a lookup to the article, so can any one please let me know what is the best way to achieve this functionality.

Note:
In visualforce page, if i click on one article i should be navigated to the next page which contains list of related articles under that article record.

Thanks,
Shiva
HI Friends,

We are using standard SSO between Active Directory and Customer Community .So while Coming From AD to community home page using Standard SSO, i need to pass one parameter in URL and based on that parameter we want to redirect Home page(visualforce) to another page(visualforce). So  is there any possiblity to pass Parameter through URL while coming from External system (AD) using standard SSO?

Please suggest us on this issue.

Thanks,
Shiva Pendem
Hi Friends,

I have a senario that I need to Display list of pdf files which has been stored in notes & attachments. For every attachment record we have one checkbox  and  one button named 'Print PDF'  at the top of the page in visualforce page . When we click on that button need to print all the selected PDF's at a time in single click.

Can anybody please Suggest Us.

Thanks,
Shiva.
Hi friends ,

How to develop barcode reader in salesforce using Vf page  for mobiles. My requirement is barcode should be read from mobile(Camera) and it should check in the database(Object) whether the the barcode number is present or not .based on the barcode number retrieve the records using soql query and populate the retrieved records on the VF page .

can any one please suggest me.

thanks,
shiva
HI All,

How to get all the Documents from content tab . Can any body suggest me How to write SOQL Query to get all the Files From Salesforce Content Tab and want to fetch and Create the Docs in .Net

Q : Please suggest me to fetch all the docs from salesforce content tab (SOQL)?

Thanks
Shiva
Hi all,

How to read barcode from salesforce1 app . can anybody please suggest me how to read barcode using salesforce1 ..?

Thanks,
Shiva
 
HI Friends,

Can any one suggest me how to write Email Validation in apex controller. Here i am using one Regular expression to validate the Email in my controller method but its not working as per my senario
Using this Code in IF : if(Pattern.matches('[a-zA-Z0-9._-]+@[a-zA-Z-]+.[a-zA-Z.]{2,4}',cust_conemail)){
                                     //
                                   //
                                   }

But its allows in all senarios but the thing is after @ need to accept only one or none hyphen but now its allowing more than one hyphens.
want this format : shiva.pendem@stead-fast.com //working fine
the issue is : shiva.pendem@stead--fast.com i want to restrict this format (More than one Hyphen). // need to restrict this
i.e only one or none hyphen want to allow.

please suggest me.

Thanks 
shiva.
HI Friends,

In My senario <apex:selectlist> not accessible in IE 8,9,10 browsers,We have to click several times in the dropdown menus to traverse. Can anybody advise me .

Here is my Code :

<apex:selectList value="{!typeofcust}" multiselect="false" styleClass="Dropdwn" id="List" size="1"  disabledClass="picklistdisablecls" enabledClass="picklistenablecls">
                        <apex:selectOption itemValue="Customers"  itemLabel="Customers" />                       
                        <apex:selectOption itemValue="Branch Customers" itemLabel="Branch Customers" />
                        <apex:selectOption itemValue="All Customers" itemLabel="All Customers"/>
                        <apex:actionSupport event="onchange" action="{!selectedcustomers}" rerender="pageblock,table" />                  
</apex:selectList>

This is the code using in vf page but its working fine in IE11,firefox,Chrome but in IE10,9,8 when we click on the dropdown list its not allow us to select the values(option) of dropdown.can anybody please give your suggestion for working this Dropdown in IE10,9,8 properly.

please advise me.


Thanks
Shiva


 
HI friends ,

How to display the reports in vf page . i tried with <analytics:reportChart> this tag but its been displaying only Charts . But i want to display the entire report in Vf page (Chart + report records) . Can anybody please advise me on this

Thanks,
 shiva.
HI Guys,

We are using  partner communities . So if the User login  by entering the credentials and when user logouts i need to perform some action. this is fine. But when user closes the window directly i need to perform same action which performs while logout. Please let me know how to detect the window close event and perform the actions in apex class . 


please advise us.

Thanks
Shiva.
HI,

How to Display the Reports and Dashboards in Partner Community .Which permissions need to give if we want to access the reports and dashboards in Community ?


please advise .


Thanks,
Shiva
Hi,

We are trying to make use of Salesforce1 for our salesforce community requirement (Mobile Compatible). We have installed Salesforce1 app in android v5.0.1 version. We have made the configuration setup in change server option to add our community.

Problem: Once we choose the login.salesforce.com server, blue bar with top right menu option (Change Server, Clear Cookies and Reload) shows up. But if the user enters the username & password and logs in, the blue bar with these option does not show up.

As similar, if we choose our community login using Change Server option in top right menu (blue bar), our custom login VF page shows up. Once user enters the username & password and logs in, the blue bar with the top right menu is still shows up.

Our problem at the end will be the "Reload" option present in the menu. Post login, if the user chooses the "Reload" option from the top right menu, then our community with Custom VF pages is gone and standard community pages (with mobile compatible mobile UI) shows up. 

Instead of Custom VF login page, if we use "Communities Login" VF page provided by salesforce for login, then this blue bar doesn't show up post user login. Are we missing something in our custom VF login page which may be present in the "Communities Login" page by Salesforce?

Is there any permission setup available in the org, so that we can disable this top bar post login by the user or is there any alternate way to avoid the redirection to standard community pages?

Please advise.

Thanks
Shiva
Hi Guys,

We are trying to make use of Salesforce1 Mobile app for allowing user to use our community. Using the Community Login URL, i have added the server from "Change Server" option in the top right menu. Now, our community login page loads up at first.

Once community user enters username and password, it redirects them to the landing page. After login, there is another option in top right menu as 'Reload'. This is for reloading the page, but if we do reload, then a popup window appearing as 'Salesforce1/chatter for Android’ requesting permission to access (Allow/Deny). In order to avoid this, we have given 'Salesforce1/chatter for Android’ permission at the profile level. But still this popup shows up and prompts the user to Allow or Deny everytime.

Q: What should we do to stop this popup prompting user to allow or deny permission?

Even if we Allow, it is taking the user to Salesforce1 Screen (not our visualforce pages in community) of community displaying the available objects on the left menu and feed etc,. Looks like its a standard community page in salesforce1.

Q: Is there any permission needs to be given to overcome/solve this or are we missing something here for accessing community from inside Salesforce1 App?

Mobile Android Version: Android v5.0.1
Enabled the Salesforce1 at the profile level and some of the connected apps also enabled by itself.

Please advise on this.

Thanks
Shiva
Hi Guys,

We are trying to make use of Salesforce1 Mobile app for allowing user to use our community. Using the Community Login URL, i have added the server from "Change Server" option in the top right menu. Now, our community login page loads up at first.

Once community user enters username and password, it redirects them to the landing page. After login, there is another option in top right menu as 'Reload'. This is for reloading the page, but if we do reload, then a popup window appearing as 'Salesforce1/chatter for Android’ requesting permission to access (Allow/Deny). In order to avoid this, we have given 'Salesforce1/chatter for Android’ permission at the profile level. But still this popup shows up and prompts the user to Allow or Deny everytime.

Q: What should we do to stop this popup prompting user to allow or deny permission?

Even if we Allow, it is taking the user to Salesforce1 Screen (not our visualforce pages in community) of community displaying the available objects on the left menu and feed etc,. Looks like its a standard community page in salesforce1.

Q: Is there any permission needs to be given to overcome/solve this or are we missing something here for accessing community from inside Salesforce1 App?

Mobile Android Version: Android v5.0.1
Enabled the Salesforce1 at the profile level and some of the connected apps also enabled by itself.

Please advise on this.

Thanks
Shiva
HI All,

I am getting some issue my integration process, My senario is We are fetching the attachments from Salesforce with the help of Asynchronous process (Rest) api and adding all the files to .Dll file. But its Showing Error for Body fied Like 'Base64 format not supported'. How can we decode this Body content and how to add to dll file .
Please help Us.
Thanks 
Hi friends
I have a one approval process on account object. I want to display custom error message instead of standard Error message after clicking on the approval button . In my Senario Account name is Unique So whenever we Click On Approve button the trigger will fire and  the custom Object record will store into account object at that time i want show the Custom message instead of standard message when duplicate Account name found in Account object.. Please if u have any idea about this issue please share with me 

thanks
shiva pendem
Hi
i have a problem while capturing accountid of owner please give me your suggetions .
senario : i have a custom object which using in partner portal .So i want to fetch the owner.accountid of custom object which is used to capture the current userid of partner portal.
i am using this code but its throws an error .
Select createddate,owner.name,name,,Request_Type__c from PC_New_Account_Request__c where  Request_Type__c = 'Customers of Dealer HQ' AND (status__c ='Pending' OR status__c='Rejected') AND Owner.accountid =:currentuseraccount[0].id ORDER BY name ASC ];

please let me know if there are any possibility.
Hi Everyone this is my code for returning a account record but its not parsing while Generating from WSDL from other ORG .Can anyone Pplease give me the the solution how to fetch the record .

global class TestSoapWeb
{      webService static Account RecordFetch(id aid) {        
      Account Ac = [select name, id, phone, Industry, Fax, Type from account where id=:aid];         
        return Ac;    
 }
}
After writing this Generated WSDL'S Enterprise and Custom .then I am Calling this WSDL from other ORG by Clicking "Generate From WSDL"
At that time .Getting error LIke  :
  " Error  Apex Generation Failed    :Unable to find complexType for {http://soap.sforce.com/schemas/class/TestSoapWeb}address"              
.Even though tried in .Net But same problem getting ..Please give me the solution .
 
HI Guys,

We are using  partner communities . So if the User login  by entering the credentials and when user logouts i need to perform some action. this is fine. But when user closes the window directly i need to perform same action which performs while logout. Please let me know how to detect the window close event and perform the actions in apex class . 


please advise us.

Thanks
Shiva.
Hi Guys,

We are trying to make use of Salesforce1 Mobile app for allowing user to use our community. Using the Community Login URL, i have added the server from "Change Server" option in the top right menu. Now, our community login page loads up at first.

Once community user enters username and password, it redirects them to the landing page. After login, there is another option in top right menu as 'Reload'. This is for reloading the page, but if we do reload, then a popup window appearing as 'Salesforce1/chatter for Android’ requesting permission to access (Allow/Deny). In order to avoid this, we have given 'Salesforce1/chatter for Android’ permission at the profile level. But still this popup shows up and prompts the user to Allow or Deny everytime.

Q: What should we do to stop this popup prompting user to allow or deny permission?

Even if we Allow, it is taking the user to Salesforce1 Screen (not our visualforce pages in community) of community displaying the available objects on the left menu and feed etc,. Looks like its a standard community page in salesforce1.

Q: Is there any permission needs to be given to overcome/solve this or are we missing something here for accessing community from inside Salesforce1 App?

Mobile Android Version: Android v5.0.1
Enabled the Salesforce1 at the profile level and some of the connected apps also enabled by itself.

Please advise on this.

Thanks
Shiva
Hi friends
I have a one approval process on account object. I want to display custom error message instead of standard Error message after clicking on the approval button . In my Senario Account name is Unique So whenever we Click On Approve button the trigger will fire and  the custom Object record will store into account object at that time i want show the Custom message instead of standard message when duplicate Account name found in Account object.. Please if u have any idea about this issue please share with me 

thanks
shiva pendem
What we need is to show the difference between the first Completed Activity and the Opportunity Created Date.

The problem is that the LastActivityDate is a Date field.
Should be like this 
DATETIMEVALUE(LastActivityDate + The Current Hour(of NOW() ))

I have been trying  and reading a lot of post regarding this but it all does not make sense.

Can anyone help me with this?
 
  • August 16, 2016
  • Like
  • 0

HI all,
I have "Save Attachment" button On VF page. As I click on "Save Attachment" button  the PDF is Save on Releted List of "Notes & Attachments".
When i Again Click on "Save Attachment" button the New PDF is Save in That Releted List. I want that When Click on Button the Old PDF shoud be Replace with New PDF And Latest PDF should Save. 

My Code

  public PageReference attachPDF() {
        
       List<Attachment>  at = new  List<Attachment> ();
       
        SaveAttachment  = True;
        PageReference pdf =  new PageReference('/apex/PriceSheetScreen'); 
       
        Blob body = pdf.getContentAsPDF();
        Attachment attach = new Attachment( parentId = oppid ,Name = 'PriceSheet.pdf', body =body, IsPrivate = false); 
        insert attach;
        SaveAttachment  = False;
        
        
        
         return null;
          }  


And VF page


<apex:commandButton value="Save Attachment" action="{!attachPDF}" rendered="{!$CurrentPage.Parameters.flatid != null && !SaveAttachment}" style="margin-right:4px;" />
 
I have created a checkbox SendToSAP on account, which should be 'true' when a record gets created or every time it gets updated. I have set the default value of flag to true and written a trigger on account to set it to true after update.
But the problem is when i am trying to make this flag 'false' through my apex code the trigger is again setting it back to true. so i am unable to set my flag to 'false' in any case.
Can anyone suggest me the workarround for this problem.

Thanks in Advance!
Hi Everyone,
I need test class for my trigger which copies details from obj1(Loaner Request Form) to obj2(Equipment Request) after insert on obj1(Loaner Request form).Kinldy help me on this one.Thanks in advance.

trigger InsertToEquipmentRequest on Loaner_Requests_Form__c (after insert) {
List <ELTON__Equipment_Request__c> EQRINSERT = new List <ELTON__Equipment_Request__c>();
Map<Id,List<String>> mapEquipmentTypes = new Map<Id,List<String>>();
Set<String> setType = new Set<String>();
Map<String,Id> mapEquipmentType = new Map<String,Id>();
for (Loaner_Requests_Form__c LRF:Trigger.new)
{
    List<String> lstEquipmentTypes = LRF.Equipment_Type_Multi__c.split(';');
    mapEquipmentTypes.put(LRF.id,lstEquipmentTypes);
    for(String s : lstEquipmentTypes){
       setType.add(s); 
    }
    //setType.add(LRF.Equipment_Type__c);
}

System.debug('Equipment TYpe = ' + setType);

If(setType != Null && !setType.isEmpty())
{
    for(ELTON__Equipment_Type__c e : [Select Id,name from ELTON__Equipment_Type__c where Name In :setType])
    {
        mapEquipmentType.put(e.name,e.id);
    }
    
}
System.debug('mapEquipmentType = ' +mapEquipmentType);

for (Loaner_Requests_Form__c LRF:Trigger.new)
 {
     for(String s :mapEquipmentTypes.get(LRF.Id)) {
        System.debug('Equipment TYpe 1 = ' +LRF.Equipment_Type__c);
        ELTON__Equipment_Request__c EQR = new ELTON__Equipment_Request__c ();
        EQR.Full_Name__c= LRF.Full_Name__c;
        EQR.Department__c= LRF.Department__c;
        EQR.Office_Location__c= LRF.Office_Location__c;
        EQR.Mission_Name__c= LRF.Mission_Name__c;
        EQR.Location__c= LRF.Travel_Location__c;
        EQR.ELTON__Request_Start_Date__c= LRF.Travel_Start_Date__c;
        EQR.ELTON__Request_Return_Date__c= LRF.Travel_End_Date__c;
        EQR.Request_Sent_By__c= LRF.Request_Sent_By__c;
        EQR.Requesting_for__c= LRF.Requesting_for__c;
        EQR.ELTON__User__c= LRF.Requesting_for__c;
        EQR.Requested_User__c= LRF.Loaner_Requester_Name__c;

        EQR.Pick_up_Location__c= LRF.Pick__c;
        EQR.Name__c= LRF.Name__c;
        EQR.Email_Address__c= LRF.Email_Address__c;
        EQR.Date__c= LRF.Requested_Date__c;
        EQR.Phone__c= LRF.Phone__c;
        EQR.ELTON__Request_Note__c=LRF.Note__c;        
        
        EQR.Equipment_Type_Multi__c =LRF.Equipment_Type_Multi__c;
        //EQR.ELTON__Equipment_Type__c=mapEquipmentType.get(LRF.Equipment_Type__c);
        EQR.ELTON__Equipment_Type__c=mapEquipmentType.get(s);
        EQRINSERT.add(EQR);
     }
     
}
    insert EQRINSERT ;
 
}
what is the main usage ofapec page block table and data table can any one give me the examples?
Hi all,

I've a VF page and its controller, 
I've used page action as below 
<apex:page action="{!validateUser}" 


in my controller i've a method like this

public pageReference validateUser(){

if(someconditionTrue)

        PageReference errorPage = new PageReference('apex/ErrorPage');
        errorPage.setRedirect(true);
        return errorPage;


}

else{


//I need to stay in this page.


}


I'm not sure sure how to code for stay in this page, because this page is always recursively called. 
Hello,

Can i change limit of visualforce page?

Thank you
I have vf page which is used to export data into csv format.But I want to redirect the page after loading and saving the csv file.
<apex:page standardController="Account" extensions="redirectme" cache="true" contentType="text/csv#ExportAccountdata.csv" language="en-US" > Id,Name,Phone
<apex:repeat value="{!acc}" var="account"> {!account.id},{!account.name},{!account.phone}
</apex:repeat>
</apex:page>
Controller of Vf page :-
public class redirectme {

    public redirectme(ApexPages.StandardController controller) {
    acc=[select id,name,phone from account];

    }

public list<account> acc{
get;
set;
}

    
    public pagereference redirect()
    {
    Pagereference pg=new pagereference('https://geeta-dev-ed.my.salesforce.com/001?fcf=00B28000003KuCF');
    pg.setredirect(true);
    return pg;
    }

}



 
Hi Everyone,
I have developed a appliocation.
Now, my requirement is, I want change my profile picture like how we will change in Facebook, Gmail, Twitter etc.,
Please give me some approach how can I do this?
If anyone has code already please share to me, It will be more helpful.

Thank you in advance.
 
Hi Friends,

I have a requirement on knowledge articles display on the visualforce page and also have to give self relationship to the same article type. ,That means one article can be associated with multiple articles like child and parent . Since saleforce has not provided to create a lookup to the article, so can any one please let me know what is the best way to achieve this functionality.

Note:
In visualforce page, if i click on one article i should be navigated to the next page which contains list of related articles under that article record.

Thanks,
Shiva
Hi, I'm trying to query from OpportunityLineItem Object using the clause IN with a nested a query: here's the apex code : 
for (PricebookEntry pbe: [Select Product2.Id, Product2.Delivery__c, Product2.Language__c, UnitPrice, Product2.Family from PricebookEntry where Product2Id IN (Select PriceBookEntry.Product2Id from OpportunityLineItem where OpportunityId = : opp.Id) ]){
    // Rest of code
}

But i have this error :
The inner select field 'PriceBookEntry.Product2Id' cannot have more than one level of   relationships

I don't know how to solve this
Hi Everyone,

                  I created the custom javascript button. The issue is when i click on that button it is redirecting to the some other page which is not i am expecting, I mentioned the URLs for your reference,
for eg:
https://test--ctm--ctm.cs14.visual.force.com/apex/XXX?AAA=aC8c0000000CgQHCA0  --> This URL coming default
https://test--ctm--c.cs14.visual.force.com/apex/XXX?AAA=aC8c0000000CgQHCA0  --> I need to redirect to this URL

I am expecting to do this functionality only in javascript without using the apex class.

Thanks in Advance.
Hi All,

I have one custome field i.e. Time__C. I need to count time from different records within the object. what we counted time will be store in another custom field i.e Toatal_Time__C.
For Example :
Record1 : Time__C=2 hours.
Record2 : Time__C=3 hours.
Record3 : Time__C=2 hours.

So, Total_Time=7 Hours.

Thanks in advance
Thulasi.
Hi,

I am writing a VF page using Standard Controller.
To retrieve the fields, I am using <apex:inputField> tag

User-added image

It is showing same name as I have given while creating the field in object, but I want to show a different label on VF page.
I didn't find any attribute of <apex:inputField> tag which helps in changing the field label.

Is there any way to do it ?
 
Hi,

I have 2 values comment__c, comment1__c, being used in a Workflow.

Now i need to append the comment__c value to the end of comment1__c value.
How can i achieve this??
 
HI Friends,

We are using standard SSO between Active Directory and Customer Community .So while Coming From AD to community home page using Standard SSO, i need to pass one parameter in URL and based on that parameter we want to redirect Home page(visualforce) to another page(visualforce). So  is there any possiblity to pass Parameter through URL while coming from External system (AD) using standard SSO?

Please suggest us on this issue.

Thanks,
Shiva Pendem
here is my code...

public class objectlist {
    //Do not forget to get instance in constructor for this list
    //String type='Account';
     Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
       List<string> fieldLable = new List<string>();
        
       Map <String, Schema.SObjectField> fieldMap = gd.get('Account').getDescribe().fields.getMap();
       for(Schema.SObjectField fieldAPI : fieldMap.values())
       {
               fieldLable.add(+ '<' +fieldAPI.getDescribe().getName()+ '/>' );
       }
       
       system.debug('fieldLable-----'+fieldLable);
}

IDK what part is wrong...pls help me fix this...THX!!!