• 顺娟 许
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Here's the code:
        if (UtilQuote.isUpdate) {
            //验证产品是否有效
            for (Quote qu : Quotes)
            {
                if (trigger.newMap.get(qu.Id).Cnt_of_Quote_line__c >= trigger.oldMap.get(qu.Id).Cnt_of_Quote_line__c )
                {
                    List<QuoteLineItem> inActiveProLst = [Select Id,PricebookEntry.Product2.Id,PricebookEntry.Product2.Name From QuoteLineItem where QuoteId IN:quotes and PricebookEntry.Product2.IsActive = false]; 
                    for (QuoteLineItem qli : inActiveProLst ) {
                        trigger.new[0].addError('该报价单有无效的产品:' + qli.PricebookEntry.Product2.Name + ',请重新选择产品!');
                        break;
                    }
                } 
            }

how can I exclude user in these two profiles?
$User.ProfileId <>"00e90000000qoiZ"
$User.ProfileId <>"00e90000000pV2l"

it's quite easy in validation rules but I don't know how to change the code, would somebody help?

Thank you very much in Advance!!!