• SFDC_Saurabh
  • NEWBIE
  • 99 Points
  • Member since 2018
  • SFDC_Saurabh

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 16
    Replies
Hi Developers,
I am new to salesforce. My requirement is to create custom tab using metadata API as i have created custom objects.Please answer as soon as possible but not in xml package
Hi ,

Please help me in writing a Batch Job code and test class that takes data from fields  Case__c, level1__c,level2__c, level3__c from Executive_RT custom object  and
 populates it into below fields namely number__c, level1__c,level2__c, level3__c of Case Type Data custom object  
 
 I want this job to get executed Bi weekly

Thanks In advance
Avianna
Dear Folks,

I need to write a SOQL to copy data from  Case_Type_data_c to new object Exec_Case_Type_c ..I have the query to pull out the data from the this new Exec case type data
select Case_c, Level_1c, Level_2c,Level_3c from Exec_Case_Type_c

Can some one please provide a  SOQL and its relevant test case class

Thanks in Advance
Avianna
 
Hello,

I have below lightning markup which should display value of a record from LDS.
<aura:component  implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    <aura:attribute name="boatId" type="ID" access="public"/>
    
    <aura:attribute name="record" type="Boat__c" description="The record object to be displayed" access="public"/>
<aura:attribute name="simpleRecord" type="Object" description="A simplified view record object to be displayed" access="public"/>
    <aura:attribute name="recordError" type="String" description="An error message bound to force:recordData" access="public"/>

	Boat details are here for {!v.boatId}
       <force:recordData aura:id="service"
                  recordId="{!v.boatId}"
                   fields="Id,Name"
                   mode="VIEW"
                   targetFields="{!v.record}"
                  
                   targetError="{!v.recordError}"
                    />
    <br/>{!v.record.Name} should come
   
    

</aura:component>
In above code the below line properly displays the id of object.
Boat details are here for {!v.boatId}

But the <force:recordData> does not display the below line.
{!v.record.Name} should come

However in same code if I hardcode the Id of object record as below, it works.
recordId="a061H00000aQlGsQAK"


 
Hello,

I want to update picklist values in edit form based on values available in table.
My VF page looks like :
<apex:selectList value="{! Contact.assign_1_Business_Vertical__c }" multiselect="true" size="5">
                <apex:selectOptions value="{!parentPicklistOptions}"  />
                <apex:actionSupport event="onchange"  rerender="panel2,panel3" />
            </apex:selectList>
My controller is :
public List<SelectOption> getParentPicklistOptions() {
        List<SelectOption> selectOpts = new List<SelectOption>();
        for ( String s : parentDepMap.keySet() )
            selectOpts.add(new SelectOption(s, s));
      System.debug(contact.assign_1_Business_Vertical__c);
          Contact.assign_1_Business_Vertical__c = 'Finance';
          
        return selectOpts;
    }

I can only preset any one value as you can see from apex above where i selected 'Finance'.
I came to know from other forum topics that I can setup a getter setter for values variable of VF page in apex. and there the data type should be String array.
But in my case I am using standerd database field as Value variable in Vf page.
<apex:selectList value="{! Contact.assign_1_Business_Vertical__c }" multiselect="true" size="5">

How can I prepopulate multiple values in this scenario.

 
Hello,

When I click on "Check Challenge" I get below error :
Looks like we're having issues, please try again. If this issue persists, please contact us using the submit feedback section on the sidebar.
Hello,

When I click on "Check Challenge" I get below error :
Looks like we're having issues, please try again. If this issue persists, please contact us using the submit feedback section on the sidebar.
Hi,
I have 2 Visualforce pages that I would like to share the 1 controller. The first page which is already connected to the controller is a list, and the second page is a registration form. How would I add the registration form to the controller?
Thank you

Page 1:
<apex:page controller="NFOSController">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!accs}" var="a">
                <apex:column value="{!a.Name}"/>
                <apex:column value="{!a.Availability__c}"/>
                <apex:column value="{!a.Number_of_Competitors__c}"/>
                <apex:column value="{!a.Active__c}"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Controller:
public class NFOSController {

    public List<Division_Space2__c> accs {
        get {
            if (accs == null) accs = [select name, Availability__c, Number_of_Competitors__c, Active__c from Division_Space2__c limit 1000];
            return accs;
        }
        set;
    }
}
​​​​​​​
Page 2:
<apex:page standardController="Competitor2__c" lightningStylesheets="true">
<apex:sectionHeader title="Noosa Festival of Surfing" />
       <apex:form id="NFOS1"> 
        
    <apex:pageBlock title="New Competitor" mode="edit">
             <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
             </apex:pageBlockButtons>
                        
            <apex:pageBlockSection columns="2" showHeader="true" title="Registration" >
                <apex:inputField value="{!Competitor2__c.Name}" required="false"/>
                <apex:inputField value="{!Competitor2__c.First_Name__c}" required="false"/>
                <apex:inputField value="{!Competitor2__c.Division_Space__c}" required="true"/>
                <apex:inputField value="{!Competitor2__c.Lastname__c}" required="false"/>
                <apex:inputField value="{!Competitor2__c.Date_of_Birth__c}" required="false"/>
                <apex:inputField value="{!Competitor2__c.Waiver_Read_T_Cs_Accepted__c}" required="false"/>
                <apex:inputField value="{!Competitor2__c.Email_Address__c}" required="false"/>
                <apex:pageBlockSectionItem />
                <apex:inputField value="{!Competitor2__c.Phone_Number__c}" required="false"/>
                <apex:pageBlockSectionItem />
                <apex:inputField value="{!Competitor2__c.Street_Address__c}" required="false"/>
                <apex:pageBlockSectionItem />
                <apex:inputField value="{!Competitor2__c.Suburb__c}" required="false"/>
                <apex:pageBlockSectionItem />
                <apex:inputField value="{!Competitor2__c.State__c}" required="false"/>
                <apex:pageBlockSectionItem />
                <apex:inputField value="{!Competitor2__c.Postcode__c}" required="false"/>
                <apex:pageBlockSectionItem />
                <apex:inputField value="{!Competitor2__c.Country__c}" required="false"/>
                <apex:pageBlockSectionItem />
            </apex:pageBlockSection>            
            
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
Hi there,
I’m looking to create a validation rule on a Geolocation field (longitude and latitude fields).
I want to ensure that the Sales reps are entering values that have a MINIMUM of 6 digits after the decimal place. How would I do this? I was thinking of creating a validation rule. But I’m not sure how to create the logic.
For example:
11.123456 (acceptable)
11.12345 (not acceptable)
Field Name: Coordinates __c
Thank you for your help!
<apex:page standardController="User" extensions="RegistrationExt">
  <apex:form >
  <div id="logo" >
          <img src="{!$Resource.logo}" width="20%"/>
          <hr  style="height:5px;background-color:orange"> </hr>
       </div>
  <div style="text-align: center;margin-top: 40px;" >
        <span style="margin-right: 10px;">First Name</span><apex:inputText value="{!user.Name}" />
        </div><br></br>
       <div style="text-align: center;">
        <span style="margin-right: 10px;">Last Name</span><apex:inputText value="{!User.Last_Name__c}" required="true" />
        </div><br></br>
        <div style="text-align: center;">
        <span style="margin-right:38px;">Email</span><apex:inputText value="{!User.Email__c}" required="true" />
        </div><br></br>
        <div style="text-align: center;">
        <span style="margin-right: 35px;">Phone</span><apex:inputText value="{!User.Phone}" required="true" />
        </div><br></br>
        <html>
                  <body>

                      <center>

                        <form >
                        <input type="checkbox" id="doc" value="{!USer.Profile}" />
                        <label for="doc"> Doctor</label>
                        <input type="checkbox" id="Nur" value="{!USer.Profile}" />
                        <label for="Nur"> Nurse</label>
                        <input type="checkbox" id="IntDoc"  value="{!USer.Profile}"/>
                        <label for="IntDoc">Intern Doctor </label>

                        </form>
                        </center>
                        </body>
                       
                        </html>

<!--Controller class-->

public with sharing class RegistrationExt {
  User us;
     public String confirmPwd {get;set;}
    
    public RegistrationExt(ApexPages.StandardController con){
        
       us = new User();
        us = (User)con.getRecord();
    }
     public PageReference save() {
          PageReference pr; //default value is null
         if(String.isBlank(us.Password__c) || String.isBlank(confirmPwd)) {

            ApexPages.Message msg = new ApexPages.Message(ApexPages.severity.Error,'Please enter both Password and Confirm Password.');
            ApexPages.addMessage(msg);
        }
        else if(us.Password__c != confirmPwd) {
            ApexPages.Message msg = new ApexPages.Message(ApexPages.severity.Error,'Password and Confirm Password mismatch.');
            ApexPages.addMessage(msg);
        }
        else {
            try {
                insert us;  
                   pr = Page.EMRPediatricsHome;
            }
             catch(Exception e) {
                ApexPages.Message msg = new ApexPages.Message(ApexPages.severity.Error,e.getMessage());
                ApexPages.addMessage(msg);
            }
        }

        return pr;
    }
  }
Hi Developers,
I am new to salesforce. My requirement is to create custom tab using metadata API as i have created custom objects.Please answer as soon as possible but not in xml package
So, I'm trying to get product related to opportunity to show up in the same page, but even with an extended controller I can't seem to get it working. 

<apex:page standardController="Opportunity" extensions="PositionsExtends">
    <apex:form >
        <apex:pageBlock title="Edit Opportunity" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Opportunity Fields" Columns="1">
                <apex:outputText value="{!Opportunity.Amount}"/>
                <apex:inputField value="{!Opportunity.AccountId}"/>
                <apex:inputField value="{!Opportunity.LeadSource}"/>
                <apex:inputField value="{!Opportunity.CloseDate}"/>
                <apex:inputField value="{!Opportunity.StageName}"/>
            </apex:pageBlockSection>
            
            <apex:pageBlockSection>
                <apex:outputField value="{!ProductList.Name}"/>
                <apex:outputField value="{!ProductList.Opportunity__c}"/>
                <apex:outputField value="{!ProductList.StockKeepingUnit}"/>
                <apex:outputField value="{!ProductList.IsActive}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>


public class PositionsExtends {
    
    public List<Product2> ProductList {get;set;}
    
    public PositionsExtends(apexpages.StandardController stdcontroller) {
        ProductList= [SELECT Name, Opportunity__c, StockKeepingUnit, IsActive FROM Product2 Limit 100];
    }
}


What am I doing wrong here I am just getting an error saying Unknown property 'OpportunityStandardController.Product2'
So i have a question that i likely very simple but google isnt helping. How do I edit or create new records for a standard object that isnt tabbed. I'm aware I can tab custom objects but this won't work. Really I don't need to tab it I just need to access the records but outside of an apex soql search I can't find a way to access them.
I have an apex class which updates the files count on custom object called Declined_Policy__c.

Below is my apex class:
 
public with sharing class Policy_FileCountClass {

    public static void updateAttachmentCountOnDps(List<ContentDocumentLink> DocuLinks) {
        Set<Id> policyids = new Set<Id>();
        for (ContentDocumentLink cdl : DocuLinks) {
            policyids.add(cdl.LinkedEntityId);
        }

        List<Declined_Policy__c> dpsToUpdate = [
            SELECT Id, Attachments__c,
                (SELECT Id FROM ContentDocumentLinks) 
            FROM Declined_Policy__c WHERE Id IN :policyids
        ];
        for (Declined_Policy__c dp : dpsToUpdate) {
            dp.Attachments__c = dp.ContentDocumentLinks.size();
        }
        update dpsToUpdate;
    }

}

Now, as per the above logic, i can able to the count in attachments__c field if there is any file attached to the record or if it is deleted. I could able to see the count in these scenarios. But the issue is that, if there is no file attached to the record when the record is inserted, the attachments__c field will be blank instead of displaying 0

Is there any way that i can update the above logic to get the attachments__c to display 0 by default if there is no file attached to it. Please suggest.
String xy=' ';

not working. could you please help.
Hi ,

Please help me in writing a Batch Job code and test class that takes data from fields  Case__c, level1__c,level2__c, level3__c from Executive_RT custom object  and
 populates it into below fields namely number__c, level1__c,level2__c, level3__c of Case Type Data custom object  
 
 I want this job to get executed Bi weekly

Thanks In advance
Avianna
Dear Folks,

I need to write a SOQL to copy data from  Case_Type_data_c to new object Exec_Case_Type_c ..I have the query to pull out the data from the this new Exec case type data
select Case_c, Level_1c, Level_2c,Level_3c from Exec_Case_Type_c

Can some one please provide a  SOQL and its relevant test case class

Thanks in Advance
Avianna
 
I have 2 custom picklist both has the same values and under the same object (Case), so  I want whatever its been selected on picklist 1 will be selected in picklist 2  - WF or PB is not the best approaches since I have more than 10 values on the picklist - I am not sure how to approach it using Trigger 

Thanks 
I have technician's related to accounts that they work with and I would like to have their email auto-populated into the account with a mirrored field. Can anyone walk me through how to do this? 
Hello,

I have below lightning markup which should display value of a record from LDS.
<aura:component  implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    <aura:attribute name="boatId" type="ID" access="public"/>
    
    <aura:attribute name="record" type="Boat__c" description="The record object to be displayed" access="public"/>
<aura:attribute name="simpleRecord" type="Object" description="A simplified view record object to be displayed" access="public"/>
    <aura:attribute name="recordError" type="String" description="An error message bound to force:recordData" access="public"/>

	Boat details are here for {!v.boatId}
       <force:recordData aura:id="service"
                  recordId="{!v.boatId}"
                   fields="Id,Name"
                   mode="VIEW"
                   targetFields="{!v.record}"
                  
                   targetError="{!v.recordError}"
                    />
    <br/>{!v.record.Name} should come
   
    

</aura:component>
In above code the below line properly displays the id of object.
Boat details are here for {!v.boatId}

But the <force:recordData> does not display the below line.
{!v.record.Name} should come

However in same code if I hardcode the Id of object record as below, it works.
recordId="a061H00000aQlGsQAK"


 
Hello,

I want to update picklist values in edit form based on values available in table.
My VF page looks like :
<apex:selectList value="{! Contact.assign_1_Business_Vertical__c }" multiselect="true" size="5">
                <apex:selectOptions value="{!parentPicklistOptions}"  />
                <apex:actionSupport event="onchange"  rerender="panel2,panel3" />
            </apex:selectList>
My controller is :
public List<SelectOption> getParentPicklistOptions() {
        List<SelectOption> selectOpts = new List<SelectOption>();
        for ( String s : parentDepMap.keySet() )
            selectOpts.add(new SelectOption(s, s));
      System.debug(contact.assign_1_Business_Vertical__c);
          Contact.assign_1_Business_Vertical__c = 'Finance';
          
        return selectOpts;
    }

I can only preset any one value as you can see from apex above where i selected 'Finance'.
I came to know from other forum topics that I can setup a getter setter for values variable of VF page in apex. and there the data type should be String array.
But in my case I am using standerd database field as Value variable in Vf page.
<apex:selectList value="{! Contact.assign_1_Business_Vertical__c }" multiselect="true" size="5">

How can I prepopulate multiple values in this scenario.