Pankaj Ganwani
  • Member for 6 years, 9 months
  • Last seen more than 4 years ago
  • Mumbai, India
Test class fails throws different types of error as :STANDARD_PRICE_NOT_DEFINED, No standard price defined for this product
Accepted answer
3 votes

You can use Test.getStandardPricebookId() method to get the standard pricebook Id in test class. In this way, you don't need to perform any soql or write seealldata=true. Please let me know if this ...

View answer
Update case and opportunity owner to login user using custom button
1 votes

You don't need to create any apex class for accomplishing this. You can make use of connection.js file. Place following code on click of javascript {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} {...

View answer
Opportunity STAGE picklist value need to change
1 votes

This is standard functionality given by salesforce. So, you cannot change it. Event if you create a custom picklist field in salesforce, there also you will get the --None-- option.

View answer
Update case and opportunity owner to login user using custom button
0 votes

Javascript {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")} var result = sforce.apex.execute("ClassName","methodName", {sId:"{!Object....

View answer
Salesforce license constraints
0 votes

There is no alternative to it. You can create more users from other available licenses such as standard user etc. This is imposed by salesforce itself.

View answer
SOQL Injection Solutions Help - (Used esacapeSingleQuotes(str) - gives error = no viable alternative at character '\' )
0 votes

Use String.escapeSingleQuotes(String) method and then use variables such as myuserid, filter etc. in SOQL

View answer
How can I query files uploaed by other users?
0 votes

Try using ALL ROWS at the end of SOQL like this: [SELECT name, folderid, authorid, developername FROM Document ALL ROWS]; If you are using this soql in apex code, make sure it should be set as ...

View answer
Caching SOQL Query Results - with a List of Id's in the condition
0 votes

You can make utility function like this: private static Map<Id, User> getUsers(List<Id> accOwnerIds) { return [select id, name, profile.name from user where id in :accOwnerIds]; } Use ...

View answer
how to cover catch block in this method in test class
0 votes

Please use below snippet in try block: if(Test.isRunningTest()) Integer i = 10/0;

View answer
Writing Test classes to get code into production
Accepted answer
0 votes

@isTest private class testforAccount { static testMethod void unittest() { Account objAccount = new Account(Name = 'Test'); insert objAccount; ...

View answer
How to check the Field value Case
-1 votes

You can use below formula in validation condition: IF(LEFT(fieldname,1) <> LEFT(UPPER(fieldname),1),true,false)

View answer
ReRender doesn't work
-1 votes

Place the outputpanel in form tag as well.

View answer
How to check if the current user in Public groups before insert new contact using trigger?
-1 votes

Collect the developer(api) names of groups in a set. Iterate over the inserted(on before insert) Contact records and collect the Ownerids in a set. 3. for(GroupMember objGM: [select Id, ...

View answer
Method does not exist or incorrect signature: [Messaging.SingleEmailMessage].setBCCaddress(List<String>)
-1 votes

You should use setBccAddresses(List<String>) instead of setBccAddress(List<String>). You are missing es from the end of the function name.

View answer