You need to sign in to do that
Don't have an account?

getting error :No MODULE named markup://ligtning:layout found : [markup://c:calci]
import { LightningElement ,track} from 'lwc';
export default class Calculator extends LightningElement {}
-----------------------------------------------------------------------------------------
calci.html file is
<template>
<ligtning-card title="Calci" icon-name="standard:formula">
<ligtning-layout multiple-rows>
<lightning-layout-item size="12" padding="around-medium">
<lightning-input type="number" name="FirstNumber"></lightning-input>
</lightning-layout-item>
<lightning-layout-item size="12" padding="around-medium">
<lightning-input type="number" name="SecondNumber"> </lightning-input>
</lightning-layout-item>
<lightning-layout-item size="12" padding="around-medium">
<lightning-button-group>
<lightning-button label="Add" icon-name="utility:add" icon:position="right"></lightning-button>
<lightning-button label="Subtract" icon-name="utlity:dash" icon:position="right"></lightning-button>
<lightning-button label="Multiply" icon-name="utlity:close" icon:position="right"></lightning-button>
<lightning-button label="Divide" icon-name="utlity:magicwand" icon:position="right"></lightning-button>
</lightning-button-group>
</lightning-layout-item>
<lightning-layout-item size="12" padding="around-medium">
<lightning-formated-text value={}></lightning-formated-text>
</lightning-layout-item>
</ligtning-layout>
</ligtning-card>
</template>
--------------------------------------------------------------------------
calci.js-meta.xml file is
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="calci">
<apiVersion>48.0</apiVersion>
<isExposed>true</isExposed>
<description> Simple calculator app build with LWC</description>
<targets>
<target> lightning__AppPage </target>
<target> lightning__HomePage</target>
<target> lightning_RecordPage</target>
</targets>
</LightningComponentBundle>


It's because the last two closing tags are misspelled in your HTML file.
Please update your HTML file,
<template> <lightning-card title="Calci" icon-name="standard:formula"> <lightning-layout multiple-rows> <lightning-layout-item size="12" padding="around-medium"> <lightning-input type="number" name="FirstNumber"></lightning-input> </lightning-layout-item> <lightning-layout-item size="12" padding="around-medium"> <lightning-input type="number" name="SecondNumber"> </lightning-input> </lightning-layout-item> <lightning-layout-item size="12" padding="around-medium"> <lightning-button-group> <lightning-button label="Add" icon-name="utility:add" icon:position="right"></lightning-button> <lightning-button label="Subtract" icon-name="utlity:dash" icon:position="right"></lightning-button> <lightning-button label="Multiply" icon-name="utlity:close" icon:position="right"></lightning-button> <lightning-button label="Divide" icon-name="utlity:magicwand" icon:position="right"></lightning-button> </lightning-button-group> </lightning-layout-item> <lightning-layout-item size="12" padding="around-medium"> <lightning-formated-text value={}></lightning-formated-text> </lightning-layout-item> </lightning-layout> </lightning-card> </template>This should fix the issue.

Use PRIORVALUE Function On Picklist Validation Rule
Hello,
I have a Picklist in which one of the fields is "Error". On a user changing form fields and choosing to choose a different picklist value I want a validation rule to check the previous value of the picklist field and to only allow certain values to be picked if previously at "Error". I have tried the following.
OR(AND(PRIORVALUE(Request_Status__c)='Error' , Request_Status__c<>'Draft Request'),AND(PRIORVALUE(Request_Status__c)='Error' , Request_Status__c<>'Endorse'))
I receive an error as follows:
Error: Field Request_Status__c is a picklist field. Picklist fields are only supported in certain functions. Tell me more
The "Tell me More" link brings me to teh following article https://avaya--c4rdev.cs12.my.salesforce.com/help/doc/user_ed.jsp?loc=help&target=tips_on_building_formulas.htm%23picklists_and_msps§ion=Customizing
In which it states "
- PRIORVALUE(Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the trigger type is set to Every time a record is created or edited)"
I do want this to run though every time an edit occurs though so figured it should work.
Does anyone happen to know from looking at the above what I may be doing wrong and a way to get around this?
Thanks in advance.



Hi there,
Since you are using a picklist, you should use ISPICKVAL in your validation rule. Also, you will need to rewrite your rule a little bit. It looks like your rule is trying to say "If the previous value of Request_Status__c was Error, then the new value cannot be Draft or Endorse."
If that is the case, your rule should look something like this:
OR(
AND(
ISPICKVAL(PRIORVALUE(Request_Status__c),"Error"), NOT(ISPICKVAL(Request_Status__c,"Draft Request"))
),
AND(
ISPICKVAL(PRIORVALUE(Request_Status__c),"Error"), NOT(ISPICKVAL(Request_Status__c,"Endorse")))
)
I hope this helps.
Kemi
Set up social sign-up - Could not find a login to your community using Google.
2) I selected Google as login capability for Partners ( cf screenshot below)
However, the challenge fails with the following message :
Challenge Not yet complete... here's what's wrong: Could not find a login to your community using Google.
Anybody can help ?
Thanks :-)




Check if you can log into the community using Google sign on the login page.
And also please consider this point in the same trailhead unit.
From Setup, enter All Communities in the Quick Find box, then select All Communities and click Manage next to the Customers community.
Select Administration, then Login & Registration and you see that Google is now an option.
Select Google and click Save.
To confirm your change, return to your private (incognito) browser and reload the login page. Check that the Google icon appears on the login page.
Hope this helps you!
Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
Thanks and Regards
Sandhya

Hii All ,can anyone help me in increasing the code coverage of this trigger handler test class to 100%?
public with sharing class ChangeOpptyOwnerCtrl {
private string oppId;
public Opportunity oppobj {get;set;}
public boolean isErrInSave {get;set;}
public ChangeOpptyOwnerCtrl(ApexPages.StandardController ctrl){
oppId = ApexPages.currentPage().getParameters().get('oppId');
if(oppId != null)
oppobj = [Select id, Name, OwnerId from Opportunity where id =: oppId limit 1];
}
public void saveOwner(){
isErrInSave = false;
try{
if(oppobj != null)
update oppobj;
}catch(Exception e){
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error , e.getMessage()));
isErrInSave = true;
}
}
}
TestClass:
@isTest
public with sharing class ChangeOpptyOwnerCtrlTest {
@testSetup
static void setupTestData(){
Account acc = TestUtility.createAccount('Test A');
insert acc;
Opportunity opp = TestUtility.createOpportunity('@test opp', Date.today(), 'To be Invoiced', acc.id);
opp.Follow_up_Date__c = date.today();
insert opp;
}
testmethod static void saveOwnerTest(){
Opportunity opp = [Select id from Opportunity limit 1];
test.startTest();
Test.setCurrentPageReference(new PageReference('Page.ChangeOpptyOwnerPage'));
System.currentPageReference().getParameters().put('oppId',opp.id);
ApexPages.StandardController sc = new ApexPages.StandardController(opp);
ChangeOpptyOwnerCtrl ctrlObj = new ChangeOpptyOwnerCtrl(sc);
ctrlObj.saveOwner();
test.stopTest();
}
}
can any one help me to cover catch(Exception e) lines


Sales Agreement Product Schedules
To get and update records, we use JavaScript Remoting.During test, we found follow weird behavior in Salesfoce.
If we send SalesAgreementProductSchedule like { PlannedQuantity: 48, ID: 0YC8b0000008SDiGAM }, Salesforce Database.update throw error and we can not update this record. But if we put ID at first field in record like { ID: 0YC8b0000008SDiGAM, PlannedQuantity: 48 } we can success update this record.
I want to ask you why cause this behavior? Is there any document about it?


In this document has follow content:
So we change our code as follow:
if (hasId) { newSObject(id); } else { newSObject(); }

The 'Top Volunteer Organizations' report is not sorting by the correct field.




Please follow below
Create a report with Report type as "Users with Volunteer Shift Worker Records".
Your report must include the below columns:
Volunteer Organisation
Shift Hours (Note - This displays the records with SUM by default)
Step 1: Group by rows in 'Volunteer Organisation'
Step 2: Click on the arrow besides 'Volunteer Organisation' and select Sort by "Sum of Shift Hours" (This will display data as per sum of shift hours in ascending order)
Step 3: Click on the arrow besides 'Volunteer Organisation and select "Sort Descending" option.
P.S Ensure details, row counts and sub totals are off.
Hope this helps!
Kindly mark it as the best answer if it helps.
Regards,
Ranjan
Formula field for calculate age by using DOB
HI All,
How to create a fomula field for my age field ? It will be calculated by using the Date_of_Birth__c field. I have a fomula.
IF(MONTH(TODAY())>MONTH(DOB_API),YEAR(TODAY())-YEAR(DOB_API),IF(AND(MONTH(TODAY())=MONTH(DOB_API),DAY(TODAY())>=DAY(DOB_API)),YEAR(TODAY())-YEAR(DOB_API),(YEAR(TODAY())-YEAR(DOB_API))-1))
That's from Ankit's blog. But I don't know how to use it and where to use it.
Thanks in Advance


Yes thats a correct formula , you can use above
If you want to go for smaller formula
Use this one : From http://forceschool.blogspot.com/2011/06/age-calculation-formula.html
IF(ISNULL(DOB__c) , DOB__c , FLOOR((TODAY()-DOB__c +1)/365.2425))
Now to your question how to use it.
1) Create a formula field return type Integer
2) Use any of the formula , replace your date field API Name with DOB__c
Then you will see this Calculated Age in your formula field.

Creating an Alert to fire when a date field becomes equal to TODAY's date I am trying to create an alert on a specific date field on an object that is time-based related.
I am trying to create an alert on a specific date field on an object that is time-based related.
The issue is that both Process Builder and WorkFlow only fire when an object is updated or created, but not when a date becomes Today (naturally, without editing or creating the object's fields).
Here are my 3 separate use cases (each needs its own solution, but has the same problem):
1. On a custom object called "Project" we have a date-field called KICKOFF DATE. When the date becomes today, we want an email alert to send out a reminder that today is kickoff date for this project.
2. When an Opp is in Stage 1 and it's Age = 60 days, we want to send an email alert that the Opportunity is 60 days old (from created date) and is in stage 1.
3. When an Opportunity is approaching the Close Date and is in a lower Stage, we want an alert to fire that says warns it is approaching.
So now I think I need a trigger to help fire this in Process Builder.
Anybody ever had this need before or accomplished this?

You can simply achieve this bys using a workflow rule. You can set the criteria as TRUE if you always want to execute this. You can add a time dependent workflow action which will be executed 0 days after KICKOFF Date.
Let me know if you need any help in setting up this worklflow rule.
Thanks,
Abhishek Bansal.
Gmail: abhibansal2790@gmail.com
Skype: abhishek.bansal2790

Rename Close Date to Expected close date on Opportunity
Hi Guys,
In Opportunity Object for some page layouts in my organization in record detail page the field lable is "Closedate" when i edit the same layout the same field label is like "Expected close date". How this happens?
Is it depends on any other settings or open / closed status of an opportunity? or any other ?


Hi,
Yes. We have a Option in Salesforce to rename field labels, but still the Field API Name is the same.
This is customization is to help your organization in reflecting business requirements.
When you rename a label, such as changing the “Accounts” label to “Companies,” the new label appears on all user pages. With rare exception, all pages in the Setup area use the default, original labels.
Follow this path
1. Your Name | Setup | Customize | Tab Names and Labels | Rename Tabs and Labels.
2. Click Edit link nearer to Opportunity
3. Click "Next" button
4. You can see that "Close Date" was renamed.
Yes, when we edit the page layout ...it show the default original name in the Edit Page Layout.
This is the standard behaviour.
Hope this post answers your query, mark this post as solved if it helps you.
Regards,
Bharathi
Salesforce For All
Thanks,
Maharajan.C