• Kshitij Lawate
  • NEWBIE
  • 5 Points
  • Member since 2015
  • Salesforce Developer


  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 10
    Replies
I have a (probably very) basic question about @track decorator.

I modified the helloExpressions LW Component from Sample Gallery as below. Here the values FirstName and lastName are no longer decorated as Tracked properties. I am adding their concatenated value to another tracked property capitalFullName.
I do not have the contributing factors for 'uppercasedFullName' tracked, still this updates the UI for both output values uppercasedFullName and capitalFullName when firstname or lastname are updated from input screen. However if I remove track decorator for capitalFullName, the UI refresh stops working. If I am not tracking the direct contributors uppercasedFullName, why does it still work when I am using them somewhere else with a tracked property?

You can fine original question with code snippet here:
https://salesforce.stackexchange.com/questions/287519/basic-question-about-track-decorator
We have a trigger on an object which as per the debug logs seems to be taking more than 1.5 seconds to execute. When observed the timestamp in debug logs, there was something unusual. Please find screenshot below. 
The highlighted line indicates completion of code execution for trigger. The time in brackets is in nanoseconds which comes out to be 0.4 seconds. 
But the line, just after that, modifies the timestamp and updates the same by adding 1 second to the time. Any idea, what is the extra processing happening here? 

User-added image
We have a trigger on object AgentWork. We are trying create a test class for the same. While inserting test data, we get below error. 


System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, The agent's status is not associated with the channel for this work.: [ServiceChannelId]

Any inputs? Thanks. 
We have a requirement where we need to connect to salesforce from an intranet website with code written in JavaScript. We have the ConnectedApp created in Salesforce and we are following Username-Password OAuth2 flow. We are passing all the required parameters given below. We are POSTing this to the request URL given below.

var requestUrl = 'https://login.salesforce.com/services/oauth2/token';
requestUrl += '?username=USERNAME&password=PASSWORD_SECURITY_TOKEN&grant_type=password&client_id=CLIENT_ID_FROM_CONNECTED_APP&client_secret=AGAIN_FROM_CONNECTED_APP;
We tried connecting using JQuery AJAX call and JSforce libraries. We have also whitelisted the required domain in Salesforce via Setup --> Security Controls --> CORS.

We tried connecting to salesforce via the intranet site as well as another salesforce org using the same code. for both of the situations we are getting below error. 

User-added image

In case if image does not load 
 
XMLHttpRequest cannot load https://login.salesforce.com/services/oauth2/token. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://lightningcheck-dev-ed--c.ap2.visual.force.com' is therefore not allowed access.

The origin is there in the Request Header as checked in Browser Console, however, the 'Access-Control-Allow-Origin' parameter is not there in response header from Salesforce.

Am I missing any setting here or it is not something Salesforce currently supports? Any help appreciated, thanks.
 
We have a requirement where we need to connect to salesforce from an intranet website with code written in JavaScript. We have the ConnectedApp created in Salesforce and we are following Username-Password OAuth2 flow. We are passing all the required parameters given below. We are POSTing this to the request URL given below.

var requestUrl = 'https://login.salesforce.com/services/oauth2/token';
requestUrl += '?username=USERNAME&password=PASSWORD_SECURITY_TOKEN&grant_type=password&client_id=CLIENT_ID_FROM_CONNECTED_APP&client_secret=AGAIN_FROM_CONNECTED_APP;
We tried connecting using JQuery AJAX call and JSforce libraries. We have also whitelisted the required domain in Salesforce via Setup --> Security Controls --> CORS.

We tried connecting to salesforce via the intranet site as well as another salesforce org using the same code. for both of the situations we are getting below error. 

User-added image

In case if image does not load 
 
XMLHttpRequest cannot load https://login.salesforce.com/services/oauth2/token. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://lightningcheck-dev-ed--c.ap2.visual.force.com' is therefore not allowed access.

The origin is there in the Request Header as checked in Browser Console, however, the 'Access-Control-Allow-Origin' parameter is not there in response header from Salesforce.

Am I missing any setting here or it is not something Salesforce currently supports? Any help appreciated, thanks.
 
I have a (probably very) basic question about @track decorator.

I modified the helloExpressions LW Component from Sample Gallery as below. Here the values FirstName and lastName are no longer decorated as Tracked properties. I am adding their concatenated value to another tracked property capitalFullName.
I do not have the contributing factors for 'uppercasedFullName' tracked, still this updates the UI for both output values uppercasedFullName and capitalFullName when firstname or lastname are updated from input screen. However if I remove track decorator for capitalFullName, the UI refresh stops working. If I am not tracking the direct contributors uppercasedFullName, why does it still work when I am using them somewhere else with a tracked property?

You can fine original question with code snippet here:
https://salesforce.stackexchange.com/questions/287519/basic-question-about-track-decorator
We have a trigger on object AgentWork. We are trying create a test class for the same. While inserting test data, we get below error. 


System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, The agent's status is not associated with the channel for this work.: [ServiceChannelId]

Any inputs? Thanks. 
We have a requirement where we need to connect to salesforce from an intranet website with code written in JavaScript. We have the ConnectedApp created in Salesforce and we are following Username-Password OAuth2 flow. We are passing all the required parameters given below. We are POSTing this to the request URL given below.

var requestUrl = 'https://login.salesforce.com/services/oauth2/token';
requestUrl += '?username=USERNAME&password=PASSWORD_SECURITY_TOKEN&grant_type=password&client_id=CLIENT_ID_FROM_CONNECTED_APP&client_secret=AGAIN_FROM_CONNECTED_APP;
We tried connecting using JQuery AJAX call and JSforce libraries. We have also whitelisted the required domain in Salesforce via Setup --> Security Controls --> CORS.

We tried connecting to salesforce via the intranet site as well as another salesforce org using the same code. for both of the situations we are getting below error. 

User-added image

In case if image does not load 
 
XMLHttpRequest cannot load https://login.salesforce.com/services/oauth2/token. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://lightningcheck-dev-ed--c.ap2.visual.force.com' is therefore not allowed access.

The origin is there in the Request Header as checked in Browser Console, however, the 'Access-Control-Allow-Origin' parameter is not there in response header from Salesforce.

Am I missing any setting here or it is not something Salesforce currently supports? Any help appreciated, thanks.