• João Almeida
  • NEWBIE
  • 10 Points
  • Member since 2019

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

I'm trying to start a flow that receives a record collection as input.

I have the following code:

List<YB_Dosage_Line__c> parsedDosagelines =(List<YB_Dosage_Line__c>)JSON.deserializeStrict(serializedApplicationRecord,List<YB_Dosage_Line__c>.class);
                
                Map<String, Object> flowParams = new Map<String, Object>{'dosageLines' => parsedDosagelines};
    
                Flow.Interview.YB_Dosage_Lines_Process_Related_Generic_Group_and_Product_Family flowInstance = new Flow.Interview.YB_Dosage_Lines_Process_Related_Generic_Group_and_Product_Family(flowParams);
    
flowInstance.start();

But, it throws the following error:

Malformed JSON: Expected '[' at the beginning of List/Set
Any ideas?

I'm trying to start a flow that receives a record collection as input.

I have the following code:

List<YB_Dosage_Line__c> parsedDosagelines =(List<YB_Dosage_Line__c>)JSON.deserializeStrict(serializedApplicationRecord,List<YB_Dosage_Line__c>.class);
                
                Map<String, Object> flowParams = new Map<String, Object>{'dosageLines' => parsedDosagelines};
    
                Flow.Interview.YB_Dosage_Lines_Process_Related_Generic_Group_and_Product_Family flowInstance = new Flow.Interview.YB_Dosage_Lines_Process_Related_Generic_Group_and_Product_Family(flowParams);
    
flowInstance.start();

But, it throws the following error:

Malformed JSON: Expected '[' at the beginning of List/Set
Any ideas?
private Opportunity currentOpp;

    public ConvertOppToProjectControllerExtension(ApexPages.StandardController stdController) {
        this.currentOpp = (Opportunity)stdController.getRecord();
    }
    
    public ConvertOppToProjectControllerExtension(Opportunity currentOpp) {
      this.currentOpp = currentOpp;
    }

      currentOpp = [SELECT Id, Abbreviation__c, AccountId, CloseDate, Name, OwnerId, Probability, Description, StageName, Portfolio__c,
              NextTaskNumber__c, Company__c, Service_Type__c, AM_Sales_Ops__c,
                (SELECT Name, Approved__c, Opportunity__c, Estimate_Total_Dollars__c FROM Estimates__r)
          FROM Opportunity
          WHERE Id = :currentOpp.Id];

      //Convert the Opportunity itself
      currentOpp.StageName = 'Closed Won';
      currentOpp.CloseDate = System.now().date();      
      Database.update(currentOpp);

We have the Closed Won stage set at 100% Probability. If we manually move the Oppty to Closed Won and save, the Probability updates to 100% jsut fine. But when using the code below, it updates the stage correctly but the Probability remains where it was. We have this working in our Prod instance, but we're attempting some stage renames (probabilities staying the same - and not changing Closed Won), but it's not updating the Probability field.

 

Hello,

 

Short version:

Is there a way for my test class to utilize the code in the "ActionPlansUtilitiesTest" class in an EE org running the managed version of Action Plans?

 

Long version:

Our company is utilizing the managed version of Action Plans.  I've written a trigger to give us more flexibility with the app, but I'm having trouble getting the test class to pass testing.

 

Initially, I made the trigger and test class based on the unmanaged version, but we want to be able to upgrade the app if there are new releases, so I altered the object and field names in my trigger and test class to work with the managed version.

 

In my test class, I pasted a lot of code from the "ActionPlansUtilitiesTest" class...and this worked with the unmanaged package.  But with the managed version, my code coverage drops dramatically.  It looks a method (within the code I pasted) is unable to make calls to the "ActionPlansUtilities" class.

 

Classes and methods are pretty new to me, so maybe (hopefully) there's something simple I'm missing.  Any help would be greatly appreciated though.

 

I didn't include code here b/c it's quite a bit, but I'd be happy to provide.

 

Thanks!

Aaron

  • February 12, 2011
  • Like
  • 0