• Saurabh Bisht 19
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 5
    Replies
-Firstly Template we need
- Js file
-Apex controller 

all field are dynamically using fieldset.whenever we deploy 
component to org when we fill the fields it will save the records.
@isTest
public class StateNameTest{
   
    @testSetup static void setup()
    {
        StateName__c newStates=new StateName__c();
        newStates.Name='Goa';
        insert newStates;
       
    }

    @isTest
    static void checkStatenamesTest()
    {
        StateName__c testStates=[Select Id from StateName__c where State__c='Goa'];
        Opportunity newOpportunity=new Opportunity();
        newOpportunity.Name='Saurabh Bisht';
        newOpportunity.CloseDate=System.today().addMonths(1);
        newOpportunity.StageName='Qualification';
        newOpportunity.State__c='Goa';
        insert newOpportunity;
        Opportunity testOpportunity=[Select Id,StateName__c from Opportunity where id=:newOpportunity.Id];
        system.assertequals(testStates.Id,testOpportunity.StateName__c);
}
Make two address fields in opportunity , correspondence address and permanent address. We have to fill both the fields with different addresses, if anyone of them is empty then generate message, and if the checkbox is selected then both the addresses should be same.

pls code it asap
-Firstly make two custom field on Account Object.
--Salutation(Type Picklist) Values:Dr , Proff ,Trainee
--Name(Type Text)
--------------------------------------------------------------
What we have to do that whenever user create new record and 
filled Name field then after created record then we will see
Salutation field will filled automatically with Dr. and Before 
Insert and Before Update trigger will be pass in trigger parameter.
----------------------------------------------------------------
when an Opportunity will be inserting an Opportunity Line Item should be insert by default with any of the Product associated with Opportunity.
when user create new conatct and fill email field as abc@gmail.com
firstly we want to extract the email domain name which we filled
as gmail.
then we check that domain name wegot gmail same name as in Account
record.
If it matches the any account so assign that domain to account name field
in Contact object.
if it doesnt match any account then show any error message.
Write a trigger on Opportunity, when an Opportunity will be inserting an Opportunity Line Item should be insert by default with any of the Product associated with Opportunity.
Make a registration form with name, email, 
and address detail. In address detail field we have 
two text fields, one is current address, and another is 
correspondence address. If Both the field is empty then 
generate error.Only one Address field should be filled. 
Save the details.
please code it in LWC with html,css,js and apex class looklup field is Account in Contact
object:opportunity
Opportunity Name field concatenate with Account Name field
ex:
Opportunity name :jbl
Account Name: Saurabh
Result should be: jbl-Saurabh
Any one code it
@isTest
public class StateNameTest{
   
    @testSetup static void setup()
    {
        StateName__c newStates=new StateName__c();
        newStates.Name='Goa';
        insert newStates;
       
    }

    @isTest
    static void checkStatenamesTest()
    {
        StateName__c testStates=[Select Id from StateName__c where State__c='Goa'];
        Opportunity newOpportunity=new Opportunity();
        newOpportunity.Name='Saurabh Bisht';
        newOpportunity.CloseDate=System.today().addMonths(1);
        newOpportunity.StageName='Qualification';
        newOpportunity.State__c='Goa';
        insert newOpportunity;
        Opportunity testOpportunity=[Select Id,StateName__c from Opportunity where id=:newOpportunity.Id];
        system.assertequals(testStates.Id,testOpportunity.StateName__c);
}
-Firstly make two custom field on Account Object.
--Salutation(Type Picklist) Values:Dr , Proff ,Trainee
--Name(Type Text)
--------------------------------------------------------------
What we have to do that whenever user create new record and 
filled Name field then after created record then we will see
Salutation field will filled automatically with Dr. and Before 
Insert and Before Update trigger will be pass in trigger parameter.
----------------------------------------------------------------
please code it in LWC with html,css,js and apex class looklup field is Account in Contact