• Kent Lichty
  • NEWBIE
  • 20 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 12
    Replies
I am relatively new to LWC programming, and this is the first time that I have attempted to reference a child component from a parent component using the kebab case syntax.  As my template, I am using the LWC "Event With Data" recipe, from which I have successfully created a Lightning App with no problems, so I know the concept is valid.  The problem is that, whenever I attemp to create a Lightning App with MY CUSTOM components, I get the error shown below:


Error Lightning App BuilderThe stack trace reads:  
n()@https://fike--rspilot.lightning.force.com/flexipageEditor/modules/c/iclitem.js:4:330

I refer to my custom component using the kebab case syntax that I have read about, as shown below in my parent HTML page:

<template>
    <lightning-card title="Incentive Calculations Data Display" icon-name="standard:logging">
        <template if:true={incentiveCalculations.data}>
            <lightning-layout class="slds-var-m-around_medium">
                <lightning-layout-item>
                    <template for:each={incentiveCalculations.data}            for:item="incentiveCalculation">
                        <c-iclitem
                            class="slds-show slds-is-relative"
                            key={incentiveCalculation.Id}
                            contact={incentiveCalculation}
                            onselect={handleSelect}
                        ></c-iclitem>
                    </template>
                </lightning-layout-item>
                <lightning-layout-item class="slds-var-m-left_medium">
                    <template if:true={selectedIncentiveCalculation}>   
                        <p>{selectedIncentiveCalculation.Name}</p>  
                    </template>
                </lightning-layout-item>
            </lightning-layout>
        </template> 
    </lightning-card>
</template>

The error message leads me to believe that Lightning App builder cannot find my child component because it is NOT in the standard "c" folder, as I have also read this in the documentation:

A custom Lightning web component can't access a Lightning web component or module in a custom namespace.  It can access Lightning web components and modules only in the c and lightning namespaces.

So is what I am trying to do just not possible?  If so, that is really limiting.  I have redone my code quite a few times thinking that it was just a simple keying error, but nothing seems to work.  I can send additional code if necessary, but it is all quite simple stuff.

I would appreciate any help on this, because nobody at my organization has any experience in LWC coding.
I am quite new to LWC programming, and I am being asked to develop an application which I think is relatively "advanced", and I am seeking some help about how to achieve it. The program is using a datatable which I have used many times, but the complexity here is that COLUMNS in the table are dynamic, as well as the property names within those columns.  The basic question is how can I define the property names in javascript when they really don't exist as actual "properties", but simply as list elements?

The screen shot below (I know it's small) will give you an idea of the goal:  I want to list products and for each product, display whether selected price books are active or inactive for that product.  If the price book is active, then a checkbox (with a checkmark) will be displayed, and this is what is NOT happening.  The user will select WHICH price books they wish to see displayed by using the dual-list box at the top.  This is what causes the columns to be dynamic, as well as the property names which appear underneath them.  To keep it simple, I have selected only TWO price books, while in reality many more could be selected.

Screen shot of Application
 
Everything is working fine except that the check marks are not being displayed, and I know they CAN be displayed as I first developed this application using hard-coded columns and property names.  

Here is the stringified JSON that shows the column information, which was built up in Apex, and it looks like I expect it to look.  And you can see from the screen shot that the column headings are working fine.

column list = [{"editable":false,"fieldName":"productLine","label":"Line","type":"text"},{"editable":false,"fieldName":"productSubLine","label":"Sub-Line","type":"text"},{"editable":false,"fieldName":"productName","label":"Product","type":"text"},{"editable":false,"fieldName":"productDescription","label":"Description","type":"text"},{"editable":true,"fieldName":"ActiveStatus[0]","label":"FAO - Fire Alarm Price Book","type":"boolean"},{"editable":true,"fieldName":"ActiveStatus[1]","label":"FSO - Fire Suppression Price Book","type":"boolean"}]

I assume that the problem is with how I defined the fieldName value, because that field name is not a true "property" in a class, but a list element from a list in my wrapper class that is a property.   So the only way I know how to define it is as an array element which you see from the above is "ActiveStatus[0]" and "ActiveStatus[1]".  My guess is that this syntax is simply wrong, but I don't know how else to define this field name dynamically.

Here is the actual value of my list (after JSON.stringify) and it looks correct to me. You can see that both elements of the "ActiveStatus" list are set to "true".

list = [{"ActiveStatus":[true,true],"productDescription":"SPLICING TAPE,BLUE PROTECTOWIRE","productId":"01t21000004jHdeAAE","productLine":"Linear Heat","productName":"#35 BLUE","productSubLine":"Accessories-Linear Heat"},{"ActiveStatus":[true,true],"productDescription":"SPLICING TAPE,RED PROTECTOWIRE","productId":"01t21000004jHdsAAE","productLine":"Linear Heat","productName":"#35 RED","productSubLine":"Accessories-Linear Heat"},{"ActiveStatus":[true,true],"productDescription":"SPLICING TAPE,WHITE PROTECTOWIRE","productId":"01t21000004jHcrAAE","productLine":"Linear Heat","productName":"#35 WHITE","productSubLine":"Accessories-Linear Heat"}]

That is really my basic question: how do I define my field names when they are not hard-coded properties in my wrapper class?  I know that I can take a lame way out and define a bunch of property values in my wrapper class (isActive001, isActive002, ...... isActive100) but this approach is not optimal and I think it can done using the dynamic alternative, if I could figure it out.

I don't think it's really relevant, but here are some more code fragments which are perhaps applicable:

This is my Apex wrapper class defines the datatable row:

public class FikeAltPbWrapper2
{
    @AuraEnabled
    public Id productId {get;set;}
    
   @AuraEnabled
    public String productName {get;set;}
    
    @AuraEnabled
   public String productLine {get;set;}
    
    @AuraEnabled
    public String productSubLine {get;set;}
    
   @AuraEnabled
    public String productDescription {get;set;}

    @AuraEnabled
    public List <boolean> ActiveStatus {get;set;}
        
    public FikeAltPbWrapper2 (Id productId, String productName, String productLine, String                       productSubLine,   String productDescription, List <boolean>                      ActiveStatus )  
    {
        this.productId = productId;
        this.productName = productName;
        this.productLine = productLine;
        this.productSubLine = productSubLine;
        this.productDescription = productDescription;
        this.ActiveStatus = ActiveStatus;
    }

} //End of Class


And here is the javascript function:
@wire(getWrapperList, {productCategorySearchKey: '$productCategorySearchKey', 
                          productFamilySearchKey: '$productFamilySearchKey',
                          productLineSearchKey: '$productLineSearchKey',
                          productSubLineSearchKey: '$productSubLineSearchKey',
                          productSearchKey: '$productSearchKey',
                          productDescriptionSearchKey: '$productDescriptionSearchKey',
                          selectedPriceBooks: '$selectedPriceBooksStr'})

                          getWrapperList(result){
                            this.wiredResults=result;
                            if (result.data)
                            {
                                this.columns = result.data.columnList;
                                this.wrapperList = result.data.dataList2;
                              
                            }  
                            else if(result.error)
                            {
                                this.error = result.error;
                            }

    }

Thanks very much for getting through this long post, and I truly appreciate any help that could be provided.




 
I am fairly new to Salesforce and really new to learning about LWC, and my organization has tasked me with what I think is a difficult challenge. Because sometimes the (poor) definition of sObjects does NOT make them conducive to user maintenance, I have been tasked to develop a maintenance application (in the form of an LWC datatable) which makes it easier for users to enter/change prices  (expressed in 6 different currencies)  for a given product. In order to do this I needed to create a class wrapper which combines properties from a Product sObject and a Price sObject. Then I need to be able to SAVE those changed prices back into the appropriate Price record, and that is the difficult part with which I am struggling.  But I would think that this would be a common use case.

And while there is a LOT of information about DISPLAYING class wrappers in a datatable (which is quite simple) there is virtually no information about sending the list of modified properties back to an imperative Apex program which could then do the record updating, and that is what I am hoping that somebody has figured out how to do.

I think I am very close to being able to achieve this, and am hoping that somebody can help me get to the finish line.  Here is the approach I am taking:

For what it’s worth, here is my wrapper class which is keyed by a “product” code and then has the associated prices in 6 different currencies, along with some other information about the product.

        public String product{get;set;}
        public String productFamily {get;set;}
        public String productLine {get;set;}
        public String productSubLine {get;set;}
        public String productCategory {get;set;}
        public Decimal priceCad {get;set;
        public Decimal priceEur {get;set;} 
        public Decimal priceGbp {get;set;}
        public Decimal priceInr {get;set;}
        public Decimal priceJpy {get;set;}
        public Decimal priceUsd {get;set;}

And here is a fragment of my displayed list just to amplify the concept; it just shows 2 currency amounts instead of all 6 just to make it clearer.
User-added imageSo I just want to use the same “draft values” approach that is standard for the datatable component, as below:

User-added image
And here is the standard “Save” function (from another project; NOT this one) which I am sure most of you have seen, and which uses the uiRecordApi to implement, without any Apex call. 
handleSave(event) {
        const recordInputs =  event.detail.draftValues.slice().map(draft => {
            const fields = Object.assign({}, draft);
            return { fields };
        });

But in my application I know that I need to imperatively call my Apex class to handle this update, and I can do that.  I am currently only passing back the JSONified values of the “draftValues” and the entire list itself, just to see how that works:

handleSave(event) {
        var draftValuesStr = JSON.stringify(event.detail.draftValues);
        var wrapList = JSON.stringify(this.pricesList);
        updatePriceRecords({updateObjStr: draftValuesStr, wrapList: wrapList});
      }

And this does bring back the “draft” values perfectly for me, as you can see below:

[{"priceUsd":"456.00","priceEur":"765.67","Id":"row-3"}]

And my Apex could handle the price updates if ONLY it had some unique ID (like the product number, in my case), so that is what I am asking how to do.  All the string contains as an ‘ID’ is the row ID, which is not very helpful.  I know that I can bring back the ENTIRE list, and then be able to associate the row ID with the appropriate record in the list and get the product number that way, but that is clearly a horribly inefficient idea, and there has got to be a better way. 

I also considered somehow persisting my list into a CACHE (like a user setting?) so I could retrieve the original list that way, but that does not sound like a good idea either.

Also, I am thinking that I could somehow iterate through the JSONified draft values and insert the product ID appropriately into that list, but I am not sure how I would go about grabbing the product ID out of selected draft record.


If anybody could help me out with this I would really appreciate it.  It seems to me that this would be a very common use case out there.

Thanks very much.
​​​​​​​



 
I am relatively new to Force.com programming, and I apologize if this question has already been beaten to death.  I have a custom Visualforce page/Apex that displays a list of summarized opportunity information for selected accounts. My users then want to be able to click on one of the displayed lines and have a screen exactly like the Opportunity Related List Quick Link hover screen pop up, from which a displayed Opportunity line can be then be selected and go to the standard Opportunity screen. Can I not just use the opportunity pop up screen that Salesforce has already written, and somehow access it from my custom program? I assume that this would be much too simple, and what I want to do will require a lot of custom javascript and CSS; which is definitely NOT my area of expertise.  But I thought I would just ask the question here, to see whether what I want to do is possible or not.  Thanks very much.
I have created a custom VisualForce page and a custom controller, and I want to be able to examine the view state to see how big it is.  I have read that you can enable a view state tab (or VisualForce developer footer tab) to be displayed and, while I think I have met all of the requirements, no such tab is ever displayed.  I have modified my user settings to check both "Development Mode" and "Show View State in Development Mode".  I have tried in both Classic and Lightning, and have tried logging off and then back in.  Nothing works.  If anybody could tell me what I am doing wrong, I would appreciate it.  Or, if anybody could tell me how to check the view state size in an apex log, that would be great as well.  Thanks very much.

I have really appreciated all of the assistance that I have received through this forum, so I thought I would go to the well once again and ask my "newbie" question:  I have a custom vf and apex application (one each for "view" and "edit").  I have created a new list view that contains my preferred fields, as opposed to the standard list view.   I have overridden the "View" and "Edit" buttons from my object's list view to call my custom pages.  On my custom pages I have a standard "Cancel" button which, when pressed, I want to return the user to my NEW list view and NOT to the standard object's list view.  When I click on the "Edit" button (at the far right, in the inverted triangle) to access my custom page, and then click my "Cancel" button it works perfectly; returning me to my custom new list view.  I have NOT overriden the Cancel method in Apex at all.  However, when I access my "View" page from the blue hyperlinked item the "Cancel" button returns me back to the STANDARD list view as opposed to my NEW list view.  Also, I had to include a "Cancel" method in my Apex code with this code:

return new ApexPages.Action('{!List}').invoke(); 

 or it would not even return to ANY list, but stayed on the same page. 

My question is:  why do I need to override the "Cancel" method at all, as I thought it's standard behavior would be to return to the MOST RECENT page, which should be my new list view?   Is there some way that I can safely and securly capture the URL of the previous list view so I can easily return to it? 

I know this got pretty long, but I would appreciate your insights on this.  Thanks very much.

 

I am quite new to Force.com development, and I am struggling with an issue that I thought would be quite simple.  I have a custom VisualForce page, and I want the help text bubble icon and text to be displayed on my page, but I cannot figure out how to do that. I have read the posts on this forum for that same question and have implemented what I think is the correct approach, but it still shows nothing.  My VF code is like this:

<apex:pageBlockSectionItem HelpText="{!$ObjectType.BNTE_Build_Note__c.Fields.Work_Order_ID__c.InlineHelpText}"> 
                    <apex:outputLabel value="{!$ObjectType.BNTE_Build_Note__c.fields.Work_Order_ID__c.label}"/>
                    <apex:inputField value="{!BNTE_Build_Note__c.Work_Order_Id__c}"/> 
                 </apex:pageBlockSectionItem>

My page is set to ShowHeader = "true".

Could anybody suggest what I could try to get this to work?
I am fairly new to Salesforce and really new to learning about LWC, and my organization has tasked me with what I think is a difficult challenge. Because sometimes the (poor) definition of sObjects does NOT make them conducive to user maintenance, I have been tasked to develop a maintenance application (in the form of an LWC datatable) which makes it easier for users to enter/change prices  (expressed in 6 different currencies)  for a given product. In order to do this I needed to create a class wrapper which combines properties from a Product sObject and a Price sObject. Then I need to be able to SAVE those changed prices back into the appropriate Price record, and that is the difficult part with which I am struggling.  But I would think that this would be a common use case.

And while there is a LOT of information about DISPLAYING class wrappers in a datatable (which is quite simple) there is virtually no information about sending the list of modified properties back to an imperative Apex program which could then do the record updating, and that is what I am hoping that somebody has figured out how to do.

I think I am very close to being able to achieve this, and am hoping that somebody can help me get to the finish line.  Here is the approach I am taking:

For what it’s worth, here is my wrapper class which is keyed by a “product” code and then has the associated prices in 6 different currencies, along with some other information about the product.

        public String product{get;set;}
        public String productFamily {get;set;}
        public String productLine {get;set;}
        public String productSubLine {get;set;}
        public String productCategory {get;set;}
        public Decimal priceCad {get;set;
        public Decimal priceEur {get;set;} 
        public Decimal priceGbp {get;set;}
        public Decimal priceInr {get;set;}
        public Decimal priceJpy {get;set;}
        public Decimal priceUsd {get;set;}

And here is a fragment of my displayed list just to amplify the concept; it just shows 2 currency amounts instead of all 6 just to make it clearer.
User-added imageSo I just want to use the same “draft values” approach that is standard for the datatable component, as below:

User-added image
And here is the standard “Save” function (from another project; NOT this one) which I am sure most of you have seen, and which uses the uiRecordApi to implement, without any Apex call. 
handleSave(event) {
        const recordInputs =  event.detail.draftValues.slice().map(draft => {
            const fields = Object.assign({}, draft);
            return { fields };
        });

But in my application I know that I need to imperatively call my Apex class to handle this update, and I can do that.  I am currently only passing back the JSONified values of the “draftValues” and the entire list itself, just to see how that works:

handleSave(event) {
        var draftValuesStr = JSON.stringify(event.detail.draftValues);
        var wrapList = JSON.stringify(this.pricesList);
        updatePriceRecords({updateObjStr: draftValuesStr, wrapList: wrapList});
      }

And this does bring back the “draft” values perfectly for me, as you can see below:

[{"priceUsd":"456.00","priceEur":"765.67","Id":"row-3"}]

And my Apex could handle the price updates if ONLY it had some unique ID (like the product number, in my case), so that is what I am asking how to do.  All the string contains as an ‘ID’ is the row ID, which is not very helpful.  I know that I can bring back the ENTIRE list, and then be able to associate the row ID with the appropriate record in the list and get the product number that way, but that is clearly a horribly inefficient idea, and there has got to be a better way. 

I also considered somehow persisting my list into a CACHE (like a user setting?) so I could retrieve the original list that way, but that does not sound like a good idea either.

Also, I am thinking that I could somehow iterate through the JSONified draft values and insert the product ID appropriately into that list, but I am not sure how I would go about grabbing the product ID out of selected draft record.


If anybody could help me out with this I would really appreciate it.  It seems to me that this would be a very common use case out there.

Thanks very much.
​​​​​​​



 
I am relatively new to Force.com programming, and I apologize if this question has already been beaten to death.  I have a custom Visualforce page/Apex that displays a list of summarized opportunity information for selected accounts. My users then want to be able to click on one of the displayed lines and have a screen exactly like the Opportunity Related List Quick Link hover screen pop up, from which a displayed Opportunity line can be then be selected and go to the standard Opportunity screen. Can I not just use the opportunity pop up screen that Salesforce has already written, and somehow access it from my custom program? I assume that this would be much too simple, and what I want to do will require a lot of custom javascript and CSS; which is definitely NOT my area of expertise.  But I thought I would just ask the question here, to see whether what I want to do is possible or not.  Thanks very much.
I have created a custom VisualForce page and a custom controller, and I want to be able to examine the view state to see how big it is.  I have read that you can enable a view state tab (or VisualForce developer footer tab) to be displayed and, while I think I have met all of the requirements, no such tab is ever displayed.  I have modified my user settings to check both "Development Mode" and "Show View State in Development Mode".  I have tried in both Classic and Lightning, and have tried logging off and then back in.  Nothing works.  If anybody could tell me what I am doing wrong, I would appreciate it.  Or, if anybody could tell me how to check the view state size in an apex log, that would be great as well.  Thanks very much.
Hi, We want to connect snowflake to our salesforce instance to get the data from snowflake to Salesforce. Can anyone please advise on how to do that? Any app exchange product or documentation. I am having hard time to find proper way do it? I contacted salesforce support, but they told me to post in the developer forums as some others might have connected and they can provide more information. Thank you!
I am quite new to Force.com development, and I am struggling with an issue that I thought would be quite simple.  I have a custom VisualForce page, and I want the help text bubble icon and text to be displayed on my page, but I cannot figure out how to do that. I have read the posts on this forum for that same question and have implemented what I think is the correct approach, but it still shows nothing.  My VF code is like this:

<apex:pageBlockSectionItem HelpText="{!$ObjectType.BNTE_Build_Note__c.Fields.Work_Order_ID__c.InlineHelpText}"> 
                    <apex:outputLabel value="{!$ObjectType.BNTE_Build_Note__c.fields.Work_Order_ID__c.label}"/>
                    <apex:inputField value="{!BNTE_Build_Note__c.Work_Order_Id__c}"/> 
                 </apex:pageBlockSectionItem>

My page is set to ShowHeader = "true".

Could anybody suggest what I could try to get this to work?