You need to sign in to do that
Don't have an account?
suji srinivasan
Hi,How to install sfdx plugins for local server?
I have updated SFDX.I need to install local dev server . Its getting failed ad got error message
'Failed to setup Red Hat XML extension
Activating extension 'redhat.vscode-xml' failed: Connection to server got closed. Server will not be restarted..
Starting SFDX: Start Local Development Server'
How to preview LWC component locally. Thanks in advance.
'Failed to setup Red Hat XML extension
Activating extension 'redhat.vscode-xml' failed: Connection to server got closed. Server will not be restarted..
Starting SFDX: Start Local Development Server'
How to preview LWC component locally. Thanks in advance.
Gracie Marsh
To use the local LWC development server, you have to follow three simple steps:
- Open the terminal and install the local development server. sfdx plugins:install @salesforce/lwc-dev-server.
- Start the server by running this command. sfdx force:lightning:lwc:start.
- Go tot the https://www.myloweslife.bid/
suji srinivasan
Hi, when i try to deploy my LWC component apex class . i am getting error message like 'Variable does not exist: SObjectType'. thanks in advance
Apex class for LWC component
public with sharing class PurchaseOrder {
public PurchaseOrder(){
List product2;
}
@AuraEnabled
public static string createOrderRecord(List newOrderItemList
){
string orderId = '';
if (newOrderItemList != null && ! newOrderItemList.isEmpty()) {
database.saveresult[] srList = database.insert(newOrderItemList
);
for (Database.SaveResult sr : srList) {
if (sr.isSuccess()) {
// Operation was successful, so get the ID of the record
that was processed
System.debug('Successfully inserted account. Account ID: '
+ sr.getId());
OrderId = sr.getId();
}
else {
// Operation failed, so get all errors
for(Database.Error err : sr.getErrors()) {
System.debug('The following error has occurred.');
System.debug(err.getStatusCode() + ': ' + err.getMessage
());
System.debug('Account fields that affected this error: '
+ err.getFields());
}
}
}
}
return orderId;
}
@AuraEnabled(cacheable=true)
public static list fetchproducts (){
List product2;
list productFamilies = new list ();
if(
Product2.SObjectType.getDescribe().isAccessible() &&
Schema.SObjectType.Product2.fields.Id.isAccessible() &&
Schema.SObjectType.Product2.fields.Name.isAccessible() &&
Schema.SObjectType.Product2.fields.family.isAccessible()&&
Schema.SObjectType.Product2.fields.quantity__c.isAccessible()
){
for (AggregateResult prod:[select family fm from Product2 group by
family ]){
system.debug(prod);
productFamilies.add((String)prod.get('fm'));}
}
return productFamilies;
}
@AuraEnabled
public static list fetchproductname (string productFamily){
List product2;
if(
Product2.SObjectType.getDescribe().isAccessible() &&
Schema.SObjectType.Product2.fields.Id.isAccessible() &&
Schema.SObjectType.Product2.fields.Name.isAccessible() &&
Schema.SObjectType.Product2.fields.family.isAccessible() &&
Schema.SObjectType.Product2.fields.quantity__c.isAccessible()
)
{
return [select Id, family, name, quantity__c from Product2 where
family=:productFamily];
}
return Product2;
}
}