• Francesco Bigoni
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 7
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
Hi there,

I've got a problem with the assignment of a collection size to a Number variable using the Equals Count standard function: on the Field Service mobile app, the variable becomes a Boolean insted of being a Number (the sandbox i'm working with is running release Summer '19)
Here's the steps:
1) I've created the number:
User-added image
2) Then I assigned a collection size to it:
User-added image
3) Last step, I've printed the value in a screen. The result in the desktop debugger is correct, there are 48 items in the list:
User-added image
But on the Field Service mobile app (the flow is launched as App Extension) the result is the following:
User-added image
Both flow interviews are runned with the same Admin user.
Have you experienced the same issue? If yes, have you found any workarounds without looping the collection adding + 1 to the total count?

Thank you very much for any suggestions.

Francesco
Hi all,

I am trying to create a Order record using Lightning Data Service in my custom component and i need its new ID after creation. The code of the callback after saving the record is the following:

ComponentController.js
component.find("childOrderRecordCreator").saveRecord(function(saveResult) {
                if (saveResult.state === "SUCCESS" || saveResult.state === "DRAFT") {

                     //Trying to show the id of the new created record
                     alert(saveResult.recordId)
                    
                }
                else if (saveResult.state === "INCOMPLETE") {
                    console.log("User is offline, device doesn't support drafts.");
                }
                else if (saveResult.state === "ERROR") {
                    console.log('Problem saving order, error: ' +
                                 JSON.stringify(saveResult.error));
                }
                else {
                    console.log('Unknown problem, state: ' + saveResult.state +
                                ', error: ' + JSON.stringify(saveResult.error));
                }
            });
The problem is that same code behaves differently on mobile phone and on desktop website. Using the website I get the Id:
User-added image
But on mobile i don't:
User-added image

Do you know why it does not work on mobile?

Thank You,
Francesco
Hi all,

I have some issues with lightning navigation component in Salesforce mobile app.
I've created a lightning component, called by a quick action from every Order detail page, that lets users quickly create a new record using Data Service and then redirects them to related page of Order Products for the created Order. Using desktop website, the component and the redirect after creating a new Order work, but in the mobile Salesforce app don't (I've tried on both Android and Iphone apps). In the mobile app, after creating a new Order, it shows this error message:

Looks like there's a problem.
An internal server error has occured
Error ID: 2036433709-13113
(-1257107540)


The lightning navigation is declared in the component code:
<lightning:navigation aura:id="navigationService" />
And the code for the navigation redirect in the Javascript controller is the following:
//After saving a record, redirects to Order Products page for the created Record
component.find("OrderRecordCreator").saveRecord(function(saveResult) {
       if (saveResult.state === "SUCCESS" || saveResult.state === "DRAFT") {
             
             //Redirect here does not work on mobile
             component.find("navigationService").navigate({
                type: "standard__recordRelationshipPage",
                attributes: {
                        recordId: saveResult.recordId,
                        objectApiName: "Order",
                        relationshipApiName: "OrderItems",
                        actionName: "view"
                }
            });
       }
       else if (saveResult.state === "INCOMPLETE") {
               console.log("User is offline, device doesn't support drafts.");
       }
       else if (saveResult.state === "ERROR") {
               console.log('Problem saving order, error: ' +
                            JSON.stringify(saveResult.error));
       }
       else {
               console.log('Unknown problem, state: ' + saveResult.state +
                           ', error: ' + JSON.stringify(saveResult.error));
       }
});
Thank for your patience and assistance.
Hi there,

I've got a problem with the assignment of a collection size to a Number variable using the Equals Count standard function: on the Field Service mobile app, the variable becomes a Boolean insted of being a Number (the sandbox i'm working with is running release Summer '19)
Here's the steps:
1) I've created the number:
User-added image
2) Then I assigned a collection size to it:
User-added image
3) Last step, I've printed the value in a screen. The result in the desktop debugger is correct, there are 48 items in the list:
User-added image
But on the Field Service mobile app (the flow is launched as App Extension) the result is the following:
User-added image
Both flow interviews are runned with the same Admin user.
Have you experienced the same issue? If yes, have you found any workarounds without looping the collection adding + 1 to the total count?

Thank you very much for any suggestions.

Francesco