• sevgi
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies

My trigger requires a bit complex processing so I wanted to break down logic by creating methods in a Utility class

One of the methods create a detail record, so I declared ıt as type boolean to return status:

 

public with sharing class Utility_MaintainTransferRequests {
    
    public static boolean CreateNewDealer (Case inTRRequest) {

......  control logic

......  create record


        try {
            insert nwDealer;
        }
                    
        catch(Exception e){
            inTRRequest.adderror('Y...........!!!!');      
            return false;                           
        }


But get an error as :

Save error: Non-void method might not return a value or might have statement after a return statement.    Utility_MaintainTransferRequests.cls

 

 

Does it mean I cant use DML in non-void methods or is there sthg wrong with code?

 

Thanks

While working on an application with OAuth recently, I was having the hardest time determining why I couldn't add my Remote Access Application to my package.

 

The problem is that you can add a Remote Access Application to Managed packages only.

 

You also don't add it through the normal "Create->Packages->PackageName->Add Components" like you would do with other items. Remote access applications must be added to the package when it is first created, and this option only appears when the package is marked as managed. You cannot add an existing Remote Access Application to a package. 

 

From the tooltip on the Add Remote Access page:

"A remote access application is only removed from a package when you delete it from your organization. Also, if you create a remote access application and choose not to include it in a package, you can never add it later."

Hopefully this will save someone a little trouble.