• scott_dev
  • NEWBIE
  • 30 Points
  • Member since 2015
  • Engineer

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies
Could you please let me/us know what Laptop/Operating System would you prefer working with or recommend (for a Salesforce Developer working with Apex, VF and Lightning -- and SFDX on VSC):
  • Windows?
  • Mac?
Why? (Please, with your answer, let me know why)

(I am looking for getting a brand new Laptop during 1st Quarter thank you 2020).

Thank you very much.

Kind regards.
  • January 14, 2020
  • Like
  • 0

Hello, I have created a the very first messageChannel in our repo under the folder "messageChannels" and have created the xml file "Test_Sample.messageChannel-meta.xml" and deployed it successfully to a sandbox org. If I then import that messageChannel into my LWC:

import TestSampleMsgChannel from '@salesforce/messageChannel/Test_Sample__c';


when I try to deploy the LWC from IntelliJ (Illuminated Cloud), I get this error:

Error:(1, 1) FIELD_INTEGRITY_EXCEPTION - org.auraframework.throwable.AuraRuntimeException: Unable to retrieve metadata for descriptor: markup://c:__LightningMessageChannel__Test_Sample__c: Source

Is someone able to assist me in understanding why I'm seeing this issue?
Hello, this question is related to LWC development. I have recently discovered (through many hours of frustration and troubleshooting) that when using an @wire for an apex method that the callback function is not executed if:
  • the @wire is triggered by a refreshApex() call
  • the serverside data has not changed
In all other scenarios the callback function will execute. 
Is this by design, or is this a bug?  The documentation does not mention anything about the data needing to change for the callback function to execute when using refreshApex(): https://developer.salesforce.com/docs/component-library/documentation/en/48.0/lwc/lwc.apex

We have a bash script that creates a scratch org, installs our base package, and then imports some sample data. For the importing of sample data, this script uses sfdx to run some Apex that inserts an Account and two custom objects that look up to that Account. 

We had been using this script for about a year, when suddenly about a month ago we started getting the error:  CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, record type missing for: Account: []

I discovered that the Default Record Type for Account was not set even though there were two record types available to the System Admin profile. If I set the Default Record Type in the that profile, and then rerun my script the error is resolved and the data imports successfully (although I needed to do the same for the two custom objects).

We don't include profiles in our package and only use permission sets, so I don't understand what could have changed and how to resolve this issue. The only workaround I have found so far is to query for the specific record types to get their ids and then set the RecordTypeId when inserting the Account and the two other custom objects. It is not a clean workaround because of a DataFactory class we use to create objects, so I'm looking for the root cause in hopes to understand why this started occuring and what I can do to fix the issue.

Any insight/assistance would be appreciated!

I'm trying to receive a message from a validation rule when a custom object record is saved - and then display it in a toast message. The message I am receiving when the validation fails is much more than just the validation message. For example:

User-added image

The validation message is buried in there, but I can't seem to isolate it, and always get everything else with it. I receive the above error when setting the validation rule on a secondary object that is updated by the trigger of the primary object.

In contrast, if I only set the validation rule on the primary object I receive this error that is much nicer and only contains the validation message:

User-added image

I'm wondering if the error message coming back contains all that extra information because it is being called via a trigger? Regardless, I need to understand how to only return the message from the validation rule, without the whole stacktrace and such.

Here is the code in my js controller:

setStageActive: function(component, event) {
    var action = component.get("c.updateStageAsActive");
    action.setCallback(this, function(response) {
      var state = response.getState();

      if (component.isValid() && state === "SUCCESS") {
        // Do everything we want when successful
          this.showToast("success", "dismissible", null, "Stage changed successfully.");
        }
      } else {
        var errors = response.getError();
        var title = "Some errors were encountered when trying to update the Stage";
        var message = "Unknown error."; // Default error message

        if (errors && errors[0].message) {
          message = errors[0].message;
        }
        this.showToast("error", "sticky", title, message);
      }
    });
    $A.enqueueAction(action);
  }
updateStageAsActive method in my Apex controller
  @AuraEnabled
  public static List<Matter_Stage_Activity__c> updateStageAsActive() {
      List<Matter_Stage_Activity__c> matterStageActivityList;

      try {
        matterStageActivityList = matterStageActivityHandler.updateStageAsActive();
      } catch (DmlException e) {
        throw new AuraHandledException(e.getDmlMessage(0));
      } catch (Exception e) {
        throw new AuraHandledException(e.getMessage());
      }
      return matterStageActivityList;
    }
  }
methodCalledByTriggerOfPrimaryObject on save of the primary custom object
private void methodCalledByTriggerOfPrimaryObject () {
   	
    // Code to build secondaryObjectsToUpdate

    try {
	   update secondaryObjectsToUpdate;
	} catch (DmlException e) {
       MyException ex = new MyException(e.getDmlMessage(0));
	   throw ex;
	}
}


 
We have a important partner that is blocked from go-live with our software package due to a bug. I've corrected the bug and uploaded a new package based on our latest production release version (plus the fix) via our packing org. The problem is we are in the middle of doing internal beta release versions for our next major release and I'm not understanding how to create a patch that doesn't include our beta code. Has anyone been in a similar scenario that could offer some advice?
Hopefully this is an easy answer for someone. I'm reading through the following documentation (https://help.salesforce.com/articleView?id=sfdx_dev_reg_namespace.htm&type=0) and I need to understand the context of the following:
  • Developer Edition org
  • Dev Hub org
The first line reads "To use a namespace with a scratch org, you must link the Developer Edition org where the namespace is registered to a Dev Hub org."

I need to use a namespace with my scratch org. We already have a Dev Hub enabled in our production org with a custom namespace. Is the "Developer Edition org where the namespace is registered" our production Dev Hub org? Or is that talking about my scratch org? Or some other org?

The reason I'm asking this question is because I had to create a new Dev Hub org for Summer18 preview, and I've created a scratch org from it, but I can't push my code base to the scratch org because the namespace is not recognized. So I'm thinking I need to link our namespace for my Summer18 Dev Hub org by clicking on "Link Namespace" button and login to our production Dev Hub org? And if that works, finally I will need to spin up a new scratch org based on Summer18 Dev Hub, that should then know about our namespace?

I've been working on this for two full days now, an help would be much appreciated. Thanks!

I'm working on several issues that appeared in our org with the introduction of the Summer 18 preview. We are using SFDX and scratch orgs for development. I've figured out how to create a scratch org that is on Summer 18, but it required that I create a Enterprise trial org with Summer 18 and set it up as a Dev Hub. So I've done all that and created a scratch org successfully, but I'm having difficulty pushing our code base to it. The long list of error messages seem indicate that it doesn't know that any of our custom objects and fields exist. I'm suspecting that it has something to do with the name space not being different from our code base and the scratch org I'm pushing to? I've found the following article that I believe says I need to link the name space from our current Dev Hub, to the new Dev Hub I've created for Summer18.  
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_reg_namespace.htm

Am I reading that I can create a name space link from one Dev Hub to another or can a name space/Dev Hub only be one-to-one? It seems I need to find some way to push my code base with our current name space to a scratch org based off of the new Dev Hub that is on the Summer 18 preview. 

Any advice or experience is welcome, thanks.

We have a bash script that creates a scratch org, installs our base package, and then imports some sample data. For the importing of sample data, this script uses sfdx to run some Apex that inserts an Account and two custom objects that look up to that Account. 

We had been using this script for about a year, when suddenly about a month ago we started getting the error:  CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, record type missing for: Account: []

I discovered that the Default Record Type for Account was not set even though there were two record types available to the System Admin profile. If I set the Default Record Type in the that profile, and then rerun my script the error is resolved and the data imports successfully (although I needed to do the same for the two custom objects).

We don't include profiles in our package and only use permission sets, so I don't understand what could have changed and how to resolve this issue. The only workaround I have found so far is to query for the specific record types to get their ids and then set the RecordTypeId when inserting the Account and the two other custom objects. It is not a clean workaround because of a DataFactory class we use to create objects, so I'm looking for the root cause in hopes to understand why this started occuring and what I can do to fix the issue.

Any insight/assistance would be appreciated!

Could you please let me/us know what Laptop/Operating System would you prefer working with or recommend (for a Salesforce Developer working with Apex, VF and Lightning -- and SFDX on VSC):
  • Windows?
  • Mac?
Why? (Please, with your answer, let me know why)

(I am looking for getting a brand new Laptop during 1st Quarter thank you 2020).

Thank you very much.

Kind regards.
  • January 14, 2020
  • Like
  • 0
Hopefully this is an easy answer for someone. I'm reading through the following documentation (https://help.salesforce.com/articleView?id=sfdx_dev_reg_namespace.htm&type=0) and I need to understand the context of the following:
  • Developer Edition org
  • Dev Hub org
The first line reads "To use a namespace with a scratch org, you must link the Developer Edition org where the namespace is registered to a Dev Hub org."

I need to use a namespace with my scratch org. We already have a Dev Hub enabled in our production org with a custom namespace. Is the "Developer Edition org where the namespace is registered" our production Dev Hub org? Or is that talking about my scratch org? Or some other org?

The reason I'm asking this question is because I had to create a new Dev Hub org for Summer18 preview, and I've created a scratch org from it, but I can't push my code base to the scratch org because the namespace is not recognized. So I'm thinking I need to link our namespace for my Summer18 Dev Hub org by clicking on "Link Namespace" button and login to our production Dev Hub org? And if that works, finally I will need to spin up a new scratch org based on Summer18 Dev Hub, that should then know about our namespace?

I've been working on this for two full days now, an help would be much appreciated. Thanks!