• Jerome Almejas 33
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
I am new in creating test class for Flow. Please help me create a test class for my record triggered flow.
Process: There should be a contact and a contact should have a Machine Registration object (lookup to Contact) and Machine Registration Object has a Master-Detail relationship with Warranty Object.

Object: Warranty
A record is created
Formula Evaluates to True (New)
      {!$User.CSS_Disableworkflows__c} = false
Fast Field Updates
User-added image

 Decision 1:
User-added imageFormula Resource:
Boolean
Warrantytypeandnowarrantyalready Formula:
AND(
$User.CSS_Disableworkflows__c = false,
OR(
{!$Record.CSS_WarrantyType__r.CSS_WarrantyCode__c} ={!$Label.CSS_ThirdPartyWarranty},
{!$Record.CSS_WarrantyType__r.CSS_WarrantyCode__c} ={!$Label.CSS_ExchangeWarranty}, 
AND(
{!$Record.CSS_WarrantyType__r.CSS_WarrantyCode__c} ={!$Label.CSS_GoodwillWarranty},
(ISBLANK({!$Record.CSS_MachineRegistration__r.CSS_WarrantyEndDate__c} ) ) 
)
)
)

Decision 1 => Update Record
User-added image
Decision 2:
User-added imageFormula Resource:
Boolean
WarrantytypeandWarrantylalreadypresentcheck Formula:
AND(
$User.CSS_Disableworkflows__c = false,
AND(
{!$Record.CSS_WarrantyType__r.CSS_WarrantyCode__c} ={!$Label.CSS_GoodwillWarranty},
NOT(ISBLANK({!$Record.CSS_MachineRegistration__r.CSS_WarrantyEndDate__c} ) ) 
)
)

Decision 2 => Update Record
CSS_StartDate_C = Machine_Registration_r.Warranty_EndDate_c
User-added image
Can you please help me create test class for this code below?

public class CSS_NavigateReturnsPortal {
   
    @AuraEnabled
    public static String getURL(Id orderID) {
        Order tempOrder = [SELECT OrderNumber, CSS_Contact__r.Email FROM Order WHERE Id = :orderId];
        String strURL = '{"order_number":"' + tempOrder.OrderNumber + '","email":"' + tempOrder.CSS_Contact__r.Email + '"}';
        Blob tempBlob = Blob.valueOf(strURL);
        return EncodingUtil.base64Encode(tempBlob);
    }
   
}
I need help passing values from Salesforce to a custom button with external URL using Base64 encode.

I need to pass Order number and Email, this should be the format in Base64 encode {"order_number":"#1103","email":"d.zhang@aftership.com"}. However, this is for a specific order number and email. I want to pass value for whatever order I have so that when I click the custom button, it will pass the values of that Order. 

I tried this format: {"order_number":"CSS_OrderNumber__c","email":"CSS_Email__c"} but this is returning this:User-added image
CSS_OrderNumber__c is my order number field Salesforce.
CSS_Email__c is my emai field in Salesforce.

my link is: https://salesdemo.returnscenter.com/?qs=

Thank you!
 
I have these addresses Inbound, Outbound, and Billing Information. Inbound is the current address: set default billing, set default shipping address. I want that if I go to Outbound shipping and click the "Edit Address" and tick "Make Default" checkbox, the amended Address should show in the Addresses list view and the "Default Shipping" is ticket on the list view BUT this is not working. Same with Billing Information, if I click "New Address" and check the "Make Default," the new address should be added in the Addresses list view and the Default Billing should be ticked BUT this is also not working. What is happening now is that the current address that was set to default billing, default shipping is still the one having the tick in default shipping and default billing even if there is an amended address and new default billing.
User-added image
User-added image
Here is my code in AURA:
Cmp:
User-added image
Controller:
User-added image
Helper:User-added image
I am new in creating test class for Flow. Please help me create a test class for my record triggered flow.
Process: There should be a contact and a contact should have a Machine Registration object (lookup to Contact) and Machine Registration Object has a Master-Detail relationship with Warranty Object.

Object: Warranty
A record is created
Formula Evaluates to True (New)
      {!$User.CSS_Disableworkflows__c} = false
Fast Field Updates
User-added image

 Decision 1:
User-added imageFormula Resource:
Boolean
Warrantytypeandnowarrantyalready Formula:
AND(
$User.CSS_Disableworkflows__c = false,
OR(
{!$Record.CSS_WarrantyType__r.CSS_WarrantyCode__c} ={!$Label.CSS_ThirdPartyWarranty},
{!$Record.CSS_WarrantyType__r.CSS_WarrantyCode__c} ={!$Label.CSS_ExchangeWarranty}, 
AND(
{!$Record.CSS_WarrantyType__r.CSS_WarrantyCode__c} ={!$Label.CSS_GoodwillWarranty},
(ISBLANK({!$Record.CSS_MachineRegistration__r.CSS_WarrantyEndDate__c} ) ) 
)
)
)

Decision 1 => Update Record
User-added image
Decision 2:
User-added imageFormula Resource:
Boolean
WarrantytypeandWarrantylalreadypresentcheck Formula:
AND(
$User.CSS_Disableworkflows__c = false,
AND(
{!$Record.CSS_WarrantyType__r.CSS_WarrantyCode__c} ={!$Label.CSS_GoodwillWarranty},
NOT(ISBLANK({!$Record.CSS_MachineRegistration__r.CSS_WarrantyEndDate__c} ) ) 
)
)

Decision 2 => Update Record
CSS_StartDate_C = Machine_Registration_r.Warranty_EndDate_c
User-added image
I need help passing values from Salesforce to a custom button with external URL using Base64 encode.

I need to pass Order number and Email, this should be the format in Base64 encode {"order_number":"#1103","email":"d.zhang@aftership.com"}. However, this is for a specific order number and email. I want to pass value for whatever order I have so that when I click the custom button, it will pass the values of that Order. 

I tried this format: {"order_number":"CSS_OrderNumber__c","email":"CSS_Email__c"} but this is returning this:User-added image
CSS_OrderNumber__c is my order number field Salesforce.
CSS_Email__c is my emai field in Salesforce.

my link is: https://salesdemo.returnscenter.com/?qs=

Thank you!