• Brian C
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 1
    Likes Given
  • 3
    Questions
  • 6
    Replies
When defining the columns for a Lightning Datatable, is it possible to set the editable property for a column based on data in another column?

Here is what I have for the column definitions currently:
var columns = [
                { label: "Ship To", initialWidth: 235, fieldName: "fulfilltype", type: "text" },
                { label: "Status", initialWidth: 100, fieldName: "status", type: "text" },
                { label: "Cost", fixedWidth: 165, fieldName: "cost", type: "currency", editable: true }
            ];

I would like the "cost" field to be editable based on the value in the "status" field. For example, if the status is "Shipped," allow the cost to be edited on that line. If it is any other status, switch that line's cost editable property to false.

I've looked into Validation Rules for setting this criteria on the object in question, but I'd prefer the user to not even see the pencil to edit within the datatable.
I am working on transitioning my org's workflow from using Attachments to Files in order to be compatibile with Lightning. I have a specific use case I need guidance on:

In Classic, we have a work process in which an artist uploads an image file to a custom object record. This file is automatically renamed via an Apex controller to a standardized filename. We have a separate Visualforce page using the custom object as its standard controller (also using a custom Apex extension). The Visualforce page renders the image for printing (along with other related data from the record) by referencing the generic file name. 

For Lightning, I have built a Lightning component for file upload. This component uploads the image as a File/ ContentDocument associated with the custom object. How can I replicate similar functionality for the Visualforce page with Salesforce Files? My initial thought was to add a field to the custom object to store a URL for viewing the File, but I'm not sure how to generate such a URL. 
What is the best method for populating a scratch org with custom objects and their fields from a sandbox? I have tried the following process and have been unsucessful- am I missing a step or doing something incorrectly?
  1. Within the sandbox, I've created an unmanaged package containing the custom object. I noticed that the package also automatically pulls in dependent classes, pages, etc. 
  2. I've pulled the package to my local environment using:
    sfdx force:mdapi:retrieve -s -r packages -u Sandbox -p objectexport
    
  3. I've unzipped the downloaded package.
  4. I've converted the package to DX format using:
    sfdx force:mdapi:convert -r packages\objectexportunzipped
  5. I then try pushing the converted object to the scratch org:
    sfdx force:source:push
The attempt errors out with dozens of "variable does not exist" and "invalid type" errors. From what I can see, it looks like the order the objects and classes are being pushed is causing the system to not see the dependent fields.

My end goal is to have a repeatable process to replicate custom objects from my sandbox to scratch orgs. 
What is the best method for populating a scratch org with custom objects and their fields from a sandbox? I have tried the following process and have been unsucessful- am I missing a step or doing something incorrectly?
  1. Within the sandbox, I've created an unmanaged package containing the custom object. I noticed that the package also automatically pulls in dependent classes, pages, etc. 
  2. I've pulled the package to my local environment using:
    sfdx force:mdapi:retrieve -s -r packages -u Sandbox -p objectexport
    
  3. I've unzipped the downloaded package.
  4. I've converted the package to DX format using:
    sfdx force:mdapi:convert -r packages\objectexportunzipped
  5. I then try pushing the converted object to the scratch org:
    sfdx force:source:push
The attempt errors out with dozens of "variable does not exist" and "invalid type" errors. From what I can see, it looks like the order the objects and classes are being pushed is causing the system to not see the dependent fields.

My end goal is to have a repeatable process to replicate custom objects from my sandbox to scratch orgs. 
While implementing emp API in LWC to subscribe the platform event I  find out that there is small issue in sample code snipit given in documentation.
Issue is in handleSubscribe method in js below is the code given in documentation:
handleSubscribe() {
        // Callback invoked whenever a new event message is received
        const messageCallback = function(response) {
            console.log('New message received : ', JSON.stringify(response));
            // Response contains the payload of the new message received
        };

        // Invoke subscribe method of empApi. Pass reference to messageCallback
        subscribe(this.channelName, -1, messageCallback).then(response => {
            // Response contains the subscription information on successful subscribe call
            console.log('Successfully subscribed to : ', JSON.stringify(response.channel));
            this.subscription = response;
            this.toggleSubscribeButton(true);
        });
    }
 Correction is required in messageCallback method which should be as below:
const messageCallback = (response) => {
        console.log('New message received : ', JSON.stringify(response));
        this.payload = JSON.stringify(response);
        console.log('this.payload: ' + this.payload);
        // Response contains the payload of the new message received
    };
We have to use arrow function as it does not have its own scope.  
I am working on transitioning my org's workflow from using Attachments to Files in order to be compatibile with Lightning. I have a specific use case I need guidance on:

In Classic, we have a work process in which an artist uploads an image file to a custom object record. This file is automatically renamed via an Apex controller to a standardized filename. We have a separate Visualforce page using the custom object as its standard controller (also using a custom Apex extension). The Visualforce page renders the image for printing (along with other related data from the record) by referencing the generic file name. 

For Lightning, I have built a Lightning component for file upload. This component uploads the image as a File/ ContentDocument associated with the custom object. How can I replicate similar functionality for the Visualforce page with Salesforce Files? My initial thought was to add a field to the custom object to store a URL for viewing the File, but I'm not sure how to generate such a URL. 
I am able to create a big object , also add fields for it . I have created PermissionSet . 
When i am trying to insert fields via apex , i get error for non indexed field . It shows 'variable doesnt exsit ' , I am able to add values via apex to indexed fields . 

Help will be appreciated .
What is the best method for populating a scratch org with custom objects and their fields from a sandbox? I have tried the following process and have been unsucessful- am I missing a step or doing something incorrectly?
  1. Within the sandbox, I've created an unmanaged package containing the custom object. I noticed that the package also automatically pulls in dependent classes, pages, etc. 
  2. I've pulled the package to my local environment using:
    sfdx force:mdapi:retrieve -s -r packages -u Sandbox -p objectexport
    
  3. I've unzipped the downloaded package.
  4. I've converted the package to DX format using:
    sfdx force:mdapi:convert -r packages\objectexportunzipped
  5. I then try pushing the converted object to the scratch org:
    sfdx force:source:push
The attempt errors out with dozens of "variable does not exist" and "invalid type" errors. From what I can see, it looks like the order the objects and classes are being pushed is causing the system to not see the dependent fields.

My end goal is to have a repeatable process to replicate custom objects from my sandbox to scratch orgs. 
Hello,
context- trailhead module : Quick Start: Quip Live Apps > Run Your Live App in Quip

I Had to install python in order to execute quip-apps in order to success.
Creating a app using a python :
C:\..\quip-apps-sdk-0.91\bin>C:\Users\e371495\AppData\Local\Programs\Python\Python36-32\python .\bin\quip-apps init myApp FCCAjAoobBu
INFO:root:Successfully initialized apps\myapp

I get an OK from npm install and build.
but I am not able to pack the application :
C:\..\quip-apps-sdk-0.91>C:\Users\e371495\AppData\Local\Programs\Python\Python36-32\python bin\quip-apps pack apps\myapp\app
I get the following :
User-added image
 
Thank you,
Christophe
Hello,
context- trailhead module : Quick Start: Quip Live Apps > Run Your Live App in Quip

I Had to install python in order to execute quip-apps in order to success.
Creating a app using a python :
C:\..\quip-apps-sdk-0.91\bin>C:\Users\e371495\AppData\Local\Programs\Python\Python36-32\python .\bin\quip-apps init myApp FCCAjAoobBu
INFO:root:Successfully initialized apps\myapp

I get an OK from npm install and build.
but I am not able to pack the application :
C:\..\quip-apps-sdk-0.91>C:\Users\e371495\AppData\Local\Programs\Python\Python36-32\python bin\quip-apps pack apps\myapp\app
I get the following :
User-added image
 
Thank you,
Christophe