• Has Nah
  • NEWBIE
  • 20 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
Hi 
i have created the dynamic query where I have the record id, using the schema i have built the database.query, i am unable to get the values out of this query, 
if(dfr.isNameField()){
                 query = 'SELECT Id, ' +dfr.getName()+ ' FROM ' +myobj+ ' WHERE Id =:myId';
            }
list<sobject> query = database.query(query);
for(sobject s: query){
// want ot extract he value of the Name
}
can not do the casting.
Help to solve this.
Thanks
trigger TaxCalaculation on OrderItem (before insert,before update) {
    
    product2 a;
    //List<orderItem> a=[select product2.family from orderItem where product2id IN :Trigger.newMap.keySet()];
    //List<OrderItem> li=new List<OrderItem>();
    for(OrderItem o:Trigger.new)
    {
         a=[select family from product2 where id= :o.Product2Id];
        //o=[select Product2.family from orderItem where product2id= :Trigger.new.product2id];
                  
        //o=[select product2.family from orderItem where product2Id IN :Trigger.new];
        
        if(a.family=='Electronics')
       {
           o.taxRate__c=0.02;
       }
        
        else if(a.family=='FootWear')
       {
           o.taxRate__c=0.05;
       }
        
        else if(a.family=='Clothing')
       {
           o.taxRate__c=0.07;
       }
        
        o.finalRate__c=o.UnitPrice*o.Quantity*o.taxRate__c;
        
         system.debug(o.taxRate__c);
         system.debug(a.Family);
        System.debug(o.finalRate__c);

    }

}
Hi all,

I am working on the LWC Specialist Superbadge Challenges. For my component BoatTile, the Boat pictures are supposed to load up on the page. See screenshot below- 
Boat Picture Issue

This is the piece of code for that-
    get backgroundStyle() { 
      return "background-image:url(${this.boat.Picture__c})";}

Please have a look! Thanks!
Hi ALL,
I need to get all items(records) of Products2.
According to the request, it returns an overview of Product2's metadata as well as a list of the most recently used Product2 records :  GET/services/data/v39.0/sobjects/Product2(https://developer.salesforce.com/docs/api-explorer/sobject/Product2/get-product2 ).
As I understand list of the most recently used Product2 records doesn't contain all records, so how can I get all records of Product2  or Account or any other object?
Trigger name exists on different SObject type: Quote
I had a trigger that I initially wanted to work just before a Quote is saved, but we decided to move the trigger to the Opportunity object instead of the quote. I had originally set it up like this:
trigger PSGProjectDeleteTrigger on Quote (before update) {
    for(Quote quoteSelected : Trigger.new){ CODE TO COMPLETE WHEN TRIGGER FIRES }
I was able to save the trigger like that, but when I went back to it and changed it to :
trigger PSGProjectDeleteTrigger on Opportunity (before update) {
    for(Opportunity projectSelected : Trigger.new){ CODE TO COMPLETE WHEN TRIGGER FIRES }
I receive the following error:
Error: Compile Error: Trigger name exists on different SObject type: Quote at line 1 column 1

I found a post about this that suggested not using the developer console and instead going to setup>develop>apex triggers and editing it their directly. I did that and still receive the same error.

Another post suggested that I chang the name of the trigger so I added the number two to the end of the trigger name and still receive the same error.

Both Quote and Opportunity are standard objects so I am sure there is no problem with the object names.

Any ideas?????



 
Out SFDC org has both B-to-B and B-to-C business models.  We have enabled Person Accounts.  Now we are going to service Person Accounts on behalf of our Business Accounts. What would be the best approach to relate multiple Person Accounts with a single Business Account?  Use the Partners related list, or maybe create a new Master-Detail or Lookup relationship field?  What would be best practice for this?  Example, our client is a Credit Union (CU) and the Person Accounts will be the CU's members. We will sell services to the CU's members as though we are the CU itself.  We want to track Campaigns that involve the Person Accounts but also relate multiple Campaigns to the CU account record for reporting purposes.