• Prafulla Patil
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 19
    Replies

I have one Text field on Custom Object as follows -

 

Product_Info__c = 'DESKTOP:10,LAPTOP:20,MOUSE:20,PHONE:25' //sample value

 

I want to create new formula field as DesktopCount__c which will result value as 10 in above case.

 

DesktopCount = 10

LAPTOPCount = 10 .. etc

 

Note: I can do this apex but wanted to check if its possible to do using formulas.

I am running following SOQL in Schema browser.. it works fine and shows results there, But I am not able to access same information in Apex when I execute it. It might be the case that I dont know how to access fields like 'Account.name, Owner.name,' in apex mentioned in this query

 

Select Account.name, Owner.name,t.CreatedBy.name,LastModifiedBy.name, LastModifiedDate, what.name,what.type   From Task t

 

please suggest

I am bit new to Salesforce.com

 

If there is one live salesforce application running on Production environment, and there is one issue in production which I am not able to reproduce in my Full Copy Sandbox environment. Please suggest what you will do in this case.

 

As per me we should refresh Fully Copy Sandbox with Production instance and then try to simulate issue there ? Is this good practice to do ? please suggest.

I want to do ajax validation in salesforce standard page.

 

Example - on Edit Contact Page there is field 'Phone' i want to validate this field when focus moves out from this perticular field. We dont want user to click on Save button and then show validation message, when user moves from Phone field to other field it should validate at the point of time.

Please suggest me how I should Implement this request

Change owner of lead to a specified queue if no activity on the lead in the last 10 days.

 

I want to just add a submit button to the standard detail page. This is distinct from edit button. Before the user can submit, I want to enforce some validations.

So when I click the submit button, I want to change the status field to 'submitted' in the background,  which would fire a bunch of validation rules making sure certain fields are filled out.

 

 

The following VF Page is attached to the submit button shows the first validation error at top of the page..

 

.However, I would like to get to the page that would simulate the following; User clicked the "Edit" button and set the status field as submitted and tried to save the record, they would see a bunch of validation errors right next to the field. If that is not possible, I would like to atleast all the validation errors at the top of the page. Currently I see only the first one.

 

<apex:page standardController="CAPA__c" extensions="submitCAPAController" action="{!redirectToSubmissionResult}">
<apex:PageMessages />
<apex:detail />
</apex:page>

 

public with sharing class submitCAPAController {

       private ApexPages.StandardController stdCtrller;

       public CAPA__c CAPA {get;set;} 
              
       public submitCAPAController (ApexPages.StandardController stdController) {   

          stdCtrller = stdController;
          CAPA = (CAPA__c)stdController.getRecord();       	
       	
       }     
       
       public pageReference redirectToSubmissionResult() {
       	    
       	    CAPA.Status__c = 'Submitted';
       	    //stdCtrller.save() doesn't seem to get to the right page. 
       	    try { 
       	    	update CAPA;
       	    } catch(DmlException ex){
                ApexPages.addMessages(ex);
                return null;
            }
            return null; 
            
       }
}

 

 

 

Hi,

 

I need to develop a class where I read in an XML file, then parse through the data, etc. This file will not be chosen manually by a user, rather I have the URL where the file is located and I need to get it from that location and open it in the code.

 

My question is, how do I get this file from the specified URL location and open it so that I can parse it in my code? I have seen many examples where the file is selected manually using apex:inputfile in the Visualforce page, but I have not been able to find anything yet where I can simply specify the location of a file and then call a method to read its contents.

 

Thanks in advance!

I want to create an organization hierarchy and associate users and some custom business objects to this hierarchy.   There should be two data access rules:

  1. A user can see data with their org or any ancestor or descendant orgs.
  2. A user can edit data with their org or any descendant orgs.

  Has anybody tried to support this type of multi-org data access restriction with force.com custom objects, roles hierarchy, and sharing rules support?  If you do, how did you resolved the issues of not able to assign objects to a role?

 

I started on this but encountered a couple roadblocks:

  1.  I cannot find a way to assign a custom object to UserRole.  In the developer edition, when I tried to add a new lookup relationship, UserRole is in the list of objects.   It seems that UserRole should be a standard object.   Is it restricted to user only?
  2. Is there anyway to assign a user to multiple roles?  It seems to be a limitation of force.com,..
  • December 31, 2011
  • Like
  • 0

Hi All,

 

I am creating a new apex class in sandbox for use with a force.com site.  I created an extension of the lead controller so that the web-to-lead form redirects to a thank you page instead of the default SF page.  My apex code is:

 

 

public class myWeb2LeadExtension {

    private final Lead weblead;

    public myWeb2LeadExtension(ApexPages.StandardController stdController) {
       weblead = (Lead)stdController.getRecord();
    }
    
     public PageReference saveLead() {
       try {
       insert(weblead);
       }
       catch(System.DMLException e) {
           ApexPages.addMessages(e);
           return null;
       }
       PageReference p = Page.ThankYou;
       p.setRedirect(true);
       return p;
     } 
}

 

 

I am getting the following error when I go to deploy it to production.

 

Failure Message: "System.QueryException: List has no rows for assignment to SObject", Failure Stack Trace: "Class.MyProfilePageController.testSave: line 78, column 35 External entry point"

 

Thanks in advance for your help!

 

  • December 30, 2011
  • Like
  • 0

Hello,

 

I need some guidance on customer settings and picklists: I have a list of different VAT with a Name and the percentage. I would like to make these settings available to the user in a picklist-field in a customer-object for articles. Is that possible? If yes, how can I define the picklist-values?

 

Thanks in advance

Harry

Hi,

      We have a requirement in our project where we have fields in our custom objects that we do not want the user to edit from the edit layout but the field should be editable by apex code . For example we have a status field which shows the status of the object and it should not be editable by the user but the code should be able to update this. This could probably be done using page layouts but it would be preferrable if we can do this any other way. I looked in the forums for any help on this but setting the page layouts or setting the permissions were suggested but is there any other way this could be done?Thanks in advance.

 

Vinayesh

  • December 24, 2010
  • Like
  • 0

I want to do ajax validation in salesforce standard page.

 

Example - on Edit Contact Page there is field 'Phone' i want to validate this field when focus moves out from this perticular field. We dont want user to click on Save button and then show validation message, when user moves from Phone field to other field it should validate at the point of time.

How do you prevent duplications from occuring in the e mail field?

Hi Guys,

        I have a tricky task based on Dashboard, i have 2reports named as cases openend for last month and cases closed for last month, so we have a dashboard build up from these 2reports, but in the dashboard i have 2 charts one for cases openend for last month and one for cases closed for last month, my question is how to show these 2charts only into 1chart, cases opened should be blue line and cases closed should be red line...

 

Any Help is Appreciated

TIA!

Please suggest me how I should Implement this request

Change owner of lead to a specified queue if no activity on the lead in the last 10 days.

Hi,

 

Can someone help me in mapping a custom object field with that of the Cases? Thanks

 

Praveen

praveenkumar.chandrashekar@altisource.com

I would like to fill the field 'Entitlement Process' on the object Entitlement automatically with an Apex trigger, but I can't find the field on the object??? Found out that the api name for the field is 'SlaProcess', but the object explorer in the IDE doesn't show the field and the code doesn't recognize the field.
Am i missing something here? The field needs to be saved somewhere?

I was wondering if somebody could help me. I have create a dynamic picklist controller that collects it select list from a custom lookup table

I have a custom field called Municapaly on the Account object and I would like to link and update this field from this new controller 

 

<apex:page standardController="Account" >  <apex:form >  <tr><td>Municapaly</td><td>   <c:Municapaly_Dynamic_Picklist myvalue="1"> </c:Municapaly_Dynamic_Picklist>   </td>  <tr>

  </apex:form></apex:page>  <apex:page standardController="Account" >

  <apex:form >  <tr><td>Municapaly</td><td>   <c:Municapaly_Dynamic_Picklist myvalue="1"> </c:Municapaly_Dynamic_Picklist>   </td>  <tr>

  </apex:form></apex:page>  public class clsMuniciplayDynamicPicklist{    private List<SelectOption> items;       public List<SelectOption> getItems() {         List<SelectOption> items = new List<SelectOption>();         //default value         items.add(new SelectOption('','--Select Record Type --'));        

        for (Lookup_Tables__c lt: [Select l.Type__c, l.Start_Date__c, l.Name, l.End_Date__c, l.Code__c From Lookup_Tables__c l]){           items.add(new SelectOption( lt.Code__c,lt.Name));                 }            return items;     }

}

 
 

I am very new to development in SalesForce.  

 

There is a standard field on account called Last Activity which says the date of the last activity.  I would like to know what type of activity the last activity was (email, call, voicemail, etc).

 

Can anyone give me some pointers on how to begin developing to create this new field?

 

All help is very much appreciated.