• Vicintas-G
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Error while clicking on Button :  This page has an error. You might just need to refresh it. Access Check Failed! AttributeSet.set(): 'errors' of component 'markup://lightning:input {43:0} {price}' is not visible to 'markup://silk:campingList {3:0}'. Failing descriptor: {markup://silk:campingList} .


Error while submitting the task in Trailhead:  The campingList component doesn't appear to have a Quantity input field in the form using a Lightning Base component.

CampingList.cmp 
<aura:component >
    <aura:attribute name="newItem" type="Camping_Item__c"
                    default="{ 'sobjectType': 'Camping_Item__c',
                             'Name': '',
                             'Quantity__c': 0,
                             'Price__c': 0,
                             'Packed__c': false }"/>
    
    <aura:attribute name="items" type="Camping_Item__c[]"/>
    <!-- CREATE NEW ITEM FORM -->
    <form class="slds-form--stacked">
                        <lightning:input aura:id="itemname" label="Camping Item Name"
                                         name="itemname"
                                         value="{!v.newItem.Name}"
                                         required="true"/> 
                        <lightning:input type="number" aura:id="quantity" label="Quantity"
                                         name="itemquantity"
                                         value="{!v.newItem.silk__Quantity__c}"
                                         /> <!--placeholder="1"  min="1"-->
                        <lightning:input aura:id="price" label="Price"
                                         formatter="currency"
                                         name="itemprice"
                                         value="{!v.newItem.silk__Price__c}"/>
                        
                        <lightning:input type="checkbox" aura:id="packed" label="Packed?"  
                                         name="itempacked"
                                         checked="{!v.newItem.silk__Packed__c}"/>
                        <lightning:button label="Create Camping Item" 
                                          class="slds-m-top--medium"
                                          variant="brand"
                                          onclick="{!c.clickCreateItem}"/>
                    
    </form>
    <!-- / CREATE NEW ITEM FORM -->
    <c:campingHeader/>
    <div class="slds-card slds-p-top--medium">
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="item">
                    <c:campingListItem item="{!item}"/>
                </aura:iteration>
            </div>
        </section>
    </div>
    
    
    
    
    
</aura:component>
CampingListController.js
({
    clickCreateItem: function(component, event, helper) {
        // Simplistic error checking
        var validItem = true;
       
        // Name must not be blank
        var nameField = component.find("itemname");
        var itemname = nameField.get("v.value");
        if ($A.util.isEmpty(itemname)){
            validItem = false;
            nameField.set("v.errors", [{message:"Item name can't be blank123."}]);
        }
        else {
            nameField.set("v.errors", null);
        }
        
        // Quantity must not be blank
        var quantityField = component.find("quantity");
        var quantity1 = nameField.get("v.value");
        //alert('Alert quantity'+quantity);
        console.log(quantity1);
        if ($A.util.isEmpty(quantity1)){
            validItem = false;
            quantityField.set("v.errors", [{message:"Quantity can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        if ($A.util.isEmpty(price)){
            validItem = false;
            priceField.set("v.errors", [{message:"Price can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }  
     
        if(validItem){
            var newItem = component.get("v.newItem");
            var item = JSON.parse(JSON.stringify(newItem)); 
            console.log(item);
            var itemarray = component.get("v.items");
            itemarray.push(item);
            component.set("v.items",itemarray); 
        }
        component.set("v.newItem",{ 'sobjectType': 'Camping_Item__c','Name': '','Quantity__c': 0,
                                       'Price__c': 0,'Packed__c': false});
        
    }
})

CampinListItems.cmp
<aura:component >
    <aura:attribute name="Item" type="Camping_Item__c" required="true"/>
    
    <p>Name: {!v.Item.Name}</p>
    <p>	<lightning:formattedNumber value="{!v.Item.Price__c}" style="currency"/></p>
    <p><lightning:formattedNumber value="{!v.Item.Quantity__c}" /></p>
    <p><lightning:input type="toggle" label="Packed?" name="Packed" checked="{!v.Item.Packed__c}"/></p>
    <p><lightning:button label="Packed!" onclick="{!c.packItem}"/></p>
	
</aura:component>

CampingHeader.cmp
<aura:component >
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem >
            <lightning:icon iconName="action:goal" alternativeText="My Component Item"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Component Item</h1>
                <h2 class="slds-text-heading--medium">My Component Item</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER -->
    
</aura:component>


 
Can we move total project components(objects with rollup summery field, M-D releationship objects, triggers , classes, vfpages, workflows, validations and button links ) at a time from one org to another org through eclipse IDE?
Error while clicking on Button :  This page has an error. You might just need to refresh it. Access Check Failed! AttributeSet.set(): 'errors' of component 'markup://lightning:input {43:0} {price}' is not visible to 'markup://silk:campingList {3:0}'. Failing descriptor: {markup://silk:campingList} .


Error while submitting the task in Trailhead:  The campingList component doesn't appear to have a Quantity input field in the form using a Lightning Base component.

CampingList.cmp 
<aura:component >
    <aura:attribute name="newItem" type="Camping_Item__c"
                    default="{ 'sobjectType': 'Camping_Item__c',
                             'Name': '',
                             'Quantity__c': 0,
                             'Price__c': 0,
                             'Packed__c': false }"/>
    
    <aura:attribute name="items" type="Camping_Item__c[]"/>
    <!-- CREATE NEW ITEM FORM -->
    <form class="slds-form--stacked">
                        <lightning:input aura:id="itemname" label="Camping Item Name"
                                         name="itemname"
                                         value="{!v.newItem.Name}"
                                         required="true"/> 
                        <lightning:input type="number" aura:id="quantity" label="Quantity"
                                         name="itemquantity"
                                         value="{!v.newItem.silk__Quantity__c}"
                                         /> <!--placeholder="1"  min="1"-->
                        <lightning:input aura:id="price" label="Price"
                                         formatter="currency"
                                         name="itemprice"
                                         value="{!v.newItem.silk__Price__c}"/>
                        
                        <lightning:input type="checkbox" aura:id="packed" label="Packed?"  
                                         name="itempacked"
                                         checked="{!v.newItem.silk__Packed__c}"/>
                        <lightning:button label="Create Camping Item" 
                                          class="slds-m-top--medium"
                                          variant="brand"
                                          onclick="{!c.clickCreateItem}"/>
                    
    </form>
    <!-- / CREATE NEW ITEM FORM -->
    <c:campingHeader/>
    <div class="slds-card slds-p-top--medium">
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="item">
                    <c:campingListItem item="{!item}"/>
                </aura:iteration>
            </div>
        </section>
    </div>
    
    
    
    
    
</aura:component>
CampingListController.js
({
    clickCreateItem: function(component, event, helper) {
        // Simplistic error checking
        var validItem = true;
       
        // Name must not be blank
        var nameField = component.find("itemname");
        var itemname = nameField.get("v.value");
        if ($A.util.isEmpty(itemname)){
            validItem = false;
            nameField.set("v.errors", [{message:"Item name can't be blank123."}]);
        }
        else {
            nameField.set("v.errors", null);
        }
        
        // Quantity must not be blank
        var quantityField = component.find("quantity");
        var quantity1 = nameField.get("v.value");
        //alert('Alert quantity'+quantity);
        console.log(quantity1);
        if ($A.util.isEmpty(quantity1)){
            validItem = false;
            quantityField.set("v.errors", [{message:"Quantity can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        if ($A.util.isEmpty(price)){
            validItem = false;
            priceField.set("v.errors", [{message:"Price can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }  
     
        if(validItem){
            var newItem = component.get("v.newItem");
            var item = JSON.parse(JSON.stringify(newItem)); 
            console.log(item);
            var itemarray = component.get("v.items");
            itemarray.push(item);
            component.set("v.items",itemarray); 
        }
        component.set("v.newItem",{ 'sobjectType': 'Camping_Item__c','Name': '','Quantity__c': 0,
                                       'Price__c': 0,'Packed__c': false});
        
    }
})

CampinListItems.cmp
<aura:component >
    <aura:attribute name="Item" type="Camping_Item__c" required="true"/>
    
    <p>Name: {!v.Item.Name}</p>
    <p>	<lightning:formattedNumber value="{!v.Item.Price__c}" style="currency"/></p>
    <p><lightning:formattedNumber value="{!v.Item.Quantity__c}" /></p>
    <p><lightning:input type="toggle" label="Packed?" name="Packed" checked="{!v.Item.Packed__c}"/></p>
    <p><lightning:button label="Packed!" onclick="{!c.packItem}"/></p>
	
</aura:component>

CampingHeader.cmp
<aura:component >
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem >
            <lightning:icon iconName="action:goal" alternativeText="My Component Item"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Component Item</h1>
                <h2 class="slds-text-heading--medium">My Component Item</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER -->
    
</aura:component>


 
Hi Team

I would like to know, how a checkbox field automatically uncheck based on some date criteria through workflow time trigger. Basically logic should be..

If date_field_c + 1=today() then field update happen (checkbox_field_c = unchecked)

I already implemented one workflow but it did not work well. I am mentioning my workflow logic below:-
RecordType.Name = "Field Staff" && ((End_Date__c + 1) = today())

Field update:-
New Field ValueFalse

Please let me know how I can resolve the issue.