April 2020

Salesforce

LWC for Flow in Salesforce

HTML: <template>    <lightning-datatable key-field="Id"                          data={contacts}                          columns={columns}                          hide-checkbox-column="true"                          show-row-number-column="true"                         onrowaction={handleRowAction}>     </lightning-datatable> </template> JavaScript: import { LightningElement, api, track } from 'lwc';import { NavigationMixin } from 'lightning/navigation';const ....

Salesforce

How to wrap text in a table in LWC in Salesforce?

Sample code: HTML: <template>    <div class="slds-box slds-theme_default">         <table class="slds-table slds-table_cell-buffer slds-table_bordered slds-table_col-bordered">            <thead>                <tr>                    <th scope="col">                        <div class="slds-truncate" title="Account Name">Name</div>                    </th>                    <th class="" scope="col">                        <div class="slds-truncate" title="Account Industry">Industry</div>                    </th>                    ....

Salesforce

Sample/Example XmlStreamWriter using Apex in Salesforce

Sample Code: XmlStreamWriter w = new XmlStreamWriter();w.writeStartDocument( null, '1.0' );w.writeStartElement( null, 'test', null );w.writeStartElement( null, 'example', null );w.writeAttribute( null, null, 'email', '[email protected]' );w.writeCharacters( 'sample' );w.writeEndElement();w.writeEndElement();w.writeEndDocument();String payload = w.getXmlString();system.debug( 'Payload is ....