• Stefaan Somers 11
  • NEWBIE
  • 25 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 8
    Replies
Hi Salesforce Community,
I'm working on a lightning flow that's scheduled to run and perform specific tasks. The flow's main objective is to retrieve records with a certain status and loop through these records to make an HTTP callout.

Here's a brief overview of the process:
  • The flow assigns values to a custom instance 'body' of the type ExternalService apex class ExternalService__SendReminder_SendReminders_IN_body which is generated by Salesforce.
  • The primary task is to make an HTTP callout using these values.
Issue Encountered:
I'm consistently hitting an APEX CPU timeout limit. To address this, I've considered creating a platform event where I can publish an event with the JSON value of the 'body' variable. However, this isn't directly feasible in the flow, leading me to consider developing an invocable Apex class.

Here's the draft of the class I'm contemplating:
 
public class JsonUtility {

    public class RequestWrapper {
        @InvocableVariable
        public ExternalService.xxxx  myVariable;
    }

    @InvocableMethod
    public static List<String> serializeToJson(List<RequestWrapper> requests) {
        List<String> jsonStrings = new List<String>();

        for (RequestWrapper req : requests) {
            jsonStrings.add(JSON.serialize(req.myVariable));
        }

        return jsonStrings;
    }
}

Challenge:
I'm unable to locate the class ExternalService__SendReminder_SendReminders_IN_body in the IDE, which Salesforce generates. However, it is visible in the Dynamic class of Apex classes overview in Setup.

I'd greatly appreciate any insights or advice on the following:
  • How to effectively resolve the APEX CPU timeout issue in this scenario?
  • Why the generated class is not visible in the IDE and how to access it for development purposes?
Any help or pointers in the right direction would be immensely valuable.
Thanks in advance for your assistance!
I'm using DevOps. When deploying a workitem to Acceptance, I got the following message : 
10:15:45
Stefaan Somers
Rebase of WI-000126 branch from Production branch failed
What Happened
As part of the promotion, we attempted to rebase the work item feature branch from the target stage branch to ensure that promotions to downstream stages are successful. This rebase operation failed.
What can you do about it?
If there are other work items in the source stage, try to promote these first because the failure might be due to a missing dependency.

Problem : 
I cannot publish it into production
When making a new workitem, I don't have the possibility to select those changed files anymore
 
I have a visualforce page that uses a tag from a packaged component:
<cxsrec:getMapValue map="{!candidateFieldMap}" key="Specialty__c"/>

I want to do something that 
If Specialty = 'Test1' then show 
<div> Test 1 </div>
If  Specialty = 'Test2' then show
<div> Test 2 </div>

I can try to obtain the value maybe through jquery or something, but how can I reuse this variable then afterwards in my visualforce page.
 
When we create a sandbox we have several WorkFlowOutbound message-setting from which the url needs to be changed.
As a manual process this is hard work, so I tried with Salesforce DX to retrieve this with the following command :
sfdx force:source:retrieve --metadata WorkflowOutboundMessage

But I don't receive any result. 
I also already tried with Illuminated Cloud which shows the info when indicating which meta-data to retrieve, but in the end it is not retrieved at all
Hi,

I've a jobs that updates different records.
A process builder invokes an apex-method that for every record calls a future method.

This future-method will do a webservice call to login to obtain a security key, and next will do the actual webservice-call to update info in the external system.

Can I share the secret key in a certain way for a dedicated period, so I don't need to login every time....
For Batchable classes you can extend it with Database.RaisesPlatformEvents so BatchApexErrorEvent is raised in case of errors.

Can we do something similar for Queueable or Scheduled classes. I tried to create BatchApexErrorEvent itself but apparently field Message is not writable....
I'm currently implementing the creation of test-data through the loading of csv-data

For 1 object I do 3 test-loads :
- load A
- load B
- load C

I need to do this because there are several relations between the objects.

If I do the 3 loads I get the error : Validation Errors While Saving Record(s)
But it doesn't give me any details what may be causing this

But the strange thing is the following scenario do work :
- load A, load B
- load A, load C

Also running these tests take a lot of time..

I get more and more the impression that loading data from csv is not really an option, if you have many relations between objects
Hi,

I've got a use case we want to create events from a custom Object for planning purposes. 
We want to create a calendar-view on a record-page that shows the planning for that specific record then, and from which you can also create a new entry...
Cannot read property 'gid' of undefined
Since a few weeks we have the following error in our quick action

Error while creating component for lightning component quick action [Action failed: one:dockingPanelManager$controller$onNotify [Cannot read property 'gid' of undefined]]

The only thing I do in this quick action is :
openURL : function(component, event, helper) { let url = ''; if(component.get("v.recordId").includes('a09')){ url = "https://xxx/idToUpdate="+component.get("v.recordId"); url = "https://xxx"+component.get("v.recordId"); }else{ url = "https://xxxx"; } var urlEvent = $A.get("e.force:navigateToURL"); urlEvent.setParams({ "url": url }); urlEvent.fire(); var dismissActionPanel = $A.get("e.force:closeQuickAction"); dismissActionPanel.fire(); }

 
I have a Lightning component with the following property
@track disabled = false;

I now also have the following code :
let allInputFields = this.template.querySelectorAll('lightning-input'); allInputFields.forEach(function(input){ input.addEventListener('focus', function(event) { this.value=''; this.className = 'input-focus'; //this.disabled=true; },false);

When I execute the code in bold, it's not acting on the @track property. How can I do this?
Today is 03/05/2021.

When I execute the following code, it returns week 19 instead of week 18
System.debug('Weeknumber : ' + System.now().format('w'));

Any idea on how I can resolve this?
Hi,

can someone tell me if you configure an outbound message, if this also counts as an async apex call in the limits?
I have a scheduled flow that will try to update the status from records once they are expired. So I is an Assignment and Update element for this. But certain records cause validation errors. But once you got a validation error it will not process the other records.

How can this be solved?
Hi, today I created a new field. At a certain time I changed the API-name with worked without any problem.

When I now try to save the object, I always receive the error 'Invalid field' but with an API-name, that in my opinion doesn't exist. If I go through the list of fields I don't find this back. I have no clue anymore on how to resolve this issue.
In Classic you can hover over a calendar entry, and from there directly remove the calendar entry.

In Lightning on first side you need to open the event first before you can delete it. These are a few clicks more. Is there a way to remove the calendar entry directly?
In classic when you used a 'New' button on a related list, you went to the creation-page and after saving you saw the details of the created record.

In Lightning if you create a new one, you get a modal window to fill in the details. After saving your return to the details of the record with the related list.

Is there a way on obtain the same functionality as before in Classic, this means you go the newly created record
I have a Visualforce-page as a Utility item on an app.
This works fine, but when I try to deploy it through a change-set to another org, I receive the following message : 
Component [flexipage:visualforcePage] attribute [pageName]: Visualforce page [XXX] not available for use on mobile devices

Any idea what may be causing this??

 
In the classic version I have the following scenario : 
- External service that reads electronic id
- This services does a POST of data to url of Visualforce page
- Controller returns object url or null to show more info 

I'm now trying to migrate this to Lightning. It works if I use the same url, but it opens up in Classic.

Any ideas what url I need to use to be able to POST to controller and show my result in Lightning
I have a lwc-component 'CreateAttachment' created that will create a child record 'Attachment' to the detail record. On my page I also have a related-list component, that shows these child-records 'Attachments'

I want the behaviour that when I create a child record 'Attachment' with my component 'CreateAttachment', that automatically the component Related List 'Attachments" is updated. Unfortunateley this is not happening. Any best practices on how this can be accomplished
I have an aura-component defined with a doInit event.
<aura:component description="DocumillDocuments"implements="forceCommunity:availableForAllPageTypes" access="global"controller="DocumillHelper">
    <aura:attribute name="objectType" type="String"/>
    <aura:attribute name="listDocuments" type="Documill_Template__mdt[]"/>
 
   <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
        <!-- PAGE HEADER -->
        <lightning:layout class="slds-page-header slds-page-header--object-home">
            <lightning:layoutItem>
                <lightning:icon iconName="standard:scan_card" alternativeText="My Expenses"/>
            </lightning:layoutItem>
            <lightning:layoutItem padding="horizontal-small">
                <div class="page-section page-header">
                    <h1 class="slds-text-heading--label">Documill</h1>
                    <h2 class="slds-text-heading--medium">Documents</h2>
                </div>
            </lightning:layoutItem>
        </lightning:layout>
        <!-- / PAGE HEADER -->
        <!-- LIST DOCS -->
        <lightning:layout>
            <lightning:layoutItem padding="around-small" size="6">
                <aura:iteration var="doc" items="{!v.listDocuments}" >
                    <p>{!doc.name}</p>
                </aura:iteration>
            </lightning:layoutItem>
        </lightning:layout>
        <!-- / LIST DOCS  -->
 
</aura:component>
Here is the code of my Visualforce page 
<apex:page id="DocumillDocuments" sidebar="false" showHeader="false"standardStylesheets="false">
    <apex:includeLightning />
    <div id="DocumillDocumentsDiv"></div>
    <script>

        $Lightning.use("c:DocumillApp", function() {
            $Lightning.createComponent("c:DocumillDocuments",
                    {},
                    "DocumillDocumentsDiv",
                    function(cmp) {
                        console.log('>>>>> App is hosted');
                    });
        });
    </script>
</apex:page>

As soon as the line hereunder is included within the component, I get this error.
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

If I remove this line, the component shows correctly in the Visualforce page.

In my handler I don't have any real logic yet
({
doInit : function(component, event, helper) { // component, event, helper are parameter of doinit function
console.log('Init event is being triggered')
/* var action= component.get('c.getDocuments'); // Calling apex method
action.setCallback(this,function(response) // getting response back from apex method
{
var state=response.getState(); // getting the state
if(state==='SUCCESS')
{
component.set('v.listDocuments',response.getReturnValue()); // setting the value in attribute
}
});
$A.enqueueAction(action);*/
 
}
})

When I open the visualforce page, I get  the following error : 
aura_proddebug.js:43717 Uncaught (in promise) TypeError: Cannot set property 'innerHTML' of null
    at AuraInstance.message (aura_proddebug.js:43717)
    at AuraInstance.handleError (aura_proddebug.js:43632)
    at AuraInstance.$reportError$ (aura_proddebug.js:43693)
    at reportError (aura_proddebug.js:43429) 
I'm using DevOps. When deploying a workitem to Acceptance, I got the following message : 
10:15:45
Stefaan Somers
Rebase of WI-000126 branch from Production branch failed
What Happened
As part of the promotion, we attempted to rebase the work item feature branch from the target stage branch to ensure that promotions to downstream stages are successful. This rebase operation failed.
What can you do about it?
If there are other work items in the source stage, try to promote these first because the failure might be due to a missing dependency.

Problem : 
I cannot publish it into production
When making a new workitem, I don't have the possibility to select those changed files anymore
 
When we create a sandbox we have several WorkFlowOutbound message-setting from which the url needs to be changed.
As a manual process this is hard work, so I tried with Salesforce DX to retrieve this with the following command :
sfdx force:source:retrieve --metadata WorkflowOutboundMessage

But I don't receive any result. 
I also already tried with Illuminated Cloud which shows the info when indicating which meta-data to retrieve, but in the end it is not retrieved at all
I'm currently implementing the creation of test-data through the loading of csv-data

For 1 object I do 3 test-loads :
- load A
- load B
- load C

I need to do this because there are several relations between the objects.

If I do the 3 loads I get the error : Validation Errors While Saving Record(s)
But it doesn't give me any details what may be causing this

But the strange thing is the following scenario do work :
- load A, load B
- load A, load C

Also running these tests take a lot of time..

I get more and more the impression that loading data from csv is not really an option, if you have many relations between objects
Cannot read property 'gid' of undefined
Since a few weeks we have the following error in our quick action

Error while creating component for lightning component quick action [Action failed: one:dockingPanelManager$controller$onNotify [Cannot read property 'gid' of undefined]]

The only thing I do in this quick action is :
openURL : function(component, event, helper) { let url = ''; if(component.get("v.recordId").includes('a09')){ url = "https://xxx/idToUpdate="+component.get("v.recordId"); url = "https://xxx"+component.get("v.recordId"); }else{ url = "https://xxxx"; } var urlEvent = $A.get("e.force:navigateToURL"); urlEvent.setParams({ "url": url }); urlEvent.fire(); var dismissActionPanel = $A.get("e.force:closeQuickAction"); dismissActionPanel.fire(); }

 
Today is 03/05/2021.

When I execute the following code, it returns week 19 instead of week 18
System.debug('Weeknumber : ' + System.now().format('w'));

Any idea on how I can resolve this?
Hi,

can someone tell me if you configure an outbound message, if this also counts as an async apex call in the limits?
Hi, today I created a new field. At a certain time I changed the API-name with worked without any problem.

When I now try to save the object, I always receive the error 'Invalid field' but with an API-name, that in my opinion doesn't exist. If I go through the list of fields I don't find this back. I have no clue anymore on how to resolve this issue.