• Victor Lockwood
  • NEWBIE
  • 5 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hello - I have a LWC with a RecordEditForm and want to set the value of a custom field to today's date upon submit, but can't get the right formatting in the Javascript submit handler. Everything I've tried gives me an invalid date format error. Can someone clue me in on the right format to use? Thanks!
 
handlesubmit(event){
        event.preventDefault();  
        console.log('handle submit');
        const fields = event.detail.fields;
        fields.Travel_Dates_Sent_to_PS__c = false;
        if (this.updatetype=="cancel"){
            let dt = Date.now();
            fields.Travel_End_Date__c=dt;
        }
        this.template.querySelector('lightning-record-edit-form').submit(fields);
    }

 
I properly installed CLI. In a command window, I enter:

sfdx force:auth:web:login -d -a DevHub

in order to log in to the trial Dev Hub that I created. The aforementioned command opens the Salesforce login page in the web browser, so I log in using my Developer Hub Trial Org credentials and click Allow. After that, web browser show me an error: "This site can't be reached. localhost took too long to respond".

This is the URL that Salesforce use after I authenticate in the browser: http://localhost:1717/OauthRedirect?code=aPrxbOND3gL_2LbSR7rKPdvD0XBVk2YpErl3pphY2f3xvZ1wf5SSPJByDleRLPMtzCQWnNGAdg%3D%3D&state=f2f8254fac23

I don't know what happen.

User-added image

User-added image

User-added image
Hello community

I'm struggling with a small error which I can't seem to find an answer to. Can you help?

[{"message":"bad value for restricted picklist field: Bristol","errorCode":"INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST","fields":["RM_Region__c"]}]

There are scores of picklist values within "RM_Region__c". For some reason, "Bristol" is being rejected.

The closest I can get to a possible answer is that "Bristol" needs to be allocated somewhere for it to work?

I'd really appreciate any ideas the community have.

Many thanks and look forward to hearing from you.
Running into a strange issue -- I have developed several lightning components that are displayed in Lightning App Builder. I added a second one that has all the same "implements=" as the other ones, but for some reason is not showing as an option in App Builder. Given the fact that other components are showing up - any ideas/thoughts on things to check? Here is my aura:component line:
 
<aura:component controller="SecureSiteController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">

 
I am using standard sitelogincontroller class 
**
 * An apex page controller that exposes the site login functionality
 */
global with sharing class SiteLoginController {
    global String username {get; set;}
    global String password {get; set;}

    global PageReference login() {
        String startUrl = System.currentPageReference().getParameters().get('startURL');
        return Site.login(username, password, startUrl);
    }
    
     global SiteLoginController () {}
}
Every time i login it redirect me to site home page. but i want to redirect on the very same page not on site home page.
I have tried using  startulr=apexpages.currentpage(),geturl() but  this didn't work.

Need help 
Urgent
Thanks