• Jay Mandal
  • NEWBIE
  • 5 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hello everyone,
I am sending json from lwc to controller without extra attribute in Account and contact object, in apex controller I want to parse it back to Account and Contact object by removing extra attribute in json.
Below is the json and class I am calling with same json. But it is giving error for extra attribute in JSON, can anyone help how we can parse back to Account and contact safely.

String json={
"account":{
Applied_Autocharges__c: 0
Name:"Test Account"
CLM_Value__c: 0
Id: "a0F6s000001MozYEAS"
Is_Estimated__c: false
Reason_Code__c: "11-Product Rejected & Reconsigned"
isEdit: true
isAllowed: true
priceReadOnly: false
productId: "a056s0000018MjrAAE"
},
"contact"{
LastName="Teast Contact"
Id: "a0F6s000001MozYEAS"
Is_Estimated__c: false
Reason_Code__c: "11-Product Rejected & Reconsigned"
isEdit: true
isAllowed: true
priceReadOnly: false
productId: "a056s0000018MjrAAE"
},


}

@AuraEnabled 
public stativc void updaeData(String json){
DataWrapper data=(DataWrapper)JSON.desearilize(json,DataWrapper.class);

}
Public class DataWrapper(){
public Account account;
public Contact contact;
}

Thanks,
Jay
Hi I am using a lighntning component to gather feedback to show the stars I have used a svg static resource which working fine on lightning platform Its giving error I am using same componnent in community , but stars.svg resource is not rendering in community.
import { LightningElement, track, wire} from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { loadStyle, loadScript } from 'lightning/platformResourceLoader';
import Five_Star from '@salesforce/resourceUrl/Five_Star'
import saveFeedbackData from '@salesforce/apex/FeedbackController.saveFeedbackData';
import getAppName from '@salesforce/apex/FeedbackController.getAppName';
import isAllowedFeedback from '@salesforce/apex/FeedbackController.isAllowedFeedback';
export default class FeedbackForm extends LightningElement {
renderedCallback() {
    this.URL= location.pathname;
    this.pageName=this.URL.split('/').pop();
/* eslint-disable no-console */
    if(this.fivestarInitialized){
        return;
    }
    this.fivestarInitialized=true;
    Promise.all([
        loadScript(this, Five_Star + '/rating.js'),
        loadStyle(this,Five_Star + '/rating.css'),
    ])
        .then(() => {
            console.log('scripts loaded');
               
        })
        .catch(error =>{
        this.dispatchEvent(
            new ShowToastEvent({
                title: 'Error loading Five_Star',
                message: error.message,
                variant: 'error',
            }),
        );
        });
}
showfeedbackForm(){ console.log('openmodel='+self.openmodel); window.clearTimeout(this.delayTimeout); // eslint-disable-next-line @lwc/lwc/no-async-operation this.delayTimeout = setTimeout(() => { if(this.readonly){ this.domEl=this.template.querySelector('[data-id="ratingareareadOnly"]'); // this.domEl1=this.template.querySelector('[data-id="ratingareareadOnly1"]'); }else{ this.domEl=this.template.querySelector('[data-id="ratingArea"]'); // this.domEl1=this.template.querySelector('[data-id="ratingareareadOnly1"]'); }
}

​​​​​​​User-added image
i have few things to ask
1) is there way in apex to generate all custom field in apex for a particular object.
2) In dynamic apex is there a way to check the field is standard field or custom field
Hi I am using a lighntning component to gather feedback to show the stars I have used a svg static resource which working fine on lightning platform Its giving error I am using same componnent in community , but stars.svg resource is not rendering in community.
import { LightningElement, track, wire} from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { loadStyle, loadScript } from 'lightning/platformResourceLoader';
import Five_Star from '@salesforce/resourceUrl/Five_Star'
import saveFeedbackData from '@salesforce/apex/FeedbackController.saveFeedbackData';
import getAppName from '@salesforce/apex/FeedbackController.getAppName';
import isAllowedFeedback from '@salesforce/apex/FeedbackController.isAllowedFeedback';
export default class FeedbackForm extends LightningElement {
renderedCallback() {
    this.URL= location.pathname;
    this.pageName=this.URL.split('/').pop();
/* eslint-disable no-console */
    if(this.fivestarInitialized){
        return;
    }
    this.fivestarInitialized=true;
    Promise.all([
        loadScript(this, Five_Star + '/rating.js'),
        loadStyle(this,Five_Star + '/rating.css'),
    ])
        .then(() => {
            console.log('scripts loaded');
               
        })
        .catch(error =>{
        this.dispatchEvent(
            new ShowToastEvent({
                title: 'Error loading Five_Star',
                message: error.message,
                variant: 'error',
            }),
        );
        });
}
showfeedbackForm(){ console.log('openmodel='+self.openmodel); window.clearTimeout(this.delayTimeout); // eslint-disable-next-line @lwc/lwc/no-async-operation this.delayTimeout = setTimeout(() => { if(this.readonly){ this.domEl=this.template.querySelector('[data-id="ratingareareadOnly"]'); // this.domEl1=this.template.querySelector('[data-id="ratingareareadOnly1"]'); }else{ this.domEl=this.template.querySelector('[data-id="ratingArea"]'); // this.domEl1=this.template.querySelector('[data-id="ratingareareadOnly1"]'); }
}

​​​​​​​User-added image

Hi all, I am so close to finishing this process automation badge but am stuck in one area in Step 7.

I've built out my process builder as follows

User-added image
User-added image
User-added image

And my date formula as follows
 

Case(MOD(Date__c-DATE(1900,1,7),7),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5, "Friday",6,"Saturday", "")
 



Challenge Not yet complete... here's what's wrong:  The Robot Setup Day of the Week formula does not seem to be working properly. The Day of the Week should not fall on Saturday or Sunday. 

It works nicely but doesn't seem to pass, what could be up.