• Topher Reynolds
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
I have a Process that I have built that uses a time lapse to create a Task 7 days prior to a field on a custom SObject. This works fine unless the date happens to end up less than 7 days out, forinstance the dealine is 3 days away based on the date changed. I am controlling this in the trigger and that works as well. The problem is when the trigger creates the task immediately, the paused flow interview is not updated and ends up creating another Task when the original date is reached. I cannot find a way to control this in the trigger. Is there a way to do this?
public class Set45DayDeadlineFor1031Deal {
    // This method is called by the Set45DayDeadline process
    @InvocableMethod
    public static void SetDeadline(List<Id> X1031_DealsIds)
    {
        List<X1031_Deals__c> deals = new List<X1031_Deals__c>();
            for(Id dealId : X1031_DealsIds){
                // Query down to the children records (Property) filtered by Property Type = relinquished.  
                // Out of remaining properties grab the_ +*_earliest_*+ *_“Relinquish Final Close of Escrow” date._*
                // This date will then have 45 days added to it and will be placed in the 1031 Deal Object’s *45 Day Deadline*
                List<Property__c> properties = [SELECT Id, Name, Relinquish_Final_Close_of_Escrow__c, X1031_Deal__c
                    FROM Property__c WHERE X1031_Deal__c = :dealId AND Property_Type__c = 'Relinquished'];

                X1031_Deals__c deal = [SELECT Id, Name, X45_Day_Deadline__c, X1031_Client__c 
                    FROM X1031_Deals__c WHERE Id = :dealId][0];

                if(properties.size() > 0){
                    // A default date to change
                    Date deadline = Date.newInstance(2099, 1, 1);

                    for(Property__c prop : properties){
                        Date propDate = prop.Relinquish_Final_Close_of_Escrow__c;
                        if(propDate < deadLine){
                            deadline = propDate;
                        }
                    }
                    
                    deals.add(new X1031_Deals__c(Name='tested', X1031_Client__c=deal.X1031_Client__c));

                    deal.Id = dealId;
                    deal.X45_Day_Deadline__c = deadline.addDays(45);
                    deals.add(deal);

                    System.debug(deal.X45_Day_Deadline__c);
                    System.debug('Deals size is: ' + deals.size());
                }
            }

        if(deals.size() > 0){
            List<Database.SaveResult> results = Database.update(deals, false);
            for(Database.SaveResult result : results){
                if(!result.isSuccess()){
                    for(Database.Error err : result.getErrors()){
                        System.debug('Error: ' + err.getStatusCode() + ' ' + err.getMessage());
                    }
                }
            }
        }
    }
}

 
I have setup the CICD on GitLab, we use the Org Development model. I keep getting the error below, after starting up a scratch org, when just trying to query the System Administrator profile. Does that exist in scratch orgs?
REQUIRED_FIELD_MISSING, Required fields are missing: [ProfileId]: [ProfileId] Class.HPC_TestDataFactory.createInvestorRelation: line 140, column 1...
In the method I am calling...
ProfileID=[SELECT Id FROM Profile WHERE name='System Administrator'].Id
Hello,
We have not used connected apps for our development, we have just made changes in the default org. There are multiple Lightning Apps, and some of them share common classes that have been deployed. Everything I have been able to find online in regards to setting up a CI/CD pipeline always comes back to using a connected app. Is it possible to setup CI/CD without a connected app so that the changes are just pushed to the org itself? And if so, are the steps to accomplish this available anywhere?
Thanks in advance!
Topher
I have setup the CICD on GitLab, we use the Org Development model. I keep getting the error below, after starting up a scratch org, when just trying to query the System Administrator profile. Does that exist in scratch orgs?
REQUIRED_FIELD_MISSING, Required fields are missing: [ProfileId]: [ProfileId] Class.HPC_TestDataFactory.createInvestorRelation: line 140, column 1...
In the method I am calling...
ProfileID=[SELECT Id FROM Profile WHERE name='System Administrator'].Id
Hello,
We have not used connected apps for our development, we have just made changes in the default org. There are multiple Lightning Apps, and some of them share common classes that have been deployed. Everything I have been able to find online in regards to setting up a CI/CD pipeline always comes back to using a connected app. Is it possible to setup CI/CD without a connected app so that the changes are just pushed to the org itself? And if so, are the steps to accomplish this available anywhere?
Thanks in advance!
Topher