• Kenn K.
  • NEWBIE
  • 10 Points
  • Member since 2011
  • Klatch Inc

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 19
    Replies

I have deactivated one the recordtype we have and I still see the option when I create a new case i.e. under 'Available cases record types'

I deleted it without any issues and it just got rid of the name. I now see the id of the deleted recordtype.

Is there something I'm missing here to remove it from the available case record types?

I am trying to build a trigger that does a few things and I was hoping I could get the best direction in handling this.

I have 2 objects ("Quote" and "QuoteLine") and a custom setting called "ServiceDate__c" which basically stores 2 information, Country__c and numberOfDays__c. The goal of the trigger is to query aCountry__c field on the QuoteLine object, compare it to country field on the ServiceDate__c object to get the number.
For Example, on the quote line, we store country names like USA. On the Custom setting, we have a map that stores Country, USA with a ServiceDate value of 50. 50 is the number of days that needs to be added to the close date on the quote line. So it's be closeDate 2016-01-20 + 50.

Finally, since there will be a number of closeDate__c fields on the QuoteLine, I would like to query only the UNIQUE CloseDate__c values and update the Quote object.

Sample code would be appreciated.

Tl:dr. Get unique date values on the Quote after calculation happens on the Quoteline object that references a custom setting for more information.

Here is what I have so a far;
 
trigger SB_QuoteAdditionalUpdates on SBQQ__Quote__c (before insert, before update) {

    Set<id> QuoteIds = New Set<id>();

    for (SBQQ__Quote__c SBQuotes : trigger.new){

            QuoteIds.add(SBQuotes.id);
            SBQQ__QuoteLine__c[] SBQuoteLines = [Select country__c, country_code__c, close_date__c, country_employee_construct__c, Employee_CountFormula__c from SBQQ__QuoteLine__c where id IN: QuoteIds];

            if(SBQuoteLines.size()>0){
                for(SBQQ__QuoteLine__c SBQuoteLine : SBQuoteLines ){

                    map<id, OperationalStartDate__c> NumberOfDaysMap = new map <id, OperationalStartDate__c>([select name, Number_Of_Days__c from OperationalStartDate__c where name =: SBQuoteLine.country__c ]);
        }
    }
}

}

 

I want to prevent users from being redirected when they click a button and picklist value is false.

I have a custom button on Opportunity related list on account. If the value of Account type is 'OLD', users should get an error message and not redirect the page. If it's anything else, they can be redirected opportunity.

What is the best way of going about this?

Thanks, -Ken

I want to regularly send all account information from salesforce to another external system that will accept it as xml. I have the end point url for the external system and the fields that needs to be sent. 

How do I go about creating this? I assume I will have to schedule this to run daily at a particular time.

Please help.

 

Thanks.

I am creating a test class and the scenario I am testing requires an older date for the created date. I know CreatedDate is an audit field and I can't write to it. Is there a workaround I could use for writing my test class?

Thanks.

Hi there,

 

I have this field that gets populated by an external service and I want to extract the number values from it then sum the numbers up.

For instance, see the text below

United Kingdom: 3, Ireland: 1, Netherlands: 1, Spain: 2, Australia: 1

 

I would like to extract 3,1,1,2,1 and sum them individually to have 8. i.e. 3+1+1+2+1 = 8.

 

Thanks.

I have this query,

 

list<Contact> relatedContacts = [select id, AccountId, (Select Id From Cases) from Contact where id IN :contactIds ];

 

The thing is, I want to get the value of the cases Id  so I can use it to update another field.

 

How do I go about getting this value?

 

Thanks,

-K

 

Hi all,

 

I am new to Salesforce.

 

What is the " Integration" in Salesforce.com, What we can do in Integration?

 

Can you please Help Me..

 

Thanks for your Help..

Hi There,

 

I would like to query for the opportunity.ownerId of the opportunity from a quote using a trigger. (I.e. who is the owner of the opportunity tied to the current quote) How do I go about doing this in a trigger?

Can't seem to get anywhere. Please explain what you did a little.

 

Thanks a lot!

Hi,
Is there any way to convert String /Sentence to Title Case in Apex.

Convert From
"this is a sentence"
To
"This Is A Sentence"


Thanks
R