• Sheila Tirrell
  • NEWBIE
  • 5 Points
  • Member since 2023

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

Hi All, 

can anyone please tell me weather we can export and import data of approval history. 

I have to remove an object and export the approval history for that also i want to update the same data to another newly created object.

Thanks

Using this command: sf project deploy start --ignore-conflicts
to deploy a flow to a scratch org fails with this error:
SCV_Outbound_Call (Action) - The action type "SCV Outbound Call" can't be used in flows with the process type "Autolaunched Flow".
Seems to indicate you cannot have that SCV_Outbound_Call action in an Autolaunched Flow, however the Salesforce docs show the steps on how to create an Autolaunched Flow with that same action, here:
https://help.salesforce.com/s/articleView?id=sf.voice_hvoc_autolaunched_flow.htm&type=5
I was successful in creating the flow in my scratch org with that action and then pulling it down locally. I then made a one digit change in the phone number field in the metadata xml file and tried to push/deploy to the change to the scratch org and got the error above:
sf project deploy start --ignore-conflicts
SCV_Outbound_Call (Action) - The action type "SCV Outbound Call" can't be used in flows with the process type "Autolaunched Flow".
I also tried moving the flow to a directory adjacent to the force-app folder and deploying via the metadata API command and got an error as well:
sfdx force:mdapi:deploy -d unpackaged-metadata/flows
Deploy has been queued.
Then if I checked the deployment results with sfdx force:mdapi:deploy:report -i 0Af5300000XlWO3CAN -u scoder@scr.com
It responded with
Status: Failed Deployed: 0/0 Errors: 0 Tests Complete: 0/0 Errors: 0 Error (1): The metadata deploy operation failed.
The legacy sfdx command also fails:
sfdx force:source:push -f -u scr
SCV_Outbound_Call (Action) - The action type "SCV Outbound Call" can't be used in flows with the process type "Autolaunched Flow".
Can this only be deployed with say a changeset?

I have the approval process active in background and i am trying to schedule this on every monday at 10 am. below are the code How can i get resolved this issue?

global class TimecardApprovalBatch implements Database.Batchable<sObject> {

    global Database.QueryLocator start(Database.BatchableContext bc) {
        // Query all Approval records that need to be approved
        return Database.getQueryLocator([
            SELECT Id, ProcessInstanceId, ProcessInstance.TargetObjectId
            FROM ProcessInstanceWorkitem
            WHERE ProcessInstance.Status = 'Pending'
            AND ProcessInstance.TargetObject.Type = 'pse__Timecard_Header__c'
            AND DAY_ONLY(CreatedDate) >= TODAY
        ]);
    }

    global void execute(Database.BatchableContext bc, List<ProcessInstanceWorkitem> scope) {
        // Approve each Approval record in the scope
        List<ProcessInstanceWorkitem> workitemsToApprove = new List<ProcessInstanceWorkitem>();

        for (ProcessInstanceWorkitem workitem : scope) {
            workitem.ProcessInstance.Status = 'Approved';
            workitemsToApprove.add(workitem);
        }

        // Update the Approval records
        update workitemsToApprove;
    }

    global void finish(Database.BatchableContext bc) {
        System.debug('TimecardApprovalBatch finished.');
    }
}

i want to create a task after 1 day of data entry create din a object. task to assign to user A.
how it can be done in pocess builder