• sukanya banekar
  • NEWBIE
  • 295 Points
  • Member since 2014
  • Salesforce Developer
  • Zen4orce

  • Chatter
    Feed
  • 9
    Best Answers
  • 3
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 104
    Replies
Hi All,

I have two picklist fields in vf page, i want to retain field dependency between the two in my page. I am using standard controller and no pageblock component used. Any ideas?

Thanks.
  • August 22, 2017
  • Like
  • 0
Hi,

I have in my Org the WorkOrder and WorkOrderLineItens Objects.
I want to display the result of a very specific SOQL query in a Visualforce page.
The point is, in my Apex SOQL query, I bring fields from both objects, and others related... so, how can I declare a single List to receive this SOQL result, with all the returned fields, from all objects?

I'm following this article, but It only uses fields fron a single object, so the List is declared based on that object..
https://help.salesforce.com/articleView?id=000205631&type=1

My SOQL looks like this:
select  	id, LineItemNumber, 
			PricebookEntry.Product2.Name,
			WorkOrder.WorkOrderNumber, WorkOrder.Tipo_de_Servi_o__c
FROM		WorkOrderLineItem
WHERE		UnitPrice = 0	AND 	
			WorkOrder.CreatedDate >= 2017-05-15T00:00:00.000+0000
ORDER BY	LineItemNumber ASC

In developer console, it runs fine:
User-added image

Some sugestion, or other reference that could help me on it?
Thanks.
I need assistance with creating a new record on a custom object Hardie_Builders__c everytime the Account checkbox Hardie Builder is set to true. It will only contain the hyperlinked Account Name. 
Hello,I want to add new values to picklist ,I import all class  which from https://github.com/financialforcedev/apex-mdapi  into my org.
I write a class named AddSegment.cls and  a test class  ,when I run test class to create Field ,it show error:Attempt to de-reference a null object, can someone tell me what wrong and what should I do.Thank you very much.
User-added image
User-added image

 
{!REQUIRESCRIPT("/xdomain/xdomain.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")}
{!REQUIRESCRIPT("/support/console/39.0/integration.js")}

var Program='{!Program_Member_MVN__c.Program_Name__c}';
var Pname=sforce.connection.query("Select Program__c from Program_Names__c");
var rec16 = Pname.getArray('records');
var status='{!Program_Member_MVN__c.Status_MVN__c}';
var PmId='{!JSENCODE(Program_Member_MVN__c.Id)}'; 
var PName='{!Program_Member_MVN__c.Program_Name__c}'; 
var url;
if (sforce.console.isInConsole()) {
if(Program == rec16){
alert("You are on the wrong Program")
} 

else if(status == 'On Therapy')
{
url = "/apex/Milestone_skip?id="+PmId;
window.open(url,'_blank','toolbar=0,location=0,menubar=0,width=800,scrollbars'); 
}  
else
{
alert("Patient must be ‘On-Therapy’ before skipping to a milestone");
}
}

This is my java script on click button code.In this i am querying  custom setting here:var Pname=sforce.connection.query("Select Program__c from Program_Names__c");
And i want to compare to field to show a alert.So i have to multiple values in custom setting.So how can i access all the values given in the custom setting in the java script code?
<aura:component>
    <aura:attribute name="setMeOnInit" type="String" default="default value" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    
    <p>This value is set in the controller after the component initializes and before rendering.</p>
    <p><b>{!v.setMeOnInit}</b></p>
    
</aura:component>
================================
<aura:application >
    <c:test2/>
</aura:application>
=============================
({
    doInit: function(cmp) {
        // Set the attribute value. 
        // You could also fire an event here instead.
        cmp.set("v.setMeOnInit", "controller init magic!");
    }
   
})

 

Would it be possibile to filter null long text area fields in SOQL?

I need to run process where if a number of text area fields in contact are null then do something.

Thanks in advance!

 

Not sure but I cannot find a clear answer to this.  I have a status__c picklist value we want changed from "Installing" to "installed".   This should change based on a separate field that we created that has an "install_date__c" entry (date field). When system date matches this date field we have we would like the picklist value to change on status__c.   Any help would be appreciated!
Hello all,

I have a field Previous__c which is generated from a field update formula and shows the previous value of another field currentfield__c. Previous__c is correctly shown in standard detailpage layout but its null when I try to display it using    
<apex:outputText value="{!object.Previous__c }"/>.  I have also tried apex:outputfield, but its still the same

Can anybody suggest Where am I going wrong?
 
Hi,

User-added image
I am getting above error while training the dataset. The dataset which I have used is from Einstein vision (mountainvsbeach). Also I have checked, the images are no longer than 2000 pixel.

 
Is it possible to update trained dataset in einstein API?
Hi,

User-added image
I am getting above error while training the dataset. The dataset which I have used is from Einstein vision (mountainvsbeach). Also I have checked, the images are no longer than 2000 pixel.

 
Hello All, 

  i have scenairo, where i have to compare with single record with list of records and if i found duplicate record i will have to return duplicate record.

 Example : List<account> listAcc= [select id, name, type,startdate, enddate, designation, ( select id , name , email, from contact), (select name, id, stage from oppty) from account]

  Account  acc= [select id, name, type,startdate, enddate, designation, ( select id , name , email, from contact), (select name, id, stage from oppty) from account where id='XXXXXXXX'];

now i have to compare account (acc) record with all the list of records from listAcc  data with parent and child records. if i found  same record in then i have to return duplicate record found. 

Thanks 


 
I am receiving multiple FlowApplication error emails with a MyVariable ID which is the record ID + an extension e.g. 0Q041000000kv5oCAA. The Record ID is 0Q041000000kv5o and the extension is CAA.

I'm trying to figure out where I can find where I can troubleshoot this through the ID. Can someone guide me as to how I can navigate to 0Q041000000kv5oCAA?
  • August 24, 2017
  • Like
  • 0
Hi,

I have requirment, where i need to have diffrent loging pafes for my diffrent clients. 
Any idea how to have multiple login pages.

Thanks 
Hi All,

I have two picklist fields in vf page, i want to retain field dependency between the two in my page. I am using standard controller and no pageblock component used. Any ideas?

Thanks.
  • August 22, 2017
  • Like
  • 0
Hi,
I need lightning component for searching leads and display in another section.
please suggest me.
Hi, 

the below class is invoked via Process builder and meant to email a dynamic visualforce attachment. 
 
public class EmailInvoked {

    @InvocableMethod
    public static void sendEmail(List<Id> lstId){
        List<String> EmailIds = 'personal@example.com'.split(',');
        PageReference ref = Page.WorkDocket;
        Blob b ;
        b = ref.getContent();

        

        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();

        Messaging.EmailFileAttachment efa1 = new Messaging.EmailFileAttachment();
        efa1.setFileName('WorkDocket.pdf');
        efa1.setBody(b);

        String addresses;
        email.setSubject( 'Check VF From PB' +String.valueOf(DateTime.now()));
        email.setToAddresses( EmailIds  );
        email.setPlainTextBody('Hey there, I am an email Body');
        email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa1});
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
    }
}

However, I would need to 
1. Not only have this email send to a static address but based on a field in the Case - Site_Email__c 
2. The Visualforce page is currently attached but only the static contect. For example apex:output fields are not rendered. How do i get the ID in the visualforce page to render correctly? 

Thank you. All help much appreciated. 
 
We have created Android application which has been integrated with sales force but we are getting the error message during authentication .Below are the error message

{"error":"invalid_grant","error_description":"authentication failure"}
We are using Kitkat 4.1 and 4.2 android version device.
I have a created case in my application and I want to restrict one selection according to the region. Example A is one region they can see all the fields in their region and B is one more region they can see there all the fields in their region but when A Region want to see B region I want to hide few details in case  and when B Region want to see A Region  I want to hide few details in case. 

Please, can anyone help me on this?
 

 

trigger cc_contactUpdateOnApplication on Application__c (after update) {
    Map<id,id> applicationMap = new Map<id,id>();
    List<contact>conList = new List<contact>();
    for(Application__c application : [SELECT id,Name,Contact__c,CC_Term__c,Admissions_Status__c FROM Application__c Order By LastModifiedDate DESC Limit 1]){
        system.debug('@@@@@application'+application);
        if(application.Admissions_Status__c != Trigger.oldMap.get(application.Id).Admissions_Status__c){
            // if(application.Admissions_Status__c !=null){
            applicationMap.put(application.Contact__c, application.Id);
            system.debug('#####applicationMap'+applicationMap);
        }
    } 
    for(contact con :[SELECT id,Name,Active_Application_CC__c FROM contact WHERE Id IN :applicationMap.keySet()] ){
        con.Active_Application_CC__c = applicationMap.get(con.Id);
        conList.add(con);
        system.debug('$$$$conList'+conList);
    }
    if(conList.size() >0){
        update conList;
        system.debug('####conList'+conList);
    }
}
Challenge Not yet complete... here's what's wrong:
The 'High Probability Opportunities' list view does not appear to be configured correctly. It should show only opportunities whose stage is 'Proposal/Price Quote' and 'Negotiation/Review', and whose probability is greater than or equal to 50%. Why do I keep running into this error message? Thanks
 
Hi, 

      I want the standard calendar component in a custom lighting component. How can I achieve this?
 
Here is my VF page:
<apex:page standardStylesheets="false" controller="RadioButtonTestController" showHeader="false" sidebar="false">
    <apex:form >
    	<div align="center">
          
        	<apex:selectRadio value="{!Country}" > 
               India <apex:selectOption itemValue="true"></apex:selectOption>&nbsp;&nbsp;
    		  China &nbsp;&nbsp;<apex:selectOption itemValue="false"></apex:selectOption>

    			<apex:actionSupport event="onchange" 
                        action="{!checkSelectedValue}" 
                        reRender="none"/>
        		</apex:selectRadio>
            
            <apex:commandButton value="Show country" action="{!showCountry}"/>
    	</div>
    </apex:form>
</apex:page>

Here is my Controller
public class RadioButtonTestController 
{
    public Boolean Country{get; set;}
    public void checkSelectedValue()
    {
        
        system.debug('Selected value is: '+ Country);
    }
    
    public void showCountry()
    {
        String caseId = ApexPages.currentPage().getParameters().get('CaseID');
        list<Storing_Location__c> str = [Select Country__c from Storing_Location__c where CaseNumID__c=: caseId];
        Storing_Location__c obj = new Storing_Location__c();
        if(str.size()>0)
        {
            obj.Id = str[0].Id;
        }
        
        obj.Country__c = Country;
        system.debug('Selected value is:***********************:::'+Country);
        
    }
}

 
  • August 13, 2017
  • Like
  • 0
When i go to my pesonal salesforce environment and when i enter into Settings->Display And Layout->Customize My Tabs/Pages but i don't see any open activities.Can u please help me .
global class Batch_Account_Manager_change_update implements Database.Batchable<sobject>
{
      List<Account_Allocation_Rules__c> acc_rule = new List<Account_Allocation_Rules__c>();
      string rid = [SELECT id from RecordType where Name ='Tyro Customer'].Id;
      string dynamicQuery = null;
      boolean flag = false;
      Integer num = 0;
      string sg = null;
      Set<ID> setAccRuleId = new Set<ID>();
      List<Account> upacc = new List<Account>();
      List<Account> acct = new List<Account>();
      Set<string> paramlist = new Set<string>();
      Map<String,account> accmap = new map<String,account>();
      
     global Database.QueryLocator start(Database.BatchableContext bc)
    {
        return Database.getQueryLocator('Select Id,Name,RecordType.Id,Active__c,Account_Manager__c,Active_User__c,Industry__c,Integration_Product__c,Lookup_Parameters__c,Rule_Allocation_Name__c,Segment__c from Account_Allocation_Rules__c where LastModifiedDate = Today');
        
    }
    global void execute(Database.BatchableContext bc,List<Account_Allocation_Rules__c> sobj)
    {
             System.debug('Account Allocation Rule'+sobj);
        
           for(Account_Allocation_Rules__c alc : sobj) 
           {
            if(alc.Lookup_Parameters__c != null)
            {
                    paramlist.add(alc.Lookup_Parameters__c);
            }

           }
          acct = [Select Id,OwnerId,Segment__c,Account_Allocation_Parameters__c,Corporate_Group__c from Account where  RecordType.Id =: rid and Corporate_Group__c = null and Key_Account__c = false and Merchant_Group_Member__c = 0 and Account_Allocation_Parameters__c in : paramlist];    
          //acct = Database.query(dynamicQuery);
         
           if(acct.size()>0)
           {        
              for (Account at : acct)
              {
                   accmap.put(at.id, at);
              }
            }

          System.debug('#######Account Map'+accmap);
          
                  System.debug('testing time');        
                    
                    for(account act : accmap.values())
                     {
                        for (Account_Allocation_Rules__c alc : sobj) 
                       {
                           
                           System.debug('########DrillDown');
                           if (act.Account_Allocation_Parameters__c == alc.Lookup_Parameters__c)
                            {
                                 System.debug('########DrillDown111111');
                                  system.debug(LoggingLevel.INFO, alc.Lookup_Parameters__c + ' exist');
                                  System.debug('Account Owner Id####'+act.OwnerId);
                                  System.debug('Allocation Account Manager'+alc.Account_Manager__c);
                                  act.OwnerId = alc.Account_Manager__c ;
                                  upacc.add(act);
             
                              }
                              else
                              {
                                      system.debug(LoggingLevel.INFO, alc.Lookup_Parameters__c + ' does not exist');
                              }
                 }
          }        

         System.debug('Updated Account List*******'+upacc);
         
         
          
                 
        
    }
    
    global void finish(Database.BatchableContext bc)
    {
           
            update upacc;
    }

}
I'd like to have a list button to update a multi-select picklist field. The javascript below runs when I click it on a related contact list on an account page (I get the alert with the Id), but the checked record does not update. I suspect it's due to the multi-select field type, because this code worked for regular picklist in this answer.
I have enabled Account Contact Relationships, and want to update the Roles field in that object with a text value ("Former resident"). Here's the code:
{!REQUIRESCRIPT('/soap/ajax/30.0/connection.js')}

try{
    var selectedRecords = {!GETRECORDIDS( $ObjectType.AccountContactRelation )};
    if(selectedRecords.length > 0){
        var recordsToUpdate = [];
        for(var i = 0; i < selectedRecords.length; i++){
            var record = new sforce.SObject("AccountContactRelation"); 
 
            record.Id = selectedRecords[i];
            record.Roles = 'Former resident;'; /* also tried without inner semicolon */
            recordsToUpdate.push(record);
alert('Updated ' + selectedRecords[i] );  /* this works */
        }

        var result = sforce.connection.update(recordsToUpdate);  /* this doesn't work */

        location.reload();
    }
    else{
        alert('Please select at least one row');
    }
}
catch(e){
    alert(e);
}
Salesforce.com could not email the report to any of the specified recipients. Check that recipients are specified and that they have the appropriate permissions to view the report.

If you get this ^error:

Make sure you also check:
Setup > Customize > Reports & Dashboards > Email Notifications > Allow Reports and Dashboards to Be Sent to Portal Users

Posting this here since it took me a long time to find this checkbox.