• niki s 7
  • NEWBIE
  • 35 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 42
    Questions
  • 29
    Replies
Hello I am creating an ui for account. It contains 2 fields name and city. There will be a button which will display list of account. Now while passing values from js to apex getting name as null but in alert it's showing the value 
I have requirement in lwc we have 2 field country and state based on country should show the state value.
and country should have only two records india nd uk 
How to achieve this using lwc
How do I block user from using login.salesforce.com
In lightning from account object we can see contact related list. If we click the drop down present beside contact record we can able to see an option call add to campaign.. how to remove this add to compagin from drop down
On updating phone on contact object that should also updated the account phone no .. can this be possible using process builder 
Write a trigger on Opportunity, when an Opportunity will be insert an Opportunity Line Item should be insert by default with any of the Product associated with Opportunity.

It should be able to handle bulk records 
Select I'd,( select I'd from pricebookEntries),(select id from opportunities where I'd='111') from pricebook2
I want to write this query on opportunity object.
I Just want to retrieve pricebookEntry and pricebook2 where opp id is 11
 
Hello as we all know that customer validation excute first and then before trigger . 
so I write a trigger to show error message if description is null
trigger updatecontact on contact( before trigger)
for(contact con: trigger new)
If(con.description == null)
Con.adderror(' message from trigger i.e contact is null')
 
And wrote a custom validation for the same thing
When I try to save the code its showing message from before trigger not from custom validation .

Why so . Please help I'm confused
 
 
Hello I have a requirement, I want to show error message if any user try to create a new contact with same  name  that is already association with a account.
using workflow or validation rule. 
Please don't recommend to use trigger. I know how to achieve this using trigger 
 
Hello,

I am facing an issue. Primary reason is a dependent field on opp close step. After closing the opp as close lost I try to chnage the primary reason but all  LoVs are not showing. It only showing one lov that I have selected on closing the opp. But as a admin I can able to view all the LoVs .
 
suppose user a has created some records on account object and he don't want his manger to view those record . how to achieve this bcause for standard object we can't disable grant access hierarchy button
write a soql query on c  where a is parent from b and b is parent of c 
suppose m is the manager of a and a b c are 3 users and  a share records with b   and b have edit and read permissions now  m changes the owner from  a to c so will  b have access to records???
When should we use LDS and apex controller. Explain me with different scenarios
Suppose in opportunity I am changing the stage name from stage1 to stage2 then I need to set the checkbox as true.

How to achieve this using configuration
Hello in account object there is a field called xyz and in that field I want to pass hard-coded value.. what is the easiest way to achieve this.. please help
how to get object in future method without quering ??
 
12)how to make lightning app visible in application
I have 5 users and they are associated with different different profiles. And everything set in that way so that no one can see each other records. Also owd is set as private . But one of them available to view the records why so 
On updating phone on contact object that should also updated the account phone no .. can this be possible using process builder 
Write a trigger on Opportunity, when an Opportunity will be insert an Opportunity Line Item should be insert by default with any of the Product associated with Opportunity.

It should be able to handle bulk records 
Select I'd,( select I'd from pricebookEntries),(select id from opportunities where I'd='111') from pricebook2
I want to write this query on opportunity object.
I Just want to retrieve pricebookEntry and pricebook2 where opp id is 11
 
Hello as we all know that customer validation excute first and then before trigger . 
so I write a trigger to show error message if description is null
trigger updatecontact on contact( before trigger)
for(contact con: trigger new)
If(con.description == null)
Con.adderror(' message from trigger i.e contact is null')
 
And wrote a custom validation for the same thing
When I try to save the code its showing message from before trigger not from custom validation .

Why so . Please help I'm confused
 
 
Hello I have a requirement, I want to show error message if any user try to create a new contact with same  name  that is already association with a account.
using workflow or validation rule. 
Please don't recommend to use trigger. I know how to achieve this using trigger 
 
write a soql query on c  where a is parent from b and b is parent of c 
suppose m is the manager of a and a b c are 3 users and  a share records with b   and b have edit and read permissions now  m changes the owner from  a to c so will  b have access to records???
When should we use LDS and apex controller. Explain me with different scenarios
Hello in account object there is a field called xyz and in that field I want to pass hard-coded value.. what is the easiest way to achieve this.. please help
12)how to make lightning app visible in application
I have 5 users and they are associated with different different profiles. And everything set in that way so that no one can see each other records. Also owd is set as private . But one of them available to view the records why so 
Hello, I am working on after trigger using old map and new map.
SToring maps values in a list like this
List<Opportunity> oppNewMap = newMap.values();
List<Opportunity> oppOldMap = oldMap.values();
Now I'd of opp in case of both oldmap and newmap will be same. 
But value are different. 
In opp there is a lookup field . And opp has a child object  product and same lookup field is also present in product obj.
Now when I update the lookup field in opp it should update the lookup field in related product. And it can have more than product.
I want to write a after trigger can anybody please help me with this.
Where I am main stuck writing soql queries on based on old values 
 
Hello need one help I have created one validation rule on opp object and printing message as "please select this"  in classic it displaying the message correct but in lightning it's showing &quot please select this &quot
Hello I am writing a trigger on contact object where if I select account lookup field than account s country also get populated in contact object.
code is working fine just need to optimised it .

 
public class UpdateContactRecordsFromAccount {

   
    public void beforeInsert(List<Contact > neWValues)
    {
       Set<ID> id_po = new Set<ID>();
      for(Contact po : newValues){
            id_po.add(po.AccountId);
        }
       
     List<Account> AccountList = [select id , Country__c  from Account where Id in : id_po];
     for(Contact con : neWValues){  
          for(Account  acc : AccountList)
          {
           con.Country__c = acc.Country__c;
            
          }
       }
    }
}

Please help 
Hello,
I have created two field called num and opp in contact and account object. Created a trigger on account object and upon updating field on account it will also populated on contact object. But there is custom validation on num field . Num should be less than 50.  So while updating account it's give the dml exception .Now my requirement is that I want to display the error message on while updating account. 

trigger AccountUpdate on Account (after update) {
List<Account> parentOppList =[select Id,lookup_opp__c,test__c,Num__c,(select id,test__c,Num__c from contacts) from Account where Id in : trigger.new ] ;      
       List<Contact> oppList = new List<Contact>();
        for(Account parOpp : parentOppList)
        {
            System.debug('inside for '+parOpp.lookup_opp__c);
       
             System.debug('inside for '+parOpp.lookup_opp__c);
             for(Contact childContacts : parOpp.contacts ){
            Contact opp = new  Contact();
            opp.lookup_opp__c = parOpp.lookup_opp__c;
            opp.id=childContacts.id;
            opp.test__c = parOpp.test__c;
            opp.Num__c = parOpp.Num__c;
            System.debug('inside for '+opp.lookup_opp__c);

            oppList.add(opp) ;
         
       // }
    try{
             if (!oppList.isEmpty()){
                 update oppList;
         System.debug('inside catch');
          }
           }
               catch(Exception e)
                 {
                 System.debug('inside catch');
                             
                         throw new DmlException('This is bad number');    
                        // Trigger.New[0].addError('Write error message');

                     }
    }

           
         }
                     
}
I have two custom object one is parent and another one is child and there are some fields which are same in both the object. Now if I update fields in parent object then it will also update the same in child object. custom validation is present in child object. so I have used try nd catch block but what I am getting it handle the custom validation and updated the parent object but child object is not getting updated due to custom validation present in child object . What I want is that I want to show the message from parent object nd stop it from updating the parent record also. I want to achieve this through code. Please help me