• Kevin Yao 4
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 1
    Replies

I'm currently having some trouble deploying my code to my org. The current package I'm working on has a dependent package "BASE_PACKAGE". I was trying to use Custom Labels, the problem is if there's any overlap in the custom labels it causes issues when trying to install.

However, if I try to use the base packages custom labels, if I try to use the namespace when importing in the LWC like,

import MANUFACTURER from '@salesforce/label/BASE_PACKAGE.MANUFACTURER';

I get this error message

Error integration LWC1504: Invalid module id "BASE_PACKAGE.MANUFACTURER" for type "label". Explicit use of namespace "BASE_PACKAGE" in file "customLabels.js" is prohibited. 

When I try to replace it with 

import MANUFACTURER from '@salesforce/label/c.MANUFACTURER';
I'm able to deploy to my scratch org, but when I try to deploy the packaged code, I get this error message instead

Invalid reference c.MANUFACTURER of type label in file customLabels.js 

I'm not sure if I'm missing a setting, or if there's something I'm missing.
I'm having some issue with having a trigger run after inserting an object from a Rest API call. I've confirmed that the object is being created, and I've tested the other sections of the code manually and they are fine.

Here's my code
Sensor_Event__c event = new Sensor_Event__c();
event.JSON_Event__c = requestBody.toString();
insert event;
(I've checked and the object has the correct event with the correct string)

Here's my trigger
trigger ProcessSensorEvent on Sensor_Event__c (after insert) {
    
        for(Sensor_Event__c event : Trigger.new) {
            SensorsHandler.SensorEvent sensorEvent = new SensorsHandler.SensorEvent();
            sensorEvent = SensorsHandler.parseSensorJSON(event.JSON_Event__c);
            SensorsHandler.generateMonitorFromEvent(sensorEvent);
        }
   
}

I've tried inserting the same object from the exernal rest API in manually and the trigger code runs properly, and the object is created by the rest api without issue, but when the object is created by the REST API, the trigger doesn't run. Any help would be appreciated.
 
I'm currently working with the SOAP api to login to a separate salesforce instance. For some orgs though, it seems there's IP restrictions and it seems that it's using a different IP address (I'm assuming the source org's IP address). I have the IP address for my local network whitelisted, but it seems that the SOAP request isn't using it (instead it seems to be using my instance IP address). Is there any way I can make the SOAP request using my local network's IP address so it uses my IP address (which is white listed)?
There's a few of the SOAP functions that I want to use in apex, is there a better way then to try and load the Enterprise WSDL? The one we have is huge, and trying to manually trim it to only include the 3-4 soap api's doesn't seem to be the best method - I was wondering if there was either a easy way to grab a few specific SOAP functions, or a tool to trim the WSDL's.
I was wondering if it was possible to launch the homepage (or any specific record page) of an salesforce org, given the instance URL (ex3.my.salesforce.com) and the access token(<random token>) I'm able to edit a record, but I was wondering if it was possible to open the instance.
I was wondering if it was possible to login to different salesforce environments (Sandboxes, scratch orgs, production env, etc) using either Apex/LWC/Aura. For example, I have a list of credential records, with the username and password, and I would like to have a login button that creates a separate tab that can automatically redirect to that specific instance and login.

Currently, if a user wants to login to a particular instance, they have to either go to test.salesforce.com or login.salesforce.com (depending on if it's a sandbox or production) manually, then copy the password and username in. The ideal situation is to have a login button that can do this automatically from the record page where the username and password is located.

I've been trying to do some research and haven't been able to really find an ideal solution.
I was wondering if it was possible to login to different salesforce environments (Sandboxes, scratch orgs, production env, etc) using either Apex/LWC/Aura. For example, I have a list of credential records, with the username and password, and I would like to have a login button that creates a separate tab that can automatically redirect to that specific instance and login.

Currently, if a user wants to login to a particular instance, they have to either go to test.salesforce.com or login.salesforce.com (depending on if it's a sandbox or production) manually, then copy the password and username in. The ideal situation is to have a login button that can do this automatically from the record page where the username and password is located.

I've been trying to do some research and haven't been able to really find an ideal solution.