Use the
this.template.querySelector('lightning-datatable').getSelectedRows()
to retrieve the selected rows.
<template>
<lightning-button onclick={processSelected} label="GetSelection">
</lightning-button>
<lightning-datatable
if:true={showProducts}
key-field="id"
data={products}
columns={columns}>
</lightning-datatable>
</template>
import {LightningElement, wire} from 'lwc';
const columns = [
{ label: 'Product Name', fieldName: 'Name', type: 'text' },
{ label: 'IsActive', fieldName: 'IsActive' ,type: 'boolean'},
{ label: 'Product Code', fieldName: 'ProductCode', type: 'text' },
{ label: 'Product Family', fieldName: 'Family' , type: 'text'},
];
export default class CategoryProductAssociation extends LightningElement {
products = [];
columns = columns;
searchKey;
showProducts = false;
categoryid;
processSelected(){
console.log("getSelectedRows => ",
this.template.querySelector('lightning-datatable').getSelectedRows());
}
}
Navigate to the CMS Home tab
Create a new Workspace if required (The workspace creation wizard let's you specify the languages, the contributors and the community that is associated with the workspace).
If you have not already enabled multiple languages, add one from the 'Languages' button on the Workspace home page. Flag an Article as 'Ready for Translation'
Navigate to the workspace and export all articles that are marked 'Ready for Translation'.
You will receive an email with a Zip file. Extract the Zip to find a file with a .xlf extension. Open the file in a XML editor (Wordpad / Winword etc for Windows and Textpad for Mac)
Update the TARGET attributes with the translated content.
Zip the file again. Import the translated content back into Salesforce.
View the translated content under the 'Translations' tab.
Use ContentVersion to create the file and use ContentDocumentLink to link the file to a record.
Here is a link to the official documentation for creating custom content types and new content. Link: https://developer.salesforce.com/blogs/2019/11/use-the-cms-app-to-create-content.html
As per the documentation you could use the below endpoint to fetch details about an existing content type. However, i was not able to find the {your-contenttype-id}. If you find a way please comment it here
As per the documentation you could use the below endpoint to fetch details about an existing content type. However, i was not able to find the {your-contenttype-id}. If you find a way please comment it here
You can also download the metadata files as described below. Create a package.xml file with the content as shown below, make sure the API version is 47.0 and higher.
Use the workbench to retrieve metadata as shown below.
Salesforce CMS (Content Management System) allows you to manage content documents.
A content type allows you to define the fields for a content. For example you could have blog posts, faq, how-to-article etc as content types. The below post describes how to create a new content type since this cannot be created with the Setup customization.
Use the workbench to create a new content type. A new content type allows you to define the fields for your content.
Endpoint:
/services/data/v47.0/tooling/sobjects/ManagedContentType/
Request Body:
Note that the 'isLocalizable' attribute determines if this field can be translated or not.
The data type of the field that be created is mentioned here. https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_managedcontenttype.htm (Check the nodeType entry in the table)
A content type allows you to define the fields for a content. For example you could have blog posts, faq, how-to-article etc as content types. The below post describes how to create a new content type since this cannot be created with the Setup customization.
Use the workbench to create a new content type. A new content type allows you to define the fields for your content.
Endpoint:
/services/data/v47.0/tooling/sobjects/ManagedContentType/
Request Body:
Note that the 'isLocalizable' attribute determines if this field can be translated or not.
The data type of the field that be created is mentioned here. https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_managedcontenttype.htm (Check the nodeType entry in the table)









