tag:blogger.com,1999:blog-31555644793944841662024-03-13T22:20:24.786+05:30I Love Coding.....You?Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.comBlogger248125tag:blogger.com,1999:blog-3155564479394484166.post-46209436965852259192023-10-17T19:58:00.005+05:302023-10-17T20:00:09.013+05:30Issue - Quick Text Is Not Showing Under The Selected Folder After It's Created In Salesforce<div><br /></div><span style="font-size: medium;"><span style="background-color: #ea9999;"><b><u><i>QuickText :</i></u></b> </span>As name suggest it's used to configure the commonly used sentences or streamline the agents responses in chat, email and phone call to speed up the closure of the case etc. These are similar to email templates only but can be used across the multiple channels.</span><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">Ideally while creating these Quicktext we will be selecting the folder where this should go and save so that we can provide the access to these QuickText for an user using the folder only.</span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">We have identified one issue where even after the desired folder selected while creating the new Quicktext but these Quicktext not showing under selected folder it's going under all folder/all QuickText .</span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">So ,quick fix for this to update the folder for all these Quicktext can be done either using the Apex code snippet or using the SOQL.</span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">Go to folder where you want to place the QuickText and copy the folder id from the url .</span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">Just run the query on QuickText object to get the all the templates where FolderId is blank or you can just query your QuickText by using the Name.</span></div><div><br /></div><div><br /></div><div><div style="background-color: #1f1f1f; color: #cccccc; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div> <span style="color: #4ec9b0;">List</span><<span style="color: #4ec9b0;">QuickText</span>> <span style="color: #9cdcfe;">lisQtextToUpdate</span> <span style="color: #d4d4d4;">=</span> <span style="color: #c586c0;">new</span> <span style="color: #4ec9b0;">List</span><<span style="color: #4ec9b0;">QuickText</span>>();</div><div> <span style="color: #c586c0;">for</span> (<span style="color: #4ec9b0;">QuickText</span> <span style="color: #9cdcfe;">qt</span> <span style="color: #c586c0;">:</span>[<span style="color: #4ec9b0;">SELECT</span> <span style="color: #9cdcfe;">Id</span>,<span style="color: #9cdcfe;">Name</span>,<span style="color: #4ec9b0;">FolderId</span> <span style="color: #4ec9b0;">From</span> <span style="color: #4ec9b0;">QuickText</span> <span style="color: #4ec9b0;">WHERE</span> <span style="color: #9cdcfe;">FolderId</span><span style="color: #d4d4d4;">=</span> Null])</div><div> {</div><div> <span style="color: #9cdcfe;">qt</span>.<span style="color: #9cdcfe;">FolderId</span> <span style="color: #d4d4d4;">=</span> <span style="color: #d4d4d4;"><</span><span style="color: #4ec9b0;">Your</span> <span style="color: #4ec9b0;">Folder</span> Id<span style="color: #d4d4d4;">></span>;</div><div> <span style="color: #9cdcfe;">lisQtextToUpdate</span>.<span style="color: #dcdcaa;">add</span>(qt);</div><div> }</div><br /><div> <span style="color: #c586c0;">if</span> (<span style="color: #d4d4d4;">!</span><span style="color: #9cdcfe;">lisQtextToUpdate</span>.<span style="color: #dcdcaa;">isEmpty</span>())</div><div> update lisQtextToUpdate;</div></div></div><div><br /></div><div><br /></div><div><span style="font-family: inherit; font-size: medium;">Happy Learning π</span></div><div><span style="font-family: inherit; font-size: medium;"><br /></span></div><div><span style="font-family: inherit; font-size: medium;"><br /></span></div><div><span style="font-family: inherit; font-size: medium;"> <span style="background-color: white; color: #222222;">Please comment or write us if you have any queries/requirements.</span></span></div><div class="separator" style="background-color: white; clear: both; color: #222222; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-weight: 400; text-align: left;"><div style="color: #222222;"><span style="font-family: inherit; font-size: medium;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222;"><span style="font-family: inherit; font-size: medium;"><br /></span></div><div style="color: #222222;"><span face="verdana, geneva, sans-serif"><span style="font-family: inherit; font-size: medium;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222;"><span style="font-family: inherit; font-size: medium;"><br /></span></div><div style="color: #222222;"><span style="font-family: inherit; font-size: medium;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222;"><span color="rgba(0, 0, 0, 0.9)"><span style="font-family: inherit; font-size: medium;"><br /></span></span></p><h3 style="background-color: white; color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: inherit; font-size: medium;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3><div><br /></div><div><br /><div><br /></div><div><br /><div><br /></div><div><br /></div></div></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-41386995646642808822023-10-16T16:29:00.002+05:302023-10-16T16:29:35.495+05:30How To Check The Given Email Field Value Is Present In The List Of Email Ids In Salesforce Workflow, Formula and Flows<p><span style="font-family: inherit;">The use case here is I want to check whether case email is available given in the list of email ids or not? If it's present in the list it will return true else it will return false.</span></p><p><span style="font-family: inherit;"><br /></span></p><p><span style="font-family: inherit;">IF<span style="color: #009900;">(</span></span></p><pre class="javascript"><span style="font-family: inherit;"> FIND<span style="color: #009900;">(</span>Your Email Filed<span style="color: #339933;">,</span><span style="color: #3366cc;">'test@gmail.com,man.6233@gmail.com,hello@haptik.co,</span></span></pre><pre class="javascript"><span style="color: #3366cc; font-family: inherit;">pk.kk@gmail.com,support@jugnoo.in,msj@gmail.com,mailer-daemon@amazonses.com,</span></pre><pre class="javascript"><span style="font-family: inherit;"><span style="color: #3366cc;">sales@kks.com,l.dyj@licindia.com'</span><span style="color: #009900;">)</span> <span style="color: #339933;">></span> <span style="color: #cc0000;">0</span><span style="color: #339933;">,</span>TRUE<span style="color: #339933;">,</span>FALSE
<span style="color: #009900;">)</span></span></pre><pre class="javascript"><span style="font-family: inherit;"><span style="color: #009900;"><br /></span></span></pre><pre class="javascript"><span style="font-family: inherit;"><span style="color: #009900;">Example:</span></span></pre><pre class="javascript"><span style="font-family: inherit;"><span style="color: #009900;"><br /></span></span></pre><pre class="javascript"><p style="font-family: "Times New Roman"; white-space: normal;"><span style="font-family: inherit;">IF<span style="color: #009900;">(</span></span></p><pre class="javascript"><span style="font-family: inherit;"> FIND<span style="color: #009900;">(</span><span>SuppliedEMail</span><span style="color: #339933;">,</span><span style="color: #3366cc;">'test@gmail.com,man.6233@gmail.com,hello@haptik.co,</span></span></pre><pre class="javascript"><span style="color: #3366cc; font-family: inherit;">pk.kk@gmail.com,support@jugnoo.in,msj@gmail.com,mailer-daemon@amazonses.com,</span></pre><pre class="javascript"><span style="font-family: inherit;"><span style="color: #3366cc;">sales@kks.com,l.dyj@licindia.com'</span><span style="color: #009900;">)</span> <span style="color: #339933;">></span> <span style="color: #cc0000;">0</span><span style="color: #339933;">,</span>TRUE<span style="color: #339933;">,</span>FALSE
<span style="color: #009900;">)</span></span></pre></pre><pre class="javascript"><span style="font-family: inherit;"><span style="color: #009900;"><br /></span></span></pre><pre class="javascript"><span style="color: #009900; font-family: inherit;"><br /></span></pre><pre class="javascript" style="font-family: monospace;"><span style="color: #009900;"><br /></span></pre>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-80658672928290298382023-08-15T21:31:00.003+05:302023-08-15T21:31:25.422+05:30Broadcasting /InApp Guidance in Salesforce <p>Want to broadcast some important information like downtime etc to all your Salesforce users through notifications on Salesforce Screen ?</p><p>Looking for something where you want to update all your users with latest release updates in a single screen or with multiple screens?</p><p>Want to understand how many of users are really acknowledged the latest features updates?</p><p>If you want to track all these metrics how much of customizations or coding i have to do π€? What if your a Salesforce Administrator want to do this</p><p>Don't worry either your a Salesforce Developer or Administrator we can do all these things less than 5 minutes without writing any codeπ€ trust me you heard right π</p><p><br /></p><p>Yes in salesforce there is a inbuilt feature called β InApp Guidance β. With help of this we can broadcast the important information to all your users with simple point and click. You can also share the recent release update in single screen or with navigation and you can also track who have viewed these release updates or gone through this funnel or not through Salesforce Reports.</p><p><a href="https://help.salesforce.com/s/articleView?id=sf.customhelp_lexguid.htm&language=en_US&type=5" target="_blank">Salesforce reference documents</a> </p><p>Happy Learning π </p><p>Please follow and subscribe for more information. </p>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-47849353103559950572023-06-08T17:27:00.004+05:302023-06-08T17:28:26.810+05:30How To Convert Array of Escaped Object String to String Object In Go Language<p>In our<a href="https://www.srinivas4sfdc.com/2023/06/how-to-convert-escaped-array-of-objects.html" target="_blank"> previous post</a> we have learn how to convert the array/list of string objects into map and now with help of this map we can convert the array of objects in string format single object string.</p><p><b><u><i>Source Code:</i></u></b></p>
<b><u><i><!--HTML generated using hilite.me--></i></u></b><div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-weight: bold;">package</span> main
<span style="color: #008800; font-weight: bold;">import</span> (
<span style="background-color: #fff0f0;">"encoding/json"</span>
<span style="background-color: #fff0f0;">"fmt"</span>
)
<span style="color: #008800; font-weight: bold;">type</span> GenericHeader <span style="color: #008800; font-weight: bold;">struct</span> {
Key <span style="color: #333399; font-weight: bold;">string</span> <span style="background-color: #fff0f0;">`json:"key"`</span>
Value <span style="color: #333399; font-weight: bold;">string</span> <span style="background-color: #fff0f0;">`json:"value"`</span>
}
<span style="color: #008800; font-weight: bold;">func</span> main() {
escapeJsonString <span style="color: #333333;">:=</span> <span style="background-color: #fff0f0;">"[{\"value\":\"123456\",\"key\":\"hash-key\"},</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="background-color: #fff0f0;"> {\"value\":\"srinivas4sfdc\",\"key\":\"requesting-host\"},</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="background-color: #fff0f0;"> {\"value\":\"token-based-authorization-policy\",\"key\":\"policy-name\"},</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="background-color: #fff0f0;"> {\"value\":\"application/x-www-form-urlencoded\",\"key\":\"Content-Type\"}]"</span></pre><pre style="line-height: 125%; margin: 0px;"> fmt.Println(<span style="background-color: #fff0f0;">"Input data:"</span>, <span style="color: #007020;">string</span>(escapeJsonString))
<span style="color: #008800; font-weight: bold;">var</span> headers []GenericHeader
err <span style="color: #333333;">:=</span> json.Unmarshal([]<span style="color: #007020;">byte</span>(escapeJsonString), <span style="color: #333333;">&</span>headers)
<span style="color: #008800; font-weight: bold;">if</span> err <span style="color: #333333;">!=</span> <span style="color: #008800; font-weight: bold;">nil</span> {
fmt.Println(<span style="background-color: #fff0f0;">"Error:"</span>, err)
<span style="color: #008800; font-weight: bold;">return</span>
}
headerMap <span style="color: #333333;">:=</span> <span style="color: #007020;">make</span>(<span style="color: #008800; font-weight: bold;">map</span>[<span style="color: #333399; font-weight: bold;">string</span>]<span style="color: #333399; font-weight: bold;">string</span>)
<span style="color: #008800; font-weight: bold;">for</span> _, header <span style="color: #333333;">:=</span> <span style="color: #008800; font-weight: bold;">range</span> headers {
fmt.Println(header.Key <span style="color: #333333;">+</span> <span style="background-color: #fff0f0;">".."</span> <span style="color: #333333;">+</span> header.Value)
headerMap[header.Key] = header.Value
}
fmt.Println(<span style="background-color: #fff0f0;">"Final Map Data==>"</span>, headerMap)
marshalData, err <span style="color: #333333;">:=</span> json.Marshal(headerMap)
<span style="color: #008800; font-weight: bold;">if</span> err <span style="color: #333333;">!=</span> <span style="color: #008800; font-weight: bold;">nil</span> {
fmt.Println(err.Error())
<span style="color: #008800; font-weight: bold;">return</span>
}
fmt.Println(<span style="background-color: #fff0f0;">"marshalData==>"</span>, marshalData)
fmt.Println(<span style="background-color: #fff0f0;">"Final Object String ==>"</span>, <span style="color: #007020;">string</span>(marshalData))
}
</pre></div><br /><div><b><u><i>Input Data String:</i></u></b></div><div><br /></div><div><div style="line-height: 19px;"> "[{\"value\":\"123456\",\"key\":\"hash-key\"},{\"value\":\"srinivas4sfdc\",\"key\":\"requesting-host\"},{\"value\":\"token-based-authorization-policy\",\"key\":\"policy-name\"},{\"value\":\"application/x-www-form-urlencoded\",\"key\":\"Content-Type\"}]"</div><div style="line-height: 19px;"><br /><div><div style="background-color: #fffffe; font-family: Menlo, Monaco, Consolas, "Lucida Console", "Roboto Mono", "Courier New", monospace, Consolas, "Courier New", monospace; font-size: 14px; white-space: pre;"><b><u><i>Output Data String:</i></u></b></div><div style="background-color: #fffffe; font-family: Menlo, Monaco, Consolas, "Lucida Console", "Roboto Mono", "Courier New", monospace, Consolas, "Courier New", monospace; font-size: 14px; white-space: pre;"><b><u><i><br /></i></u></b></div> {"Content-Type":"application/x-www-form-urlencoded","hash-key":"123456","policy-name":"token-based-authorization-policy","requesting-host":"srinivas4sfdc"}
<br /><br /><div style="background-color: #fffffe; font-family: Menlo, Monaco, Consolas, "Lucida Console", "Roboto Mono", "Courier New", monospace, Consolas, "Courier New", monospace; font-size: 14px; white-space: pre;"><br style="font-family: "Times New Roman"; font-size: medium; white-space: normal;" /></div></div><div style="background-color: #fffffe; font-family: Menlo, Monaco, Consolas, "Lucida Console", "Roboto Mono", "Courier New", monospace, Consolas, "Courier New", monospace; font-size: 14px; white-space: pre;"><div class="separator" style="background-color: white; clear: both; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; text-align: center; white-space: normal;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; white-space: normal;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; margin: 0px; position: relative; text-align: center; white-space: normal;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></div><div style="background-color: #fffffe; font-family: Menlo, Monaco, Consolas, "Lucida Console", "Roboto Mono", "Courier New", monospace, Consolas, "Courier New", monospace; font-size: 14px; white-space: pre;"></div></div></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-9569546117477022282023-06-08T17:12:00.004+05:302023-06-08T17:14:24.829+05:30How To Convert Escaped Array of Objects String Into Map in Go Lang<p>Let's assume you have array of objects in escaped string format and you want to convert them to <span style="color: #008800; font-weight: bold;">map</span>[<span style="color: #333399; font-weight: bold;">string</span>]<span style="color: #333399; font-weight: bold;">string</span> we can use the below code format.</p>
<!--HTML generated using hilite.me--><div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-weight: bold;">package</span> main
<span style="color: #008800; font-weight: bold;">import</span> (
<span style="background-color: #fff0f0;">"encoding/json"</span>
<span style="background-color: #fff0f0;">"fmt"</span>
)
<span style="color: #008800; font-weight: bold;">type</span> GenericHeader <span style="color: #008800; font-weight: bold;">struct</span> {
Key <span style="color: #333399; font-weight: bold;">string</span> <span style="background-color: #fff0f0;">`json:"key"`</span>
Value <span style="color: #333399; font-weight: bold;">string</span> <span style="background-color: #fff0f0;">`json:"value"`</span>
}
<span style="color: #008800; font-weight: bold;">func</span> main() {
escapeJsonString <span style="color: #333333;">:=</span> <span style="background-color: #fff0f0;">"[{\"value\":\"123456\",\"key\":\"hash-key\"},{\"value\":\"srinivas4sfdc\",\"key\":\"requesting-host\"},{\"value\":\"token-based-authorization-policy\",\"key\":\"policy-name\"},{\"value\":\"application/x-www-form-urlencoded\",\"key\":\"Content-Type\"}]"</span>
fmt.Println(<span style="background-color: #fff0f0;">"Input data:"</span>, <span style="color: #007020;">string</span>(escapeJsonString))
<span style="color: #008800; font-weight: bold;">var</span> headers []GenericHeader
err <span style="color: #333333;">:=</span> json.Unmarshal([]<span style="color: #007020;">byte</span>(escapeJsonString), <span style="color: #333333;">&</span>headers)
<span style="color: #008800; font-weight: bold;">if</span> err <span style="color: #333333;">!=</span> <span style="color: #008800; font-weight: bold;">nil</span> {
fmt.Println(<span style="background-color: #fff0f0;">"Error:"</span>, err)
<span style="color: #008800; font-weight: bold;">return</span>
}
headerMap <span style="color: #333333;">:=</span> <span style="color: #007020;">make</span>(<span style="color: #008800; font-weight: bold;">map</span>[<span style="color: #333399; font-weight: bold;">string</span>]<span style="color: #333399; font-weight: bold;">string</span>)
<span style="color: #008800; font-weight: bold;">for</span> _, header <span style="color: #333333;">:=</span> <span style="color: #008800; font-weight: bold;">range</span> headers {
fmt.Println(header.Key <span style="color: #333333;">+</span> <span style="background-color: #fff0f0;">".."</span> <span style="color: #333333;">+</span> header.Value)
headerMap[header.Key] = header.Value
}
fmt.Println("Final Map Data==>",headerMap)
}
</pre><pre style="line-height: 125%; margin: 0px;"><br /></pre></div><div><br /></div><br /><div><b><u><i>Input Data:</i></u></b></div><div><b><u><i><br /></i></u></b></div><div><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="background-color: #fff0f0;">"[{\"value\":\"123456\",\"key\":\"hash-key\"},{\"value\":\"srinivas4sfdc\",\"key\":\"requesting-host\"}]"</span>
<br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><div style="font-family: "Times New Roman"; white-space: normal;"><b><u><i>Output Data:</i></u></b></div><div style="font-family: "Times New Roman"; white-space: normal;"><b><u><i><br /></i></u></b></div><div><span style="font-family: Times New Roman;"><span style="white-space: normal;">map[</span></span><span style="background-color: #fff0f0;">requesting-host</span><span style="font-family: "Times New Roman"; white-space: normal;">:</span><span style="background-color: #fff0f0;">srinivas4sfdc</span><span style="font-family: "Times New Roman"; white-space: normal;"> </span><span style="background-color: #fff0f0;">hash-key</span><span style="font-family: "Times New Roman"; white-space: normal;">:</span><span style="background-color: #fff0f0;">123456</span><span style="font-family: "Times New Roman"; white-space: normal;">]</span></div><div><span style="font-family: "Times New Roman"; white-space: normal;"><br /></span></div><div><span style="font-family: "Times New Roman"; white-space: normal;"><br /></span></div><div><span style="font-family: "Times New Roman"; white-space: normal;"><br /></span></div><div><div class="separator" style="background-color: white; clear: both; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; text-align: center; white-space: normal;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; white-space: normal;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; margin: 0px; position: relative; text-align: center; white-space: normal;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></div><div><b><u><i><br /></i></u></b></div></pre></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-22192024867391662952023-04-20T08:54:00.003+05:302023-06-08T17:13:14.114+05:30How To Send Set of Ids or Set of Records From Lwc Component To Apex Method<div style="text-align: left;">If you're planning to use the set as the one of the parameter of your apex function and the same need to passed from lwc js look at these limitations below.</div><div style="text-align: left;"><br /></div><div style="text-align: left;"><ul style="text-align: left;"><li>By default @AuraEnabled methods will not accept /allow to use the set of Records as the parameter. </li><li>In detail, it's not only support set of Records even if you try to pass of set of Ids, set of strings and set of Records it will not work because it's doesn't support set data type it self.</li></ul><div>The work around for this is </div><div><br /></div><div><ul style="text-align: left;"><li>The @AuraEnabled method again will support the list as a parameter so you either convert parameter from set to list is one option.</li><li>You can also try out the convert the set of Records into string in lwc using the Json.stringify() and change the your apex method param to string and inside method you can deserialize the string to set in side the apex method. </li></ul></div></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com1tag:blogger.com,1999:blog-3155564479394484166.post-50270386949971653802023-04-18T14:10:00.002+05:302023-04-18T14:10:37.030+05:30Not exported by package compiler Unexported Name Error in Go Language<p><span style="background-color: white; color: #222222;"><span style="font-family: arial;">In Go language the functions can be exported with help of the keyword called "package" and same can be reused by importing in other classes with help of key word called "import".</span></span></p><div style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-size: medium;"><span style="font-family: arial;">Even after making the function available to be used in other classes if your receiving the error called "not exported by package " please check if the below solution works for you.</span></span></div><p style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-size: medium;"><span style="font-family: arial;"><i style="background-color: #fcff01;">The first letter of the function should be capital letter</i><i> otherwise even you exported you can't find this function when you try to reference in other classes. So make sure that if any method that you want to re-used please declare with Capital letters.</i></span></span></p><div style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 16.5px; margin-bottom: 0px; margin-top: 0px;">firstClass.<span style="color: #008800; font-weight: bold;">go</span>
=======================================
<span style="color: #008800; font-weight: bold;">package</span> connectors
<span style="color: #008800; font-weight: bold;">import</span> (
<span style="background-color: #fff0f0;">"fmt"</span>,
<span style="background-color: #fff0f0;">"time"</span>
)
<span style="color: #008800; font-weight: bold;">func</span> isNewToGoLang(<span style="color: #333399; font-weight: bold;">string</span> mobile) (isnew <span style="color: #333399; font-weight: bold;">bool</span>){
<span style="color: #008800; font-weight: bold;">if</span> mobile <span style="color: #333333;">==</span> <span style="color: #008800; font-weight: bold;">nil</span>
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">false</span>
<span style="color: #008800; font-weight: bold;">else</span>
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">true</span>
}
secondClass.<span style="color: #008800; font-weight: bold;">go</span></pre><pre style="line-height: 16.5px; margin-bottom: 0px; margin-top: 0px;">==================================
<span style="color: #008800; font-weight: bold;">import</span> (
fclass <span style="background-color: #fff0f0;">"/connectors"</span>
)
<span style="color: #008800; font-weight: bold;">func</span> checkAccess(){
resp =: fclass.isNewToGoLang(<span style="background-color: #fff0f0;">"1234"</span>)
}
</pre></div><br /></div><div style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-size: medium;"><span style="font-family: arial;">Here I'm trying to access the method called isNewToGoLang() which is delcared in firstClass.go in secondClass.go ,even though i have exported the function still i'm getting an error because the first character of the method is small letter so it will not work.</span></span></div><div style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-size: medium;"><span style="font-family: arial;"><br /></span></span></div><div style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-size: medium;"><span style="font-family: arial;">As mentioned above if i update the method name with capital letter it will work as expected.</span></span></div><div style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><br /></div><div style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><br /><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 16.5px; margin-bottom: 0px; margin-top: 0px;">firstClass.<span style="color: #008800; font-weight: bold;">go</span></pre><pre style="line-height: 16.5px; margin-bottom: 0px; margin-top: 0px;">--------------------------------------
<span style="color: #008800; font-weight: bold;">package</span> connectors
<span style="color: #008800; font-weight: bold;">import</span> (
<span style="background-color: #fff0f0;">"fmt"</span>,
<span style="background-color: #fff0f0;">"time"</span>
)
<span style="color: #008800; font-weight: bold;">func</span> <span style="background-color: #fcff01;">Is</span>NewToGoLang(<span style="color: #333399; font-weight: bold;">string</span> mobile) (isnew <span style="color: #333399; font-weight: bold;">bool</span>){
<span style="color: #008800; font-weight: bold;">if</span> mobile <span style="color: #333333;">==</span> <span style="color: #008800; font-weight: bold;">nil</span>
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">false</span>
<span style="color: #008800; font-weight: bold;">else</span>
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">true</span>
}
secondClass.<span style="color: #008800; font-weight: bold;">go</span></pre><pre style="line-height: 16.5px; margin-bottom: 0px; margin-top: 0px;">------------------------------------
<span style="color: #008800; font-weight: bold;">import</span> (
fclass <span style="background-color: #fff0f0;">"/connectors"</span>
)
<span style="color: #008800; font-weight: bold;">func</span> checkAccess(){
resp =: fclass.<span style="background-color: #fcff01;">Is</span>NewToGoLang(<span style="background-color: #fff0f0;">"1234"</span>)
}
</pre></div></div><p style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"></p><div class="separator" style="background-color: white; clear: both; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-90775269920150724642023-04-17T18:24:00.070+05:302023-04-18T14:04:31.135+05:30How Convert Pointer *bool to bool or *string to string in go lang functions<p><span style="font-family: inherit; font-size: medium;">Most of the use cases in any technology the functions will be returning the some response either in string ,bool,float,int or some custom struct format. This is the basis use case in our regular programming.</span></p><p><span style="font-family: inherit; font-size: medium;">Similarly in Go language if your writing any simple functions will return the same data types mentioned above or sometimes as pointer reference also will be returned.</span></p><p><span style="font-family: inherit; font-size: medium;">In case if function returning the pointer reference how to converted the same pointer reference to it's underlying data type will be discussed in this post. If we are not converting we will be receiving the error as "<span style="background-color: #fcff01;">cannot use yourvariableName (variable of type *bool/string/int) as bool/string/int value in assignment compilerIncompatibleAssign "</span></span></p><p><span style="font-family: inherit; font-size: medium;">Example : Pointer bool to bool or pointer string to string</span></p><!--HTML generated using hilite.me--><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="background-color: white; color: #008800; font-weight: bold;">package</span><span style="background-color: white;"> main
</span><span style="background-color: white; color: #008800; font-weight: bold;">import</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">"fmt"</span><span style="background-color: white;">
</span><span style="background-color: white; color: #008800; font-weight: bold;">func</span><span style="background-color: white;"> main() {
</span><span style="background-color: white; color: #008800; font-weight: bold;">var</span><span style="background-color: white;"> resp </span><span style="background-color: white; color: #333333;">*</span><span style="background-color: white; color: #333399; font-weight: bold;">bool</span><span style="background-color: white;">
resp = isNewToGoLang(</span><span style="background-color: #fff0f0;">"8888888888"</span><span style="background-color: white;">)
</span><span style="background-color: #fcff01;"><span style="color: #008800; font-weight: bold;">var</span> isNewVar <span style="color: #333399; font-weight: bold;">bool</span>
<span style="color: #008800; font-weight: bold;">if</span> resp <span style="color: #333333;">!=</span> <span style="color: #008800; font-weight: bold;">nil</span> {
isNewVar = <span style="color: #333333;">*</span>resp
fmt.Println(<span>"Is New Var "</span>, isNewVar)
}</span><span style="background-color: white;">
}
</span><span style="background-color: white; color: #008800; font-weight: bold;">func</span><span style="background-color: white;"> isNewToGoLang(mobile any) </span><span style="background-color: white; color: #333333;">*</span><span style="background-color: white; color: #333399; font-weight: bold;">bool</span><span style="background-color: white;"> {
varFalse </span><span style="background-color: white; color: #333333;">:=</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">false</span><span style="background-color: white;">
varTrue </span><span style="background-color: white; color: #333333;">:=</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">true</span><span style="background-color: white;">
</span><span style="background-color: white; color: #008800; font-weight: bold;">if</span><span style="background-color: white;"> mobile </span><span style="background-color: white; color: #333333;">==</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">nil</span><span style="background-color: white;"> {
</span><span style="background-color: white; color: #008800; font-weight: bold;">return</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">nil</span><span style="background-color: white;">
}
</span><span style="background-color: white; color: #008800; font-weight: bold;">if</span><span style="background-color: white;"> mobile </span><span style="background-color: white; color: #333333;">!=</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">nil</span><span style="background-color: white;"> {
</span><span style="background-color: white; color: #008800; font-weight: bold;">return</span><span style="background-color: white;"> </span><span style="background-color: white; color: #333333;">&</span><span style="background-color: white;">varTrue
}
</span><span style="background-color: white; color: #008800; font-weight: bold;">return</span><span style="background-color: white;"> </span><span style="background-color: white; color: #333333;">&</span><span style="background-color: white;">varFalse
}
</span></pre></div><div><br /></div><div class="separator" style="background-color: white; clear: both; color: #222222; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-33922364069117990692023-03-29T17:54:00.010+05:302023-04-18T14:11:50.802+05:30How To Read The Values From Empty Interface Used During The JSON.Unmarshal in Go Language<div style="text-align: left;"><span style="font-family: inherit;">When we don't know the type of the json structure or it's in dynamic nature usually we will use empty interfaces to handle these types.</span></div><div style="text-align: left;"><span style="font-family: inherit;"><br />Whenever you want to read values using the key from this empty interface ideally we need to convert this interface to map type interface using the type conversion.</span></div><div style="text-align: left;"><span style="font-family: inherit;"><br />Once it's converted to map we can use the map["keyname"] format to get the corresponding value from the json. </span></div><p style="text-align: left;"><br /></p><div class="separator" style="background-color: white; clear: both; color: #222222; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px; text-align: left;"><span><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-71474870691085812972023-03-29T17:46:00.002+05:302023-04-18T16:12:15.097+05:30How To Convert An Interface To String in Go Lang<p> If you're trying to convert an interface{} or map of interface values to string use the fmt.Sprint() function. </p><div class="separator" style="background-color: white; clear: both; color: #222222; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-90931772492694378762023-03-24T16:34:00.006+05:302023-03-27T13:30:19.802+05:30How To Convert Array to Slice in Go LanguageArray is a fixed in size and can't be increased/decreased the size at run time where as Slices are dynamic in nature like can be decreased or increased the size automatically at runtime basis on the number of elements added to it.<div><br /></div><div>To convert the array to slice at anytime we can use simply :(dot notation) shown in below</div><h4 style="text-align: left;"><br /><b><u><i>Source Code:</i></u></b></h4><div><!--HTML generated using hilite.me--><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="background-color: white; color: #008800; font-weight: bold;">package</span><span style="background-color: white;"> main
</span><span style="background-color: white; color: #008800; font-weight: bold;">import</span><span style="background-color: white;"> (
</span><span style="background-color: #fff0f0;">"fmt"</span><span style="background-color: white;">
</span><span style="background-color: #fff0f0;">"reflect"</span><span style="background-color: white;">
)
</span><span style="background-color: white; color: #008800; font-weight: bold;">func</span><span style="background-color: white;"> main() {
arr </span><span style="background-color: white; color: #333333;">:=</span><span style="background-color: white;"> [</span><span style="background-color: white; color: #0000dd; font-weight: bold;">4</span><span style="background-color: white;">]</span><span style="background-color: white; color: #333399; font-weight: bold;">string</span><span style="background-color: white;">{</span><span style="background-color: #fff0f0;">"go"</span><span style="background-color: white;">, </span><span style="background-color: #fff0f0;">"lang"</span><span style="background-color: white;">, </span><span style="background-color: #fff0f0;">"main"</span><span style="background-color: white;">, </span><span style="background-color: #fff0f0;">"sree"</span><span style="background-color: white;">}
fmt.Println(</span><span style="background-color: #fff0f0;">"Arr is of type..."</span><span style="background-color: white;">, reflect.TypeOf(arr))
</span><span style="background-color: #fcff01;">arr2 <span style="color: #333333;">:=</span> arr[:]</span><span style="background-color: white;"> //Converts arr of type array to slice arr2
fmt.Println(</span><span style="background-color: #fff0f0;">"Arr2 is of type.."</span><span style="background-color: white;">, reflect.TypeOf(arr2))
}
</span></pre></div>
<br /><b><u><i>Output:<br /></i></u></b><div><br /></div><div><pre class="Playground-output" style="background-color: #f8f8f8; border-radius: 0px; box-sizing: border-box; color: #202224; font-family: Menlo, monospace; font-size: 0.875rem; line-height: 1.4; margin-bottom: 0px; margin-top: 0px; overflow-x: auto; padding: 0px;"><span class="stdout" style="box-sizing: border-box;">Arr is of type... [4]string
Arr2 is of type.. []string</span></pre><pre class="Playground-output" style="background-color: #f8f8f8; border-radius: 0px; box-sizing: border-box; color: #202224; font-family: Menlo, monospace; font-size: 0.875rem; line-height: 1.4; margin-bottom: 0px; margin-top: 0px; overflow-x: auto; padding: 0px;"><span class="stdout" style="box-sizing: border-box;"><br /></span></pre><pre class="Playground-output" style="background-color: #f8f8f8; border-radius: 0px; box-sizing: border-box; color: #202224; font-family: Menlo, monospace; font-size: 0.875rem; line-height: 1.4; margin-bottom: 0px; margin-top: 0px; overflow-x: auto; padding: 0px;"><span class="stdout" style="box-sizing: border-box;"><div class="separator" style="background-color: white; clear: both; color: #222222; font-family: "Times New Roman"; font-size: medium; text-align: center; white-space: normal;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-weight: 400; text-align: left;"><div style="color: #222222;"><span><span style="font-family: verdana; font-size: small;"><br /></span></span></div><div style="color: #222222;"><span><span style="font-family: verdana; font-size: small;"><br /></span></span></div><div style="color: #222222;"><span><span style="font-family: verdana; font-size: small;"><br /></span></span></div><div style="color: #222222;"><span><span style="font-family: verdana; font-size: small;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222;"><span style="font-family: verdana; font-size: small;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222;"><span style="font-family: verdana; font-size: small;"><br /></span></div><div style="color: #222222;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana; font-size: small;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222;"><span style="font-family: verdana; font-size: small;"><br /></span></div><div style="color: #222222;"><span style="font-family: verdana; font-size: small;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-family: "Times New Roman"; font-size: 13.2px; white-space: normal;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; font-family: "Times New Roman"; margin: 0px; position: relative; text-align: center; white-space: normal;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></span></pre><pre class="Playground-output" style="background-color: #f8f8f8; border-radius: 0px; box-sizing: border-box; color: #202224; font-family: Menlo, monospace; font-size: 0.875rem; line-height: 1.4; margin-bottom: 0px; margin-top: 0px; overflow-x: auto; padding: 0px;"><span class="stdout" style="box-sizing: border-box;"><br /></span></pre><pre class="Playground-output" style="background-color: #f8f8f8; border-radius: 0px; box-sizing: border-box; color: #202224; font-family: Menlo, monospace; font-size: 0.875rem; line-height: 1.4; margin-bottom: 0px; margin-top: 0px; overflow-x: auto; padding: 0px;"><span class="stdout" style="box-sizing: border-box;"><br /></span></pre></div><div><br /></div></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-86887102186106031882023-03-09T11:51:00.006+05:302023-03-27T13:37:02.795+05:30How To Add List/Set of Records to List in Go Language<p><span style="font-size: medium;">In Go language if we want to add single record/list of records we can use the append() method. But here is the trick adding the single item is pretty much forward and while adding the list/set of records we might face some issue.</span></p><p><span style="font-size: medium;">Now we will discuss how to handle both the scenarios</span></p><p><span style="font-size: medium;"><b><u><i>Adding a single item/record to list/array:</i></u></b></span></p><!--HTML generated using hilite.me--><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="font-size: medium;"><span style="background-color: white; color: #008800; font-weight: bold;">package</span><span style="background-color: white;"> main
</span><span style="background-color: white;">func main() {
</span><span style="background-color: white;">
</span><span style="background-color: white; color: #008800; font-weight: bold;">var</span><span style="background-color: white;"> finalItemList []string
</span><span style="background-color: white; color: #008800; font-weight: bold;">var</span><span style="background-color: white;"> singleItem string
</span><span style="background-color: #fcff01;">finalItemList <span style="color: #333333;">=</span> append(finalItemList, singleItem)</span></span><span style="background-color: white;"><span style="font-size: medium;">
}</span>
</span></pre></div>
<p><u style="font-size: large;"><i><b>Adding multiple items/list to another list/array:</b></i></u></p><p><span style="font-size: medium;">To add list of items to another list with help of append() we will receive an error as <span style="background-color: #fcff01;">can not use variable of type of list/array as a data type value in argument to append.</span></span></p><p><span style="font-size: medium;">To solve this simply we can just use<span style="background-color: #fcff01;"> Spread operator ... (3 dots) notation</span> as shown below.</span></p><p><!--HTML generated using hilite.me--></p><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="font-size: medium;"><span style="background-color: white; color: #008800; font-weight: bold;">package</span><span style="background-color: white;"> main
func main() {
</span><span style="background-color: white; color: #008800; font-weight: bold;">var</span><span style="background-color: white;"> finalItemList []string
</span><span style="background-color: white; color: #008800; font-weight: bold;">var</span><span style="background-color: white;"> secondItemList []string
finalItemList <span style="color: #333333;">=</span> append(finalItemList, </span><span style="background-color: #fcff01;">secondItemList...)</span><span style="background-color: white;">
}
</span></span></pre></div>
<p></p><p><span style="font-size: medium;"><br /></span></p><div class="separator" style="background-color: white; clear: both; color: #222222; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-weight: 400; text-align: left;"><div style="color: #222222;"><span><span style="font-family: verdana; font-size: small;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222;"><span style="font-family: verdana; font-size: small;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222;"><span style="font-family: verdana; font-size: small;"><br /></span></div><div style="color: #222222;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana; font-size: small;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222;"><span style="font-family: verdana; font-size: small;"><br /></span></div><div style="color: #222222;"><span style="font-family: verdana; font-size: small;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3><p><span style="font-size: medium;"><br /></span></p><p><u style="font-size: large;"><i><b><br /></b></i></u></p><p><span style="font-size: medium;"><b><u><i><br /></i></u></b></span></p>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-2010255027977215052023-02-13T18:53:00.002+05:302023-02-13T18:53:26.295+05:30How To Add a New Record To Existing List Of Records in LWC JS Controller<p><span style="font-size: medium;">Let's assume we are getting list of records from the apex to js controller and for some reasons if we want to add new row how can we add to it we can see below.</span></p>
<!--HTML generated using hilite.me--><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="background-color: white; color: #008800; font-weight: bold;">import</span><span style="background-color: white;"> { LightningElement, api, track, wire } from </span><span style="background-color: #fff0f0;">"lwc"</span><span style="background-color: white;">;
</span><span style="background-color: white; color: #008800; font-weight: bold;">import</span><span style="background-color: white;"> fetchActivities from </span><span style="background-color: #fff0f0;">"@salesforce/apex/CancelFlowCntrl.fetchCanActivities"</span><span style="background-color: white;">;
</span><span style="background-color: white; color: #008800; font-weight: bold;">const</span><span style="background-color: white;"> columns </span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;"> [
{ label</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'ticketvalue'</span><span style="background-color: white;">, fieldName</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'totalTicketvalue'</span><span style="background-color: white;"> },
{ label</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'refundedAmount'</span><span style="background-color: white;">, fieldName</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'totalRefundedAmount'</span><span style="background-color: white;"> },
{ label</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'cancellationCharges'</span><span style="background-color: white;">, fieldName</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'totCancellationCharges'</span><span style="background-color: white;"> },
];
</span><span style="background-color: white; color: #008800; font-weight: bold;">export</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">default</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">class</span><span style="background-color: white;"> ActivitiesFlow </span><span style="background-color: white; color: #008800; font-weight: bold;">extends</span><span style="background-color: white;"> LightningElement
{
</span><span style="background-color: #ffaaaa; color: red;">@</span><span style="background-color: white;">track allActivitiesData;
</span><span style="background-color: #ffaaaa; color: red;">@</span><span style="background-color: white;">wire(fetchActivities, { recdId</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'$sfrecordId'</span><span style="background-color: white;"> })
wiredActivities({ error, data }) {
</span><span style="background-color: white; color: #008800; font-weight: bold;">if</span><span style="background-color: white;"> (data)
{
</span><span style="background-color: white; color: #008800; font-weight: bold;">this</span><span style="background-color: white;">.allActivitiesData </span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;"> data;
</span><span style="background-color: #fcff01;"> <span style="color: #008800; font-weight: bold;">var</span> newItem <span style="color: #333333;">=</span> {<span>"totalTicketvalue"</span><span style="color: #333333;">:</span> <span style="color: #0000dd; font-weight: bold;">100</span>,<span>"totalRefundedAmount"</span><span style="color: #333333;">:</span> <span style="color: #0000dd; font-weight: bold;">90</span>,<span>"totCancellationCharges"</span><span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">10</span>};
<span style="color: #008800; font-weight: bold;">this</span>.allActivitiesData.push(newItem);</span><span style="background-color: white;">
}
</span><span style="background-color: white; color: #008800; font-weight: bold;">else</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">if</span><span style="background-color: white;"> (error) {
</span><span style="background-color: white; color: #008800; font-weight: bold;">this</span><span style="background-color: white;">.error </span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;"> error;
</span><span style="background-color: white; color: #008800; font-weight: bold;">this</span><span style="background-color: white;">.allActivitiesData </span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">undefined</span><span style="background-color: white;">;
}
}
}
</span></pre></div><div><br /></div><div class="separator" style="background-color: white; clear: both; color: #222222; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span><span style="font-family: verdana;"><br /></span></span></div><div style="color: #222222; font-size: 13.2px;"><span><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-3060964085987173472023-02-13T18:10:00.000+05:302023-02-13T18:10:00.284+05:30How To Perform Arithmetic Operation in LWC Lightning Data Table In Salesforce <span style="font-size: medium;">Let's assume we are getting a response from apex class for a cancelled ticket with details like total amount paid and refunded amount after cancellation.</span><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">If i would like to perform/display the cancellation charges on screen with help of deducting the Total Refunded Amount from the Total Paid amount .In this article we will see how can we perform this in simple steps while using the LWC data table.</span></div><div><br /><!--HTML generated using hilite.me--><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="background-color: white; color: #008800; font-weight: bold;">import</span><span style="background-color: white;"> { LightningElement, api, track, wire } from </span><span style="background-color: #fff0f0;">"lwc"</span><span style="background-color: white;">;
</span><span style="background-color: white; color: #008800; font-weight: bold;">import</span><span style="background-color: white;"> fetchActivities from </span><span style="background-color: #fff0f0;">"@salesforce/apex/CancelFlowCntrl.fetchCanActivities"</span><span style="background-color: white;">;
</span><span style="background-color: white; color: #008800; font-weight: bold;">const</span><span style="background-color: white;"> columns </span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;"> [
{ label</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'ticketvalue'</span><span style="background-color: white;">, fieldName</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'totalTicketvalue'</span><span style="background-color: white;"> },
{ label</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'refundedAmount'</span><span style="background-color: white;">, fieldName</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'totalRefundedAmount'</span><span style="background-color: white;"> },
{ label</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'cancellationCharges'</span><span style="background-color: white;">, fieldName</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'totCancellationCharges'</span><span style="background-color: white;"> },
];
</span><span style="background-color: white; color: #008800; font-weight: bold;">export</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">default</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">class</span><span style="background-color: white;"> ActivitiesFlow </span><span style="background-color: white; color: #008800; font-weight: bold;">extends</span><span style="background-color: white;"> LightningElement
{
</span><span style="background-color: #ffaaaa; color: red;">@</span><span style="background-color: white;">track allActivitiesData;
</span><span style="background-color: #ffaaaa; color: red;">@</span><span style="background-color: white;">wire(fetchActivities, { recdId</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0;">'$sfrecordId'</span><span style="background-color: white;"> })
wiredActivities({ error, data }) {
</span><span style="background-color: white; color: #008800; font-weight: bold;">if</span><span style="background-color: white;"> (data)
{
</span><span style="background-color: white; color: #008800; font-weight: bold;">this</span><span style="background-color: white;">.allActivitiesData </span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;"> data.map( record </span><span style="background-color: white; color: #333333;">=></span><span style="background-color: white;"> </span><span style="background-color: white; color: #007020;">Object</span><span style="background-color: white;">.assign(
{ </span><span style="background-color: #fff0f0;">"totalTicketvalue"</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> record.apiResptotalTicketvalue,
</span><span style="background-color: #fff0f0;">"totalRefundedAmount"</span><span style="background-color: white; color: #333333;">:</span><span style="background-color: white;"> record.apiResptotalRefundedAmount,
</span><span style="background-color: #fcff01;"> <span>"totCancellationCharges"</span><span style="color: #333333;">:</span> record.apiResptotalTicketvalue<span style="color: #333333;">-</span>record.apiResptotalRefundedAmount
</span><span style="background-color: white;"> },record
)
);
}
</span><span style="background-color: white; color: #008800; font-weight: bold;">else</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">if</span><span style="background-color: white;"> (error) {
</span><span style="background-color: white; color: #008800; font-weight: bold;">this</span><span style="background-color: white;">.error </span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;"> error;
</span><span style="background-color: white; color: #008800; font-weight: bold;">this</span><span style="background-color: white;">.allActivitiesData </span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;"> </span><span style="background-color: white; color: #008800; font-weight: bold;">undefined</span><span style="background-color: white;">;
}
}
}
</span></pre></div><div><br /></div><div><div class="separator" style="background-color: white; clear: both; color: #222222; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></div></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-52929772274083871152022-12-16T15:35:00.006+05:302022-12-16T15:38:49.524+05:30Embedded Messaging with host domain value cannot be hosted on domain Error In Salesforce<div><span style="font-family: verdana;"><b><i style="background-color: #ea9999;"><u>Issue:</u></i></b></span></div><span style="font-family: verdana;"><div><span style="font-family: verdana;"><br /></span></div>These types of errors mostly pops up when your working any kind of the Messaging Systems/Live Agent Chat or Messaging In App and Web chat features in salesforce.</span><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">In my case this error is on "Messaging In App and Web" chat configuration.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">When your configuring the this </span><span style="font-family: verdana;">Messaging In App and Web </span><span style="font-family: verdana;">we need to create a Embedded Service Deployment to deploy this chat button in on your company/local websites.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;"><b><i><u style="background-color: #b6d7a8;">Solution:</u></i></b></span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">If we look at "</span><span style="font-family: verdana;">Embedded Service Deployment" configuration it will have bunch of the key properties we need to setup like</span></div><div><span style="font-family: verdana;"><br /></span></div><div><ul style="text-align: left;"><li><span style="font-family: verdana;">Embedded Service Deployment Name</span></li><li><span style="font-family: verdana;">Site Endpoint</span></li><li><span style="font-family: verdana;">Domain</span></li><li><span style="font-family: verdana;">Messaging Channel</span></li></ul><div><span style="font-family: verdana;">But now we will discuss more about the Domain property details and it's behavior.</span></div></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;"><b><i>Domain</i></b>: This domain is the main key reason for this issue. Ideally here we need to add the domain name of your company/website where your going add this chat button on web. So, this code can be hosted on this server without any error.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">So if here you have entered domain as "srinivas4sfdc.com" in your configuration ideally this code snippet you need add on this site only else you will receive the same error.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">In my case I have added my domain name as my company domain address like <i><b>yourcompany.com,yourcompanydomain.in</b></i> etc and when I'm try to add this code snippet on my website domain "<i><b>srinivas4sfdc.com</b></i>" I'm getting the same error.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;"><b><i><u>Deployment Setup Screen:</u></i></b></span></div><div><span style="font-family: verdana;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoCCwyxR8RVv4cqHI4tqlXhtcMC7KYhVtnae9qo4ZSh2acR4JrXDhtet655Jyq6pcLb9bqHWgTQpworJEhlrsfDa0vDqba_hkBwbYCoY2DNJSKkddkpk2j4_iHyz74ALwRheuSUT_-_UqjA-UR_VZYFo5Mex2TOCJJT48zpcgJSGlDBOPxsQvXbumQNQ/s854/ch2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="602" data-original-width="854" height="453" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoCCwyxR8RVv4cqHI4tqlXhtcMC7KYhVtnae9qo4ZSh2acR4JrXDhtet655Jyq6pcLb9bqHWgTQpworJEhlrsfDa0vDqba_hkBwbYCoY2DNJSKkddkpk2j4_iHyz74ALwRheuSUT_-_UqjA-UR_VZYFo5Mex2TOCJJT48zpcgJSGlDBOPxsQvXbumQNQ/w640-h453/ch2.PNG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b><i><u>Error On Website:</u></i></b></div><div class="separator" style="clear: both; text-align: left;"><b><i><u><br /></u></i></b></div><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-SPE1C6RHIyY3fCqHdECFteyxzFzTQ0LTw1GjLGvw7-JnTE9VLCTVRPSa6zeMJZxEwV6h8XCn4HbE3WKPB53KzC4gwoI3NVujl_AYF3R8jtl4QTFTqfIaDlCcIPhMyxXeMEnJuXswhXqBJ-TQZ9h8gzu2l9563HSxvQhCBqpIMCg6hKIXRmePjsgdnw/s1313/cha.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="437" data-original-width="1313" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-SPE1C6RHIyY3fCqHdECFteyxzFzTQ0LTw1GjLGvw7-JnTE9VLCTVRPSa6zeMJZxEwV6h8XCn4HbE3WKPB53KzC4gwoI3NVujl_AYF3R8jtl4QTFTqfIaDlCcIPhMyxXeMEnJuXswhXqBJ-TQZ9h8gzu2l9563HSxvQhCBqpIMCg6hKIXRmePjsgdnw/w640-h214/cha.PNG" width="640" /></a></div><br /><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;"><br /></span></div><div><div class="separator" style="background-color: white; clear: both; color: #222222; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-81468160755809625532022-12-16T13:12:00.006+05:302022-12-16T13:18:08.853+05:30How To End The Live Agent REST API Chat In Salesforce<p><span style="font-family: times; font-size: medium;">If your planning to implement the Live Agent Chat we can use of 2 approaches as listed below</span></p><p></p><ol style="text-align: left;"><li><span style="font-family: times; font-size: medium;"> With help of the Embedded Services code snippet generated by salesforce</span></li><li><span style="font-family: times; font-size: medium;"> Using the Salesforce Live Agent REST API Integration.</span></li></ol><div><span style="font-family: times; font-size: medium;"><br /></span></div><div><span style="font-family: times; font-size: medium;">In this article we will discuss about how to end the chat initiated by the "Salesforce Live Agent REST API Integration" using the API's in Salesforce.</span></div><div><span style="font-family: times; font-size: medium;"><br /></span></div><div><span style="font-family: times; font-size: medium;">When I looked at the Salesforce document it's feels me very simple but while doing the actual integration I have faced couple of issue .So, I thought of sharing the same with you guys so that if you have come across same concerns it will clear lot of issues.</span></div><div><span style="font-family: inherit; font-size: medium;"><br /></span></div><div><span style="font-family: times; font-size: medium;">Salesforce Document :</span></div><div><span style="font-family: times; font-size: medium;"><a href="https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/live_agent_rest/live_agent_rest_ChatEnd.htm">https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/live_agent_rest/live_agent_rest_ChatEnd.htm</a></span></div><div><span style="font-family: times; font-size: medium;"><br /></span></div><div><b><u><span style="font-family: times; font-size: medium;">Key Points :</span></u></b></div><div><b><u><span style="font-family: times; font-size: medium;"><br /></span></u></b></div><div><b><span style="font-family: times; font-size: medium;">1. Is the Request body is valid: </span></b></div><div><b><span style="font-family: times; font-size: medium;"><br /></span></b></div><div><span style="font-family: times; font-size: medium;">Yes ,it's valid json body ,even i had the same conception but it's worked with body type raw json/ raw text and the possible request bodies are listed below and it worked for me with any of body request.</span></div><div><span style="font-family: inherit; font-size: medium;"><br /></span></div><div><span style="font-family: inherit; font-size: medium;"><!--HTML generated using hilite.me--></span><div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="font-family: inherit; font-size: medium;">1. {<span style="color: #007700;">"reason"</span>:<span style="background-color: #fff0f0;">"client"</span>}
2. {<span style="background-color: #ffaaaa; color: red;">reason:</span><span style="color: #007700;">"client"</span>}
3. {<span style="color: #007700;">"type"</span>:<span style="background-color: #fff0f0;">"ChatEndReason"</span>,<span style="color: #007700;">"reason"</span>:<span style="background-color: #fff0f0;">"client"</span>}
</span></pre></div>
<span style="font-family: inherit; font-size: medium;"><br /></span></div><div><b><u><span style="font-family: times; font-size: medium;">Possible Values for "reason" property:</span></u></b></div><div><b><u><span style="font-family: times; font-size: medium;"><br /></span></u></b></div><span style="font-family: times; font-size: medium;">-For value, 'agent' cannot be used. As this will be a rest call that will be fired by end used, then how is it possible that agent has ended the chat.<br /><br />- For value, 'clienttimeout', it cannot be explicitly sent as this is value that will be set automatically when the chat ends if end user takes more than configured time to reply.<br /><br />- For value, 'client', it works fine and it is the only intended value that should be sent.</span><div><span style="font-family: times; font-size: medium;"><br /></span></div><div><span style="font-family: times; font-size: medium;"><b><u>2.Header Values(Check Underscore and Hypon):</u></b></span></div><div><span style="font-family: times; font-size: medium;"><b><u><br /></u></b></span></div><div><span style="font-family: times; font-size: medium;"><b><div><pre style="color: #333333; font-weight: 400; line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;">X-LIVEAGENT-API-<span style="color: #997700; font-weight: bold;">VERSION:</span><span style="color: #0000dd; font-weight: bold;">56</span>
X-LIVEAGENT-<span style="color: #997700; font-weight: bold;">AFFINITY:</span><span style="color: #6600ee; font-weight: bold;">10.44</span>.<span style="color: #6600ee; font-weight: bold;">144.152</span>:<span style="color: #0000dd; font-weight: bold;">443</span>
X-LIVEAGENT-SESSION-<span style="color: #997700; font-weight: bold;">KEY:</span><span style="color: #0000dd; font-weight: bold;">1</span>a71214c-e!<span style="color: #0000dd; font-weight: bold;">1671173289038</span>!qwUZfQ56kOpSHSRIOINyBZRoGug=</pre></div></b></span></div><div style="background-color: #fffffe; line-height: 18px; white-space: pre;"><span style="font-family: times; font-size: medium;"><br /></span></div><div style="background-color: #fffffe; line-height: 18px;"><span style="font-size: medium;"><span style="font-family: times; white-space: pre;">These 3 keys would be fine enough and sequence is not required. The below both </span></span></div><div style="background-color: #fffffe; line-height: 18px;"><span style="font-size: medium;"><span style="font-family: times; white-space: pre;">values will taken from the <a href="https://www.srinivas4sfdc.com/2019/12/unable-to-fetch-affinitytoken-from.html" target="_blank">Session API</a> which will be invoked initially to start the </span></span></div><div style="background-color: #fffffe; line-height: 18px;"><span style="font-size: medium;"><span style="font-family: times; white-space: pre;">live agent chat session.</span></span></div><div style="background-color: #fffffe; line-height: 18px;"><span style="font-size: medium;"><span style="font-family: times; white-space: pre;"><br /></span></span></div><div style="line-height: 18px;"><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times; font-size: medium;"><span style="color: #333333;"><span style="background-color: #fffffe;">X-LIVEAGENT-</span></span><span style="background-color: #fffffe; color: #997700; font-weight: bold; white-space: pre;">AFFINITY: </span>aa:bb:ccc:ddd:443 format/hetehksd (8 digit alphanumeric token) both are valid</span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times; font-size: medium;"><span style="color: #333333;"><span style="background-color: #fffffe;">X-LIVEAGENT-SESSION-</span></span><span style="background-color: #fffffe; color: #997700; font-weight: bold; white-space: pre;">KEY: </span>We need to take the key value not the id value from session api.</span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times; font-size: medium;"><br /></span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><b style="font-size: large; white-space: normal;"><u><span style="font-family: times;">3. Sample Request:</span></u></b></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><b style="font-size: large; white-space: normal;"><u><span style="font-family: times;"><br /></span></u></b></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times;"> End Point - https://hostname/chat/rest/Chasitor/ChatEnd</span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times;"> Type <span> </span><span> - Post</span></span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times;"> Headers - As mentioned above</span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times;"> RequestBody - As mentioned above</span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times;"><br /></span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times;"><br /></span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="font-family: times;"><b>Sample Curl:</b></span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span><b><br /></b></span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="background-color: #fcff01;"> Update your chat setting url in host name</span></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><!--HTML generated using hilite.me--><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">curl <span style="color: #333333;">--</span>location <span style="color: #333333;">--</span>request POST <span style="background-color: #fff0f0;">'https://hostname/chat/rest/Chasitor/ChatEnd'</span> <span style="color: #333333;">\</span>
<span style="color: #333333;">--</span>header <span style="background-color: #fff0f0;">'X-LIVEAGENT-API-VERSION: 56'</span> <span style="color: #333333;">\</span>
<span style="color: #333333;">--</span>header <span style="background-color: #fff0f0;">'X-LIVEAGENT-AFFINITY: 11.58.224.242:443'</span> <span style="color: #333333;">\</span>
<span style="color: #333333;">--</span>header <span style="background-color: #fff0f0;">'X-LIVEAGENT-SESSION-KEY: 1a71214c-ed05-8383-a0c3-db568dbd6903!1671173289038!qwUZfQ56kOpSHSRIOINyBZRoGug='</span> <span style="color: #333333;">\</span>
<span style="color: #333333;">--</span>header <span style="background-color: #fff0f0;">'Content-Type: application/json'</span> <span style="color: #333333;">\</span>
<span style="color: #333333;">--</span>data<span style="color: #333333;">-</span>raw <span style="background-color: #fff0f0;">'{"reason":"client"}'</span>
</pre></div>
<br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhF_3WVA7mP0F4LzbVQVTykAY4BC14rE2tYI2WD3Bf5rvIfJ2dsZ2mlxzJcmTRzyWURe5tL0mVZwRwNZGModC3QykCbzbSlSC4NwREg5MD29cKXgAVxu9Nm3HBV9KMvyptEFy5cdj5O1T48_RYyM8dTZcADkSdJFxRS4glDXAnxiaGsTXNE0VOWq5LoYQ" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="" data-original-height="573" data-original-width="932" height="394" src="https://blogger.googleusercontent.com/img/a/AVvXsEhF_3WVA7mP0F4LzbVQVTykAY4BC14rE2tYI2WD3Bf5rvIfJ2dsZ2mlxzJcmTRzyWURe5tL0mVZwRwNZGModC3QykCbzbSlSC4NwREg5MD29cKXgAVxu9Nm3HBV9KMvyptEFy5cdj5O1T48_RYyM8dTZcADkSdJFxRS4glDXAnxiaGsTXNE0VOWq5LoYQ=w640-h394" width="640" /></a></div><br /><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><br /></pre><pre style="line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><div class="separator" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjD88bB-u2QmNheA1KdxhBCWyUNeJO_ybbIplY-tRcPr-cFT78TWSPgLDtjLtW6Ze0yMpcL5fWI3YnfRIKrBthixnokhx2HDiMtkd9s1Ddw8bcMtbg4vWC6Pp47kR-Wk87O-yc7iIOQkkh0yyX1VaWJ17ol9fT3KU-4ZjaEyvM7Lr91idGpF41VUsWSKA" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="" data-original-height="483" data-original-width="982" height="314" src="https://blogger.googleusercontent.com/img/a/AVvXsEjD88bB-u2QmNheA1KdxhBCWyUNeJO_ybbIplY-tRcPr-cFT78TWSPgLDtjLtW6Ze0yMpcL5fWI3YnfRIKrBthixnokhx2HDiMtkd9s1Ddw8bcMtbg4vWC6Pp47kR-Wk87O-yc7iIOQkkh0yyX1VaWJ17ol9fT3KU-4ZjaEyvM7Lr91idGpF41VUsWSKA=w640-h314" width="640" /></a></div><div class="separator" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><span style="font-family: inherit; font-size: medium;"><br /></span></div><div class="separator" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><span style="font-family: times; font-size: medium;">If your receiving the below status code please check once</span></div><div class="separator" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><span style="font-family: times; font-size: medium;"> - 403 You initiated the request but no agent's are available to accept the chat so <span style="text-align: left;">please </span></span></div><div class="separator" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><span style="font-family: times; font-size: medium;"><span style="text-align: left;">check</span> the <a href="https://www.srinivas4sfdc.com/2019/12/live-agent-chat-rest-api-to-check.html" target="_blank">agent availability</a> api before call session api/chat visitor session api.</span></div><div class="separator" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><span style="font-family: times; font-size: medium;">- 400 You might have the error in your end point or headers or body.</span></div><div class="separator" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><span style="font-family: inherit; font-size: medium;"><br /></span></div><div class="separator" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><div style="text-align: left; white-space: normal;"><span style="font-family: times; font-size: medium;">Happy Learning π </span></div><div style="text-align: left; white-space: normal;"><span style="font-family: times; font-size: medium;"><br /></span></div><div style="text-align: left; white-space: normal;"><span style="font-family: times; font-size: medium;"><br /></span></div><div style="text-align: left; white-space: normal;"><div class="separator" style="clear: both; color: #222222; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-weight: 400; text-align: left;"><div style="color: #222222;"><span><span style="font-family: times; font-size: medium;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222;"><span style="font-family: times; font-size: medium;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222;"><span style="font-family: times; font-size: medium;"><br /></span></div><div style="color: #222222;"><span face="verdana, geneva, sans-serif"><span style="font-family: times; font-size: medium;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222;"><span style="font-family: times; font-size: medium;"><br /></span></div><div style="color: #222222;"><span style="font-family: times; font-size: medium;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="color: #222222;"><span color="rgba(0, 0, 0, 0.9)"><span style="font-family: times; font-size: medium;"><br /></span></span></p><h3 style="color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: times; font-size: medium;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></div></div><span style="font-family: inherit;"><br /></span><br /></pre></pre></div><p></p>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-31623320692813306902022-08-10T16:52:00.003+05:302022-08-10T16:58:33.412+05:30Push Topics In Salesforce <p><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">We might have heard about the Push topics,</span><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;"> If not these are mainly used for generating the events basis on some criteria defined on the SOQL </span><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">and all these events will be consumed by the all the subscribers of the topic.</span></p><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">Let's assume if you have created some functionality using the </span><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">Push topics either on </span><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white;"><span style="font-family: -apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif;"><span style="font-size: 14px;">VisualForce</span></span><a href="http://" style="font-size: 14px;"> </a><span style="font-size: 14px;">or in </span></span>#lightningwebcomponents<span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">. It's Working as expected whenever there is change in specified object record etc..</span><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">We have refreshed the sandbox from the production and the same functionality is not working in sandbox π€. Interesting what is missing here regarding </span>#pushtopics<span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">.</span><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">The point to be noted here is when we created any </span>#pushtopics<span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;"> either on production or sandbox salesforce by defaults creates an entry in </span>#pushtopic<span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;"> table as a record data not like metadata.</span><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">So, obviously when we refreshed the sandbox the records/data will not be created in sandbox from production only metadata will be copied from the production.</span><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">If you need these </span>#pushtopic<span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;"> you need to create it again in sandbox manually.</span><div><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"><span style="font-size: 14px;"><br /></span></span><div><div>Happy Learning π </div><div><br /></div><div><br /></div><div><div class="separator" style="clear: both; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="color: #222222; font-family: Verdana, Geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></div></div></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-49777280926886630742022-07-26T21:26:00.002+05:302022-07-26T21:26:53.989+05:30How To Download the Package.xml Using the Outbound Change Set Name<p>As we know the easiest way to deploy the components from sandbox to sandbox/production by using the Change Sets. Some times we might end up use cases where change sets might not be supported and we are trying to deploying using the ANT, Workbench or Visual Code. In all these cases we might need the package.xml file is required either to retrieve the package or to deploy the package.</p><p>Preparing the package.xml file by adding the each component manually is little bit of hard .So, I want to try adding the all the list of components using the change set name because it's easy to add from the UI and with help of change set name I want to download the package.xml for further processing. </p><p>Is it really possible to download the package.xml file using the change set name π€? The simple answer is Yes ,we can do this by following the below steps .</p><p><br /></p><p>1. Go to Setup ---> Search for Outbound Change Sets.</p><p>2. Click on New --> Enter Change set name and Description.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi28QR_XMDyg4sN93lNrEX8ggR1afYzu1bZFCmfuo2JvQ6TE_rtPYsgu22McS6820W4rVbHHpztXHkAyGnWe2MwRZmk8swo6eohi6b6zMh7ZivHrChf6FbYAm5rI9qEZuHPV-QPIQlBLLXS--EVtqToHRRI3auzDU5rqPV3_gMKZUhr3OoW0rFo5Y5zJg/s759/bot.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="491" data-original-width="759" height="414" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi28QR_XMDyg4sN93lNrEX8ggR1afYzu1bZFCmfuo2JvQ6TE_rtPYsgu22McS6820W4rVbHHpztXHkAyGnWe2MwRZmk8swo6eohi6b6zMh7ZivHrChf6FbYAm5rI9qEZuHPV-QPIQlBLLXS--EVtqToHRRI3auzDU5rqPV3_gMKZUhr3OoW0rFo5Y5zJg/w640-h414/bot.JPG" width="640" /></a></div><br /><p><br /></p><p>3. Add all the components you want to deploy.</p><p>4. Copy the Change set name as shown below.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs49y5Bi0ah_HwpfMfSBxOG7CSCH7haBCw1ueUETqb7yic22MyRTvqHABXHBx74PtdAA8r1q9ylq5yt3ZavsuzdJI1dMZxiPTK7rHkF8ezU5GLVHXycBnHJf-2joG76vZotYHg7vuHYgIgVF9lFxGQXgmzV7rMXiMPNyPfmf2VRannWMujK09XV9RAVA/s932/bot2.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="561" data-original-width="932" height="386" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs49y5Bi0ah_HwpfMfSBxOG7CSCH7haBCw1ueUETqb7yic22MyRTvqHABXHBx74PtdAA8r1q9ylq5yt3ZavsuzdJI1dMZxiPTK7rHkF8ezU5GLVHXycBnHJf-2joG76vZotYHg7vuHYgIgVF9lFxGQXgmzV7rMXiMPNyPfmf2VRannWMujK09XV9RAVA/w640-h386/bot2.JPG" width="640" /></a></div><br /><p><br /></p><p>5.Login to the Workbench with same sandbox where change set is created.</p><p>6. Click on the retrieve option under the Migration.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2i7oxm3Hob5PVSzq_zSojO-55UpSmaQSFamIZPqBdDY_Bw5ii9_RSXQa7nXokYUPl4cw_eymsAH7T3qts6qmyV60Wlwpz7KQVYCg6nKRhbUnxhGjUbkW_ZBP2vc2Erw34oHR40WO2MinKwGR41pFqC_QbQq7xtaiODN_aOepKtDTH76lnMRPX3Wa6Jg/s1166/bolt3.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="490" data-original-width="1166" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2i7oxm3Hob5PVSzq_zSojO-55UpSmaQSFamIZPqBdDY_Bw5ii9_RSXQa7nXokYUPl4cw_eymsAH7T3qts6qmyV60Wlwpz7KQVYCg6nKRhbUnxhGjUbkW_ZBP2vc2Erw34oHR40WO2MinKwGR41pFqC_QbQq7xtaiODN_aOepKtDTH76lnMRPX3Wa6Jg/w640-h268/bolt3.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /><div class="separator" style="clear: both; text-align: center;"><br /></div></div><p>7. Enter the Change Set Name in Package Names text box and Check Single Package</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjjHR9_QgcYn-GMbyvMETQfkj2b3r1tngLBkqEtTqz-UXY0pDvFwukXT2gA265cPdgl9UbVIWNBSdUNdpyQaKejwtfzk_BJogB1WwrvNdMjH8HoR8vr89ni8SuXSRv4jKKN3UHJct4BJ083PKuCRhB4LsKb23_GwAh6uvWUIXqw4sON-z5CrRjgJH3cA/s1099/bolt4.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="536" data-original-width="1099" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjjHR9_QgcYn-GMbyvMETQfkj2b3r1tngLBkqEtTqz-UXY0pDvFwukXT2gA265cPdgl9UbVIWNBSdUNdpyQaKejwtfzk_BJogB1WwrvNdMjH8HoR8vr89ni8SuXSRv4jKKN3UHJct4BJ083PKuCRhB4LsKb23_GwAh6uvWUIXqw4sON-z5CrRjgJH3cA/w640-h312/bolt4.JPG" width="640" /></a></div><br /><p><br /></p><p>8. Click Next and then on Retrieve button.</p><p>9. Once Retrieve result Zip file is ready just click on download zip file.</p><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLnxT57Nhd2sL6TilapAXDxCmWxZSYZJA99_CuKJTIzZgwZzANLFbKEZx2k9ncZZ7IEEocHtllR7rpQREH_95e-SSXY2AMv7oL2nlofSpTXm3isr7yQhZDsmlEbjYP5R-NbZgVoEEMsJ8rWvCGqWEAPvnFOjKtIOV57gX-625RDBQVFoKRLQZJ0Wmiqw/s818/bolt5.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="621" data-original-width="818" height="486" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLnxT57Nhd2sL6TilapAXDxCmWxZSYZJA99_CuKJTIzZgwZzANLFbKEZx2k9ncZZ7IEEocHtllR7rpQREH_95e-SSXY2AMv7oL2nlofSpTXm3isr7yQhZDsmlEbjYP5R-NbZgVoEEMsJ8rWvCGqWEAPvnFOjKtIOV57gX-625RDBQVFoKRLQZJ0Wmiqw/w640-h486/bolt5.JPG" width="640" /></a></div><p>10.Extract the file inside that you can see the package.xml file.</p><p><br /></p><div>Happy Learning π </div><div><br /></div><div><br /></div><div><br /></div><div><div class="separator" style="clear: both; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="color: #222222; font-family: Verdana, Geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></div><br /><p><br /></p><p><br /></p>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-91247197023199978002022-07-16T13:45:00.007+05:302023-04-18T16:13:19.108+05:30How To Stop Workflow Rules and Outbound Messages in Sandbox Automatically<p>We have couple of outbound messages linked under the workflow rules and all these outbound message will send some of custom objects data and standard objects data to external systems everytime any kind of DML operation happens on these objects. </p><p>Everything got set up and working as expected. But recently we have come across a situation where all the outbound messages are pushing data from sandboxes to same external systems assuming that we forgot to disable these workflow rules in sandbox before we activate it and somehow we missed to change the outbound messages end point from production to sandbox.</p><p>Because of all these things the sandbox data got messed up with the production data. So, we started exploring the options how can we stop all these Workflow rules automatically in sandbox or can we change the endpoint from production to stage automatically after refreshing the sandbox.</p><p>As a solution we come across multiple options but as a quick fix we have chosen to use the below solution.</p><p><br /></p><p>1. Identify the environment like sandbox or production.</p><p></p><ul style="text-align: left;"><li>Use the username to identify this assuming we will add sandbox name in the end of username but in production we will not have any name after email Id.</li><li>Use the SOQL to identify the environment </li></ul><div>2. Assuming we have decided to move with username flow create a formula field on User Object as Checkbox. </div><div><br /></div><div>3. Assume formula field name as "isProduction__c" and this will get updated to true in case of if user in production env and else false in sandbox.</div><div><br /></div><div>4. Use this field in all your workflow rule by adding CurrentUser under that select isProduction__c field.</div><div><br /></div><div>Now all your workflow rules will get evaluated to true if the logged in user in production else the rule will not get satisfied so your Workflow rules will not get fired in sandbox. </div><div><br /></div><div>With this approach we don't need to worry about the disabling the workflow rules and changing the outbound messages endpoints to stage. We can use other options to as well but we thought this is simple and easy to implement for Admins too...</div><div><br /></div><div>Happy Learning π </div><div><br /></div><div><div class="separator" style="clear: both; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif"><br /></span><span face="verdana, geneva, sans-serif">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="color: #222222; font-family: Verdana, Geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></div><p></p>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-48197057549699018042022-06-19T12:39:00.004+05:302023-04-18T16:14:36.681+05:30Salesforce Einstein Products<p> Salesforce Einstein Products</p><p>-----------------------------------------------------</p><p>As we know Salesforce has it's own artificial intelligence, natural language processing and deep learning technologies embedded product named it as "Einstein".</p><p>Some of this product features are already part of Salesforce clouds like sales cloud, service cloud and marketing cloud etc.. </p><p>As a developer if you want to use these feature to build out of box features use it as well. </p><p>Some of the key products of einstein are listed below. </p><p>1. Einstein Bot</p><p>2. Einstein Next Best Action</p><p>3. Einstein Case Classification</p><p>4. Einstein Discovery</p><p>5. Einstein Prediction Builder</p><p>6. Einstein Language</p><p>7. Einstein Vision</p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-60752698677524500562022-06-15T11:39:00.001+05:302023-04-18T16:15:10.219+05:30Write A Test Class For Getter and Setter Methods in Salesforce Apex<p><span style="font-size: medium;">Please use the below code snippet in you case you have getter and setter methods in your apex class and want to cover up the same lines in test class.</span></p><p><span style="font-size: medium;"><b><i><u>Main Class:</u></i></b></span></p><!--HTML generated using hilite.me--><div style="background: rgb(248, 248, 248); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">Public <span style="color: green; font-weight: bold;">class</span> <span style="color: blue; font-weight: bold;">SreeTestCase</span>
<span style="color: #666666;">{</span>
<span> </span><span style="color: green; font-weight: bold;">public</span> List<span style="color: #666666;"><</span>SelectOption<span style="color: #666666;">></span> caseStatusList
<span> </span><span style="color: #666666;">{</span>
get <span style="color: #666666;">{</span>
List<span style="color: #666666;"><</span>SelectOption<span style="color: #666666;">></span> options <span style="color: #666666;">=</span> <span style="color: green; font-weight: bold;">new</span> List<span style="color: #666666;"><</span>SelectOption<span style="color: #666666;">>();</span>
<span style="color: green; font-weight: bold;">for</span><span style="color: #666666;">(</span> Schema<span style="color: #666666;">.</span><span style="color: #7d9029;">PicklistEntry</span> f <span style="color: #666666;">:</span> Case<span style="color: #666666;">.</span><span style="color: #7d9029;">Status</span><span style="color: #666666;">.</span><span style="color: #7d9029;">getDescribe</span><span style="color: #666666;">().</span><span style="color: #7d9029;">getPicklistValues</span><span style="color: #666666;">())</span>
<span> </span><span style="color: #666666;">{</span>
options<span style="color: #666666;">.</span><span style="color: #7d9029;">add</span><span style="color: #666666;">(</span><span style="color: green; font-weight: bold;">new</span> SelectOption<span style="color: #666666;">(</span>f<span style="color: #666666;">.</span><span style="color: #7d9029;">getValue</span><span style="color: #666666;">(),</span> f<span style="color: #666666;">.</span><span style="color: #7d9029;">getLabel</span><span style="color: #666666;">()));</span>
<span style="color: #666666;">}</span>
<span style="color: green; font-weight: bold;">return</span> options<span style="color: #666666;">;</span>
<span> </span><span style="color: #666666;">}</span>
set<span style="color: #666666;">;</span>
<span> </span><span style="color: #666666;">}</span>
<span style="color: #666666;">}</span>
</pre></div>
<p><b style="font-size: large;"><i><u>Test Class:</u></i></b></p><!--HTML generated using hilite.me--><div style="background: rgb(248, 248, 248); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #aa22ff;">@isTest</span>
<span style="color: green; font-weight: bold;">private</span> <span style="color: green; font-weight: bold;">class</span> <span style="color: blue; font-weight: bold;">SreeTestCaseTestClass</span>
<span style="color: #666666;">{</span>
<span style="color: green; font-weight: bold;">static</span> testMethod <span style="color: #b00040;">void</span> <span style="color: blue;">testStatusList</span><span style="color: #666666;">()</span>
<span style="color: #666666;">{</span>
SreeTestCase st <span style="color: #666666;">=</span> <span style="color: green; font-weight: bold;">new</span> SreeTestCase<span style="color: #666666;">();</span>
List<span style="color: #666666;"><</span>SelectOption<span style="color: #666666;">></span> options <span style="color: #666666;">=</span> <span style="color: green; font-weight: bold;">new</span> List<span style="color: #666666;"><</span>SelectOption<span style="color: #666666;">>();</span>
options <span style="color: #666666;">=</span> st<span style="color: #666666;">.</span><span style="color: #7d9029;">caseStatusList</span><span style="color: #666666;">;</span>
<span style="color: #666666;">}</span>
<span style="color: #666666;">}</span>
</pre></div>
<p><span style="font-size: medium;"><b><i><u><br /></u></i></b></span></p><div style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><div class="separator" style="clear: both; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span style="font-size: 13.2px;"><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><br style="font-size: 13.2px;" /></span><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-27227632296748322592022-06-15T10:50:00.006+05:302023-04-18T16:13:52.354+05:30How to Delete (Bulk) Custom Metadata Records in Salesforce.<p><span style="font-family: verdana;"></span></p><p style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><b><i style="background-color: #ea9999;"> Scenario:</i></b></p><div><span style="font-family: verdana;">You might have used the "<a href="https://www.srinivas4sfdc.com/2016/01/setting-and-uploading-custom-metadata.html" target="_blank">Custom Metadata Loader</a>" to perform the bulk insert and bulk update. Sometimes it's might be required to perform the bulk delete also ,but unfortunately this tool doesn't support as of today.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="background-color: #04ff00;"><b style="color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><i>Solution:</i></b><br style="box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit;" /></span></div><p><span style="font-family: verdana;">So as a workaround we can have apex code snippet which can be used to perform the bulk deletion(in a single run max 200 records) of metadata .Please use the below code snippet for the same.</span></p><p><span style="font-family: verdana;"><b><i style="background-color: #fcff01;">Source Code:<!--HTML generated using hilite.me--></i></b></span></p><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span><span style="font-family: courier;">MetadataService<span style="color: #333333;">.</span><span style="color: #0000cc;">MetadataPort</span> service <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> MetadataService<span style="color: #333333;">.</span><span style="color: #0000cc;">MetadataPort</span><span style="color: #333333;">();</span>
<span style="color: #888888;">// Set the session id</span>
service<span style="color: #333333;">.</span><span style="color: #0000cc;">SessionHeader</span> <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> MetadataService<span style="color: #333333;">.</span><span style="color: #0000cc;">SessionHeader_element</span><span style="color: #333333;">();</span>
service<span style="color: #333333;">.</span><span style="color: #0000cc;">SessionHeader</span><span style="color: #333333;">.</span><span style="color: #0000cc;">sessionId</span> <span style="color: #333333;">=</span> UserInfo<span style="color: #333333;">.</span><span style="color: #0000cc;">getSessionId</span><span style="color: #333333;">();</span>
<span style="color: #888888;">//Add all your metadata records developer name to list</span>
List<span style="color: #333333;"><</span>String<span style="color: #333333;">></span> recordsToDelete <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> List<span style="color: #333333;"><</span>String<span style="color: #333333;">>();</span>
For<span style="color: #333333;">(</span>YourMedataDataName__mdt m <span style="color: #333333;">:[</span>SELECT Developername from YourMedataDataName__mdt Limit <span style="color: #0000dd; font-weight: bold;">200</span><span style="color: #333333;">])</span>
<span style="color: #333333;">{</span>
String s <span style="color: #333333;">=</span> <span style="background-color: #ffaaaa; color: red;">'</span>YourMedataDataName__mdt<span style="color: #333333;">.</span><span style="background-color: #ffaaaa; color: red;">'</span><span style="color: #333333;">+</span>m<span style="color: #333333;">.</span><span style="color: #0000cc;">Developername</span><span style="color: #333333;">;</span>
recordsToDelete<span style="color: #333333;">.</span><span style="color: #0000cc;">add</span><span style="color: #333333;">(</span>s<span style="color: #333333;">);</span>
<span style="color: #333333;">}</span>
<span style="color: #888888;">//Perform the bulk deletion at a time max of 200 records</span>
MetadataService<span style="color: #333333;">.</span><span style="color: #0000cc;">DeleteResult</span> <span style="color: #333333;">[]</span> results <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> MetadataService<span style="color: #333333;">.</span><span style="color: #0000cc;">DeleteResult</span> <span style="color: #333333;">[]{};</span>
results <span style="color: #333333;">=</span> service<span style="color: #333333;">.</span><span style="color: #0000cc;">deleteMetadata</span><span style="color: #333333;">(</span><span style="background-color: #ffaaaa; color: red;">'</span>CustomMetadata<span style="background-color: #ffaaaa; color: red;">'</span><span style="color: #333333;">,</span> recordsToDelete<span style="color: #333333;">);</span></span><span style="font-family: verdana;">
</span></span></pre></div><span style="font-family: verdana;">
<br /></span><p></p><div class="separator" style="background-color: white; clear: both; color: #222222; font-size: 13.2px; text-align: center;"><h3 style="margin: 0px; position: relative;"><div class="separator" style="clear: both; color: black; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span style="font-size: 13.2px;"><span style="font-family: verdana;">Please comment or write us if you have any queries/requirements.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><br style="font-size: 13.2px;" /></span><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><span style="font-family: verdana;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" style="color: #a32343; text-decoration-line: none;" target="_blank">Srinivas4sfdc (I Love Coding... You?)</a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" style="color: #a32343; text-decoration-line: none;" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p style="background-color: white; color: #222222; font-size: 13.2px;"><span color="rgba(0, 0, 0, 0.9)" style="font-size: 14px;"><span style="font-family: verdana;"><br /></span></span></p><h3 style="background-color: white; color: #222222; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" style="color: #a32343; text-decoration-line: none;" target="_blank"><span style="font-family: verdana;">Hope this helps you..Enjoy..!</span></a></span></i></b></h3>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com3tag:blogger.com,1999:blog-3155564479394484166.post-55410697636523961182022-06-09T19:28:00.006+05:302022-06-09T19:28:58.815+05:30How can we setup different work item capacity for agents in Salesforce Omni-Channel<p><b><i style="background-color: #ea9999;"> Scenario:</i></b></p><p><span style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px;">Let's assume we have group of users assigned under the omni channel for handling of incoming chat request.</span><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit !important;" /><span style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px;">How can we set the different maximum chat limit for user basis on experience. Ex For new joiner we want to setup of maximum cap as 5 and others as 7 chats.</span><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit !important;" /><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit !important;" /><span style="background-color: #04ff00;"><b><i>Solution:</i></b><br style="box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit !important;" /></span><span style="color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px;"><span style="background-color: white;">Ideally in omni channel the agent capacity and which Omni-channels features can be accessed like auto decline or auto accept of the work items can be performed using the </span><i style="background-color: #fcff01;">"Presence Configuration"</i><span style="background-color: white;"> settings.</span></span><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit !important;" /><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit !important;" /><span style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px;">So in our case also we can create two presence configurations ,one for the new joiners and second for the others. Under the new joiners configuration we will add all the new joiners so when they logged into Omni channel the chat capacity will be picked up from here automatically.</span><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit !important;" /><br style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px; line-height: inherit !important;" /><span style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px;"></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG1KAdIrtjQgrmnDk078L88A-qAhlGcp58nead4vnwduLTEze29Cmmgq9xCs1i6Sl482sIp0VI_9cx7qIAzi7wFSC5-5VVBcGqkhiaIG1Qea3k-CTalGXKCRIlZj-14Xl1yXGB21-xEjAElrgwRkStqKr8qwSU-uG1l3fQDk2xvRtBbJRqbNBy1QZnBA/s898/mssssss.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="565" data-original-width="898" height="403" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG1KAdIrtjQgrmnDk078L88A-qAhlGcp58nead4vnwduLTEze29Cmmgq9xCs1i6Sl482sIp0VI_9cx7qIAzi7wFSC5-5VVBcGqkhiaIG1Qea3k-CTalGXKCRIlZj-14Xl1yXGB21-xEjAElrgwRkStqKr8qwSU-uG1l3fQDk2xvRtBbJRqbNBy1QZnBA/w640-h403/mssssss.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><p></p><div class="separator" style="clear: both; text-align: center;"><h3 style="background-color: white; color: #222222; font-family: verdana, geneva, sans-serif; margin: 0px; position: relative;"><div class="separator" style="-webkit-text-stroke-width: 0px; clear: both; color: black; font-family: "Times New Roman"; font-size: medium; font-weight: 400; text-align: left;"><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana; font-size: 13.2px;">Please comment or write us if you have any queries/requirements.</span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><br style="font-size: 13.2px;" /></span><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><br /></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;">LinkedIn Group - <a href="https://www.linkedin.com/groups/10529690/" target="_blank">Srinivas4sfdc (I Love Coding... You?) </a></span></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><br /></span></div><div style="color: #222222; font-size: 13.2px;"><span style="font-family: verdana;">FaceBook Page - <a href="https://www.facebook.com/ILoveCodingYou" target="_blank">I Love Coding. You?</a></span></div></div></h3></div><p><span style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 14px;"><br /></span></p><h3 style="background-color: white; color: #222222; font-family: verdana, geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" target="_blank">Hope this helps you..Enjoy..!</a></span></i></b></h3>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-52639465421732815912022-05-29T09:14:00.002+05:302022-06-01T14:19:28.812+05:30Aura:if isTrue issue in salesforce<p><span style="font-family: verdana;">If you're facing an issue with Aura:if isTrue while using the And Clause or OR clause we need to know the below points.</span></p><p><span style="font-family: verdana;">According to salesforce documentation And/Or clause only supports two arguments for evaluation.</span></p><p><span style="font-family: verdana;">If you're using more than 2 arguments in And/Or clause by default Salesforce ignores it.</span></p><p><span style="font-family: verdana;"><br /></span></p><p><span style="font-family: verdana;"><Aura:if IsTrue ="Or(expression 1,expression 2)"> - - This is valid.</span></p><p><span style="font-family: verdana;"><Aura:if IsTrue ="Or(expression 1,expression 2, expression 3)"> - - This will not work as expected because Salesforce ignores the expression 3 for evaluation. </span></p><p><br /></p><p><b><i style="background-color: #ea9999;">Workaround :</i></b></p><p>If you need to solve this problem simply convert them into simple multiple chain expressions. </p><p>Aura:if IsTrue ="Or(expression 1,expression 2) || expression 3)"> </p><p>Aura:if IsTrue ="Or(expression 1,expression 2) || Or(expression 3, expression 4)"> </p><p><br /></p><h3 style="font-family: verdana, geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" target="_blank">Hope this helps you..Enjoy..!</a></span></i></b></h3><h3 style="font-family: verdana, geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><div class="separator" style="-webkit-text-stroke-width: 0px; clear: both; font-family: "Times New Roman"; font-size: medium; font-weight: 400; text-align: left;"><div style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><b><i><span style="color: blue;"><br /></span></i></b></span></span></div><div style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;">Please comment or write us if you have any queries/requirements.</span><br style="font-size: 13.2px;" /><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><br style="font-size: 13.2px;" /></span><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span><br style="font-size: 13.2px;" /><span face="Verdana, Geneva, sans-serif" style="font-size: 13.2px;"><br /></span><span face="Verdana, Geneva, sans-serif"><span style="font-size: 13.2px;"></span></span></div><div style="background-color: white; color: #222222; font-size: 13.2px;"><span face="Verdana, Geneva, sans-serif" style="font-size: 13.2px;"><br /><script defer="" src="https://apps.elfsight.com/p/platform.js"></script><div class="elfsight-app-b7621788-12fe-45d7-b8c4-3db317347f20"></div></span></div><p style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><br style="font-size: 13.2px;" /></p><div style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; text-align: center;"><br /></div></div></h3><p></p><h3 style="font-family: verdana, geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><br style="-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-size: 15.444px;" /></h3><p></p><h3 style="font-family: verdana, geneva, sans-serif; margin: 0px; position: relative;"><div style="font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"></div></h3><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com0tag:blogger.com,1999:blog-3155564479394484166.post-41132129116604747922022-05-27T14:23:00.001+05:302022-05-27T14:23:04.608+05:30How to Link a Child Record Every Time it's Created With An Existing/New Parent Record.<span style="font-family: verdana;">Lets take a use case when a child record has been created it should be automatically link to existing parent record ,in case if parent is not available it should create a parent and link the child record automatically.</span><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">The relationship between these objects is "<i><b>Lookup Relationship</b></i>" and the identifier to map the child with parent and the identifier when to create a new parent will be discussed below.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;"><i style="background-color: #fcff01;">Simple use case here is we will have daily time sheet entries of an employee and all these daily time sheet entries should get linked under weekly time sheet entry which is like one entry for one week with 7 daily time sheet under same parent.</i></span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">We can assume child object as "Daily_Time_Sheet__c" and parent object as "Weekly_Time_Sheet__c". On parent object we will have one field with name as "Parent_User_Week_Start__c(which is an external id) " which is the combination of user id and start date of the week of a given date in "Daily_Time_Sheet__c".The field name in child would be something like "ChildUserIdWeekStrartDate__c".</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;"><b><i style="background-color: #ea9999;">Source Code:</i></b></span></div><div><span style="font-family: verdana;"><b><i style="background-color: #ea9999;"><br /></i></b></span></div><div><!--HTML generated using hilite.me--><div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">Trigger DailyTimeSheetTrigger On <span style="color: #0066bb; font-weight: bold;">Daily_Time_Sheet__c</span><span style="color: #333333;">(</span>after insert<span style="color: #333333;">)</span>
<span style="color: #333333;">{</span>
List<span style="color: #333333;"><</span>Weekly_Time_Sheet__c<span style="color: #333333;">></span> listWTSToUpsert <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> List<span style="color: #333333;"><</span>Weekly_Time_Sheet__c<span style="color: #333333;">>();</span>
List<span style="color: #333333;"><</span>Daily_Time_Sheet__c<span style="color: #333333;">></span> listDTSUpdate <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> List<span style="color: #333333;"><</span>Daily_Time_Sheet__c <span style="color: #333333;">>();</span>
Map<span style="color: #333333;"><</span>String<span style="color: #333333;">,</span>id<span style="color: #333333;">></span> mapHours <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> Map<span style="color: #333333;"><</span>String<span style="color: #333333;">,</span>id<span style="color: #333333;">>();</span>
set<span style="color: #333333;"><</span>string<span style="color: #333333;">></span> setUniqueParent <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> set<span style="color: #333333;"><</span>string<span style="color: #333333;">>();</span>
<span style="color: #008800; font-weight: bold;">for</span><span style="color: #333333;">(</span>Daily_Time_Sheet__c <span style="color: #997700; font-weight: bold;">dts:</span>Trigger<span style="color: #333333;">.</span><span style="color: #0000cc;">new</span><span style="color: #333333;">)</span>
<span style="color: #333333;">{</span>
<span style="color: #008800; font-weight: bold;">if</span><span style="color: #333333;">(</span>dts<span style="color: #333333;">.</span><span style="color: #0000cc;">ChildUserIdWeekStrartDate__c</span><span style="color: #333333;">!=</span><span style="color: #008800; font-weight: bold;">null</span> <span style="color: #333333;">&&</span> dts<span style="color: #333333;">.</span><span style="color: #0000cc;">Weekly_Time_Sheet__c</span><span style="color: #333333;">==</span><span style="color: #008800; font-weight: bold;">null</span><span style="color: #333333;">)</span>
<span style="color: #333333;">{</span>
Weekly_Time_Sheet__c wts <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> Weekly_Time_Sheet__c<span style="color: #333333;">();</span>
wts<span style="color: #333333;">.</span><span style="color: #0000cc;">Parent_User_Week_Start__c</span> <span style="color: #333333;">=</span> dts<span style="color: #333333;">.</span><span style="color: #0000cc;">Chi</span><span style="color: #333333;">;</span>
<span style="color: #008800; font-weight: bold;">if</span><span style="color: #333333;">(!</span>setUniqueParent<span style="color: #333333;">.</span><span style="color: #0000cc;">contains</span><span style="color: #333333;">(</span>wts<span style="color: #333333;">.</span><span style="color: #0000cc;">Parent_User_Week_Start__c</span><span style="color: #333333;">))</span>
<span style="color: #333333;">{</span>
listWTSToUpsert<span style="color: #333333;">.</span><span style="color: #0000cc;">add</span><span style="color: #333333;">(</span>wts<span style="color: #333333;">);</span>
setUniqueParent<span style="color: #333333;">.</span><span style="color: #0000cc;">add</span><span style="color: #333333;">(</span>wts<span style="color: #333333;">.</span><span style="color: #0000cc;">Parent_User_Week_Start__c</span><span style="color: #333333;">);</span>
<span style="color: #333333;">}</span>
<span style="color: #333333;">}</span>
<span style="color: #333333;">}</span>
<span style="color: #008800; font-weight: bold;">try</span>
<span style="color: #333333;">{</span>
<span style="color: #008800; font-weight: bold;">if</span><span style="color: #333333;">(!</span>listWTSToUpsert<span style="color: #333333;">.</span><span style="color: #0000cc;">isEmpty</span><span style="color: #333333;">())</span>
Database<span style="color: #333333;">.</span><span style="color: #0000cc;">UpsertResult</span><span style="color: #333333;">[]</span> wtsUpsertResult <span style="color: #333333;">=</span> Database<span style="color: #333333;">.</span><span style="color: #0000cc;">upsert</span><span style="color: #333333;">(</span>listWTSToUpsert<span style="color: #333333;">,</span>Weekly_Time_Sheet__c<span style="color: #333333;">.</span><span style="color: #0000cc;">Parent_User_Week_Start__c</span><span style="color: #333333;">,</span><span style="color: #008800; font-weight: bold;">false</span><span style="color: #333333;">);</span>
<span style="color: #008800; font-weight: bold;">for</span><span style="color: #333333;">(</span>Weekly_Time_Sheet__c <span style="color: #997700; font-weight: bold;">ws:</span>listWTSToUpsert<span style="color: #333333;">)</span>
<span style="color: #333333;">{</span>
mapHours<span style="color: #333333;">.</span><span style="color: #0000cc;">put</span><span style="color: #333333;">(</span>ws<span style="color: #333333;">.</span><span style="color: #0000cc;">Parent_User_Week_Start__c</span><span style="color: #333333;">,</span>ws<span style="color: #333333;">.</span><span style="color: #0000cc;">id</span><span style="color: #333333;">);</span>
<span style="color: #333333;">}</span>
<span style="color: #008800; font-weight: bold;">for</span><span style="color: #333333;">(</span>Daily_Time_Sheet__c <span style="color: #997700; font-weight: bold;">dts:</span><span style="color: #333333;">[</span>SeLEcT id <span style="color: #333333;">,</span>ChildUserIdWeekStrartDate__c<span style="color: #333333;">,</span>Weekly_Time_Sheet__c FROM Daily_Time_Sheet__c WHERE ID <span style="color: #997700; font-weight: bold;">IN:</span> Trigger<span style="color: #333333;">.</span><span style="color: #0000cc;">new</span><span style="color: #333333;">])</span>
<span style="color: #333333;">{</span>
<span style="color: #008800; font-weight: bold;">if</span><span style="color: #333333;">(</span>dts<span style="color: #333333;">.</span><span style="color: #0000cc;">ChildUserIdWeekStrartDate__c</span><span style="color: #333333;">!=</span><span style="color: #008800; font-weight: bold;">null</span> <span style="color: #333333;">&&</span> dts<span style="color: #333333;">.</span><span style="color: #0000cc;">Weekly_Time_Sheet__c</span><span style="color: #333333;">==</span><span style="color: #008800; font-weight: bold;">null</span><span style="color: #333333;">)</span>
<span style="color: #333333;">{</span>
<span style="color: #008800; font-weight: bold;">if</span><span style="color: #333333;">(</span>mapHours<span style="color: #333333;">.</span><span style="color: #0000cc;">containsKey</span><span style="color: #333333;">(</span>bh<span style="color: #333333;">.</span><span style="color: #0000cc;">ChildUserIdWeekStrartDate__c</span><span style="color: #333333;">))</span>
<span style="color: #333333;">{</span>
bh<span style="color: #333333;">.</span><span style="color: #0000cc;">Weekly_Time_Sheet__c</span> <span style="color: #333333;">=</span> mapHours<span style="color: #333333;">.</span><span style="color: #0000cc;">get</span><span style="color: #333333;">(</span>guid<span style="color: #333333;">);</span>
listDTSUpdate<span style="color: #333333;">.</span><span style="color: #0000cc;">add</span><span style="color: #333333;">(</span>bh<span style="color: #333333;">);</span>
<span style="color: #333333;">}</span>
<span style="color: #333333;">}</span>
<span style="color: #333333;">}</span>
<span style="color: #008800; font-weight: bold;">if</span><span style="color: #333333;">(!</span>listDTSUpdate<span style="color: #333333;">.</span><span style="color: #0000cc;">isEmpty</span><span style="color: #333333;">())</span>
Database<span style="color: #333333;">.</span><span style="color: #0000cc;">SaveResult</span><span style="color: #333333;">[]</span> wbhUpsertResult2 <span style="color: #333333;">=</span> Database<span style="color: #333333;">.</span><span style="color: #0000cc;">update</span><span style="color: #333333;">(</span>listDTSUpdate<span style="color: #333333;">,</span><span style="color: #008800; font-weight: bold;">false</span><span style="color: #333333;">);</span>
<span style="color: #333333;">}</span>
<span style="color: #008800; font-weight: bold;">catch</span><span style="color: #333333;">(</span>exception e<span style="color: #333333;">)</span>
<span style="color: #333333;">{</span>
system<span style="color: #333333;">.</span><span style="color: #0000cc;">debug</span><span style="color: #333333;">(</span><span style="background-color: #ffaaaa; color: red;">'</span>exception <span style="color: #333333;">..</span><span style="background-color: #ffaaaa; color: red;">'</span><span style="color: #333333;">+</span>e<span style="color: #333333;">);</span>
<span style="color: #333333;">}</span>
<span style="color: #333333;">}</span>
</pre></div>
</div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><div style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><h3 style="font-family: verdana, geneva, sans-serif; margin: 0px; position: relative;"><b><i><span style="color: blue;"><a href="https://ordisposableado.com/ykbf9ag9?key=b4898eaeaeb7d355991906873ee27f9f" target="_blank">Hope this helps you..Enjoy..!</a></span></i></b></h3><h3 style="font-family: verdana, geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><div class="separator" style="-webkit-text-stroke-width: 0px; clear: both; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><div><b><i><span style="color: blue;"><br /></span></i></b></div></span></span></div><div style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-family: verdana;"><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;">Please comment or write us if you have any queries/requirements.</span><br style="font-size: 13.2px;" /><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;"><br style="font-size: 13.2px;" /></span><span face="verdana, geneva, sans-serif" style="font-size: 13.2px;">Please like,follow,bookmark,subscribe this site to receive daily updates.</span></span><br style="font-size: 13.2px;" /><span face="Verdana, Geneva, sans-serif" style="font-size: 13.2px;"><br /></span><span face="Verdana, Geneva, sans-serif"><span style="font-size: 13.2px;"></span></span></div><div style="background-color: white; color: #222222; font-size: 13.2px;"><span face="Verdana, Geneva, sans-serif" style="font-size: 13.2px;"><br /><script defer="" src="https://apps.elfsight.com/p/platform.js"></script><div class="elfsight-app-b7621788-12fe-45d7-b8c4-3db317347f20"></div></span></div><p style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"><br style="font-size: 13.2px;" /></p><div style="background-color: white; color: #222222; font-family: Verdana, Geneva, sans-serif; font-size: 13.2px; text-align: center;"><br /></div></div></h3><h3 style="font-family: verdana, geneva, sans-serif; margin: 0px; position: relative;"><div style="font-family: Verdana, Geneva, sans-serif; font-size: 13.2px;"></div></h3><h3 style="font-family: verdana, geneva, sans-serif; margin: 0px; position: relative; text-align: center;"><br style="-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: verdana, geneva, sans-serif; font-size: 15.444px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 700; letter-spacing: normal; orphans: 2; text-align: center; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" /></h3></span></span></div></div>Sreenivas Mhttp://www.blogger.com/profile/16335050045501491624noreply@blogger.com