<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tushar Sharma on Medium]]></title>
        <description><![CDATA[Stories by Tushar Sharma on Medium]]></description>
        <link>https://medium.com/@tushar4530?source=rss-4c75887dec95------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VwLSnqU8ADD-6TRP.jpg</url>
            <title>Stories by Tushar Sharma on Medium</title>
            <link>https://medium.com/@tushar4530?source=rss-4c75887dec95------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:22:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tushar4530/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Built Stripe Payments Inside Salesforce: Embedded Checkout with LWC]]></title>
            <link>https://tushar4530.medium.com/built-stripe-payments-inside-salesforce-embedded-checkout-with-lwc-0d084fdafce6?source=rss-4c75887dec95------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d084fdafce6</guid>
            <category><![CDATA[stripe]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[apex]]></category>
            <category><![CDATA[salesforce-lwc]]></category>
            <category><![CDATA[integration]]></category>
            <dc:creator><![CDATA[Tushar Sharma]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 18:54:11 GMT</pubDate>
            <atom:updated>2026-09-29T19:22:56.939Z</atom:updated>
            <content:encoded><![CDATA[<p>A Pay Now button on the Opportunity page, a modal with the products, and Stripe’s payment form, all without leaving the org.</p><p>Most Stripe tutorials send the customer to another page. I wanted the payment to happen <strong>inside Salesforce</strong>: the rep opens an Opportunity, clicks a button, sees the products, and pays in a popup on the same screen.</p><p>Here’s what I built and how I set it up.</p><h3>What we’re building</h3><p>A Lightning Web Component on the Opportunity record page that:</p><ol><li>Shows a single button: <strong>“1 Product(s) • Pay Now”</strong></li><li>Opens a modal listing the Opportunity’s products, quantities, unit prices and total</li><li>On <strong>Pay Now</strong>, shows Stripe’s embedded payment form inside the modal</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1XAYZs12ifh4-6vInlMTlQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RshC6LNPIqMmzsshJZM_hg.png" /></figure><p>On clicking Pay Now this will open the Stripe embedded payment page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DEQtSgPWO_pKMVVKjUFxuA.png" /></figure><p>On using the test credit card details we can perform the payment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nKV5NOqxuD5xof25pEG90w.png" /></figure><h3>How it works</h3><p>Stripe integrations split the work between two sides:</p><ul><li><strong>Apex (server)</strong> decides <em>what</em> is being paid for. It holds the secret key and the real prices.</li><li><strong>LWC (browser)</strong> displays the form. It only holds the publishable key and a one-time client_secret.</li></ul><p>The flow:<br>Stripe uses this standard flow to show its embedded payment page can refer this documentation from <a href="https://docs.stripe.com/checkout/embedded/quickstart">https://docs.stripe.com/checkout/embedded/quickstart</a></p><pre>Click Pay Now → LWC calls Apex → Apex calls Stripe (secret key)<br>→ Stripe returns client_secret → Apex returns it to LWC<br>→ LWC loads Stripe.js and mounts the form with that secret</pre><p>The secret key never reaches the browser, and the customer can’t change the price, because the amount is set on the server.</p><h3>Step 1: Store the Stripe key in a Named Credential</h3><p>Never hardcode sk_test_... in Apex. Put it in a Named Credential so Salesforce attaches it to every callout for you.</p><ol><li>Go to <strong>Setup → Named Credentials → New</strong>.</li><li>Fill in:</li></ol><ul><li><strong>Label:</strong> Stripe API</li><li><strong>Name:</strong> Stripe_API</li><li><strong>URL:</strong> <a href="https://api.stripe.com/">https://api.stripe.com</a></li><li><strong>Identity Type:</strong> Named Principal</li><li><strong>Authentication Protocol:</strong> Password Authentication</li><li><strong>Username:</strong> your Stripe secret key (sk_test_...)</li><li><strong>Password:</strong> any placeholder value if the field requires one</li><li><strong>Generate Authorization Header:</strong> checked</li></ul><p>3. Save.</p><h3>Step 2: Allow Stripe in Trusted URLs (CSP)</h3><h4>(We needed this for stripe.js to load its resources in our js file of lwc)</h4><p>Salesforce blocks pages from loading outside scripts and frames unless you approve them. Stripe’s form loads from Stripe’s servers, so you need to allow them.</p><ol><li>Go to <strong>Setup → CSP Trusted Sites → New Trusted Site</strong>.</li><li>Add:</li></ol><ul><li>https://js.stripe.com (Stripe.js and the payment iframe)</li><li>https://api.stripe.com (requests made by embedded checkout)</li></ul><p>Enable the relevant directives, at least <strong>connect-src</strong> and <strong>frame-src</strong> (and <strong>img-src</strong> and <strong>style-src</strong> if the form looks broken).</p><p>Set the context to <strong>Lightning Experience</strong> and save.</p><p>Make sure <strong>Lightning Web Security</strong> is enabled (<strong>Setup → Session Settings</strong>).</p><p>If the form doesn’t appear, open the browser console. Blocked-by-CSP errors name the exact domain to add. Stripe loads a few helper domains, so this is the fastest way to find what’s missing.</p><h3>Step 3: Apex creates the Checkout Session</h3><p>The controller turns each Opportunity Product into a Stripe line item, tags the session with the Opportunity Id, and returns only the client_secret:</p><p>apex</p><pre>String body = &#39;mode=payment&#39;<br>    + &#39;&amp;ui_mode=embedded&#39;<br>    + &#39;&amp;redirect_on_completion=never&#39;<br>    + &#39;&amp;client_reference_id=&#39; + opportunityId<br>    + &#39;&amp;metadata[opportunity_id]=&#39; + opportunityId;<br><br>for (OpportunityLineItem oli : items) {<br>    body += &#39;&amp;line_items[&#39; + idx + &#39;][price_data][currency]=&#39; + currencyString;<br>    body += &#39;&amp;line_items[&#39; + idx + &#39;][price_data][product_data][name]=&#39;<br>          + EncodingUtil.urlEncode(oli.PricebookEntry.Product2.Name, &#39;UTF-8&#39;);<br>    body += &#39;&amp;line_items[&#39; + idx + &#39;][price_data][unit_amount]=&#39; + unitAmount;<br>    body += &#39;&amp;line_items[&#39; + idx + &#39;][quantity]=&#39; + quantity;<br>    idx++;<br>}</pre><p>Key details:</p><ul><li>ui_mode=embedded renders the form inside your page instead of Stripe&#39;s hosted page.</li><li>redirect_on_completion=never keeps the user in the modal.</li><li>Stripe wants amounts in the <strong>smallest currency unit</strong>, so $3.00 is sent as 300.</li><li>Using product_data means you don&#39;t have to pre-create products in Stripe. The Opportunity Id on the session lets you trace every payment back to its record.</li></ul><h3>Step 4: The LWC loads Stripe.js and mounts the form</h3><p>The component loads Stripe.js only when the user clicks Pay Now, so people who never pay don’t download it:</p><p>javascript</p><pre>const clientSecret = await createCheckoutSession({ opportunityId: this.recordId });<br>await this.ensureStripeLoaded();     // loadScript for https://js.stripe.com/v3/<br>this.isPaying = true;<br>setTimeout(() =&gt; this.mountEmbeddedCheckout(clientSecret), 0);</pre><p>The setTimeout waits for LWC to render the empty container div before Stripe tries to attach to it. Then:</p><p>javascript</p><pre>const stripe = Stripe(STRIPE_PUBLISHABLE_KEY);<br>stripe.initEmbeddedCheckout({ clientSecret }).then((checkout) =&gt; {<br>    this.checkoutInstance = checkout;<br>    checkout.mount(this.template.querySelector(&#39;.checkout-container&#39;));<br>});</pre><p>The publishable key is safe in browser code because it only identifies your account. The card fields live in a Stripe-hosted iframe, so <strong>card numbers never touch Salesforce</strong>.</p><p>Full Source Code:- <a href="https://github.com/tushar453030/Salesforce-Stripe-Integration">https://github.com/tushar453030/Salesforce-Stripe-Integration</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d084fdafce6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Skip the Salesforce API — Use Web-to-Lead Directly in Your React App]]></title>
            <link>https://tushar4530.medium.com/skip-the-salesforce-api-use-web-to-lead-directly-in-your-react-app-9589949027b7?source=rss-4c75887dec95------2</link>
            <guid isPermaLink="false">https://medium.com/p/9589949027b7</guid>
            <category><![CDATA[salesforce-developer]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[salesforce-integration]]></category>
            <dc:creator><![CDATA[Tushar Sharma]]></dc:creator>
            <pubDate>Sat, 23 May 2026 10:47:00 GMT</pubDate>
            <atom:updated>2026-05-23T10:51:16.467Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to post leads to Salesforce from a React frontend without OAuth, Connected Apps, or a backend server</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VBkmS5VEZZE7r1tRqZsgfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*iQetxLF-L6bmfwGujjvAuQ.png" /></figure><h3>The Problem Most Developers Overcomplicate</h3><p>You have a React marketing site. You need every form submission to create a Lead in Salesforce. The obvious path looks like this:</p><ol><li>Set up a Salesforce Connected App</li><li>Implement OAuth 2.0</li><li>Spin up a Node/Express backend to hold your credentials safely</li><li>Call the Salesforce REST API from the server</li><li>Wire your React frontend to your backend</li></ol><p>That is five steps before a single lead lands in your CRM. For a simple lead capture form — a landing page, a “Contact Us” section, a conference booth sign-up — this is massive overkill.</p><p>There is a better way: <strong>Salesforce Web-to-Lead</strong>.</p><h3>What Is Salesforce Web-to-Lead?</h3><p>Web-to-Lead is a native Salesforce feature that has existed since the early days of the platform. Salesforce exposes a public HTTP endpoint:</p><pre>https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8</pre><p>You POST form data to this URL and Salesforce creates a Lead record — no API keys, no OAuth tokens, no backend required. Salesforce uses your <strong>Organisation ID (OID)</strong> to route the submission to the right org.</p><p>Salesforce itself uses this for the HTML forms it generates in Setup. We are just calling the same endpoint programmatically from React.</p><h3>The CORS Caveat (and Why It Is Not a Problem)</h3><p>The first question developers ask: <em>“Won’t CORS block this?”</em></p><p>Yes — if you use axios or any XMLHttpRequest-based library. Salesforce does not return Access-Control-Allow-Origin headers, so XHR is blocked before the request leaves the browser.</p><p>The solution is the browser’s native <strong>Fetch API</strong> with mode: &#39;no-cors&#39;.</p><p>no-cors is a deliberate browser feature introduced with the Fetch API in 2015. It tells the browser:</p><blockquote><em>“I accept that I cannot read the response. Just send the request.”</em></blockquote><p>The browser suppresses the CORS check, the request reaches Salesforce, and the lead is created. You receive an opaque (empty) response — which is fine because you have nothing to read anyway.</p><blockquote><strong><em>Important:</em></strong><em> </em><em>mode: &#39;no-cors&#39; only works with the Fetch API. </em><em>axios uses </em><em>XMLHttpRequest under the hood, which predates the concept of no-cors entirely. This is why axios fails and fetch succeeds for this specific use case.</em></blockquote><h3>Setting Up Web-to-Lead in Salesforce</h3><p>Before writing any React code, enable the feature in your Salesforce org:</p><ol><li>Go to <strong>Setup → Feature Settings → Marketing → Web-to-Lead</strong></li><li>Click <strong>Enable Web-to-Lead</strong></li><li>Note your <strong>Organisation ID</strong> — found under <strong>Setup → Company Information → Salesforce.com Organization ID</strong></li></ol><p>That’s all the Salesforce configuration needed.</p><h3>The React Implementation</h3><p>The implementation breaks into three clean, separated files following good React project structure:</p><h3>File Structure</h3><pre>src/<br>├── postLead.js       ← validation logic + Salesforce API call<br>├── LeadForm.jsx      ← React component (UI + state)<br>└── LeadForm.css      ← all styles</pre><h3>postLead.js — The Core Logic</h3><p>This file contains all business logic: email validation, field validation, and the actual Salesforce submission. It is a plain JavaScript module with no React dependency — easy to test in isolation.</p><pre>/**<br> * postLead.js<br> * Handles form validation and posting leads to Salesforce Web-to-Lead endpoint.<br> */<br>const SFDC_ENDPOINT =<br>  &#39;https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8&#39;<br><br>/**<br> * Validates an email address format.<br> * @param {string} email<br> * @returns {boolean}<br> */<br>export function validateEmail(email) {<br>  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)<br>}<br>/**<br> * Validates the lead form fields.<br> * Returns an object of { fieldId: errorMessage } for any failures.<br> * @param {Object} fields<br> * @returns {Object}<br> */<br>export function validateFields(fields) {<br>  const errors = {}<br>  if (!fields.first_name.trim()) {<br>    errors.first_name = &#39;Please enter your first name.&#39;<br>  }<br>  if (!fields.last_name.trim()) {<br>    errors.last_name = &#39;Please enter your last name.&#39;<br>  }<br>  if (!fields.company.trim()) {<br>    errors.company = &#39;Please enter your company.&#39;<br>  }<br>  if (!validateEmail(fields.email)) {<br>    errors.email = &#39;Please enter a valid email address.&#39;<br>  }<br>  return errors<br>}<br>/**<br> * Posts a lead to Salesforce Web-to-Lead.<br> * axios does not support no-cors natively (it&#39;s a browser fetch concept),<br> * so we configure a custom adapter-less instance and pass the request<br> * through fetch under the hood using the fetchAdapter option available<br> * in axios v1+, or simply use axios with a fetch adapter for no-cors.<br> *<br> * @param {Object} fields  - Form field values<br> * @param {string} oid     - Salesforce Organisation ID<br> * @param {string} retURL  - Redirect URL after submission<br> * @returns {Promise&lt;void&gt;}<br> */<br>export async function postLeadToSFDC(fields, oid, retURL) {<br>  const params = new URLSearchParams({<br>    oid,<br>    retURL,<br>    first_name: fields.first_name.trim(),<br>    last_name: fields.last_name.trim(),<br>    company: fields.company.trim(),<br>    title: fields.title.trim(),<br>    email: fields.email.trim(),<br>    phone: fields.phone.trim(),<br>    lead_source: fields.lead_source,<br>  })<br>  try {<br>    await fetch(SFDC_ENDPOINT, {<br>      method: &#39;POST&#39;,<br>      headers: { &#39;Content-Type&#39;: &#39;application/x-www-form-urlencoded&#39; },<br>      body: params.toString(),<br>      mode: &#39;no-cors&#39;, // silences CORS error; response will be opaque (empty)<br>    })<br>  } catch (error) {<br>    console.log(error)<br>  }<br>}</pre><p><strong>Key design decisions:</strong></p><ul><li>validateEmail and validateFields are pure functions — given the same input, they always return the same output. No side effects, trivially unit-testable.</li><li>postLeadToSFDC is async but does not return any data. Since no-cors gives an opaque response, there is nothing meaningful to return. The function either resolves (request sent) or throws (network failure).</li><li>URLSearchParams serialises the payload to application/x-www-form-urlencoded — the exact format Salesforce Web-to-Lead expects.</li></ul><h3>Using It in LeadForm.jsx</h3><pre>import { useState } from &#39;react&#39;<br>import { validateFields, postLeadToSFDC } from &#39;./postLead&#39;<br>import &#39;./LeadForm.css&#39;<br><br>const OID     = &#39;YOUR_SALESFORCE_ORG_ID&#39;<br>const RET_URL = &#39;https://yoursite.com/thank-you&#39;<br>const INITIAL_FIELDS = {<br>  first_name: &#39;&#39;, last_name: &#39;&#39;, company: &#39;&#39;,<br>  title: &#39;&#39;, email: &#39;&#39;, phone: &#39;&#39;, lead_source: &#39;&#39;,<br>}<br>export default function LeadForm() {<br>  const [fields, setFields]       = useState(INITIAL_FIELDS)<br>  const [errors, setErrors]       = useState({})<br>  const [submitting, setSubmitting] = useState(false)<br>  const [submitted, setSubmitted]   = useState(false)<br>  function handleChange(e) {<br>    const { name, value } = e.target<br>    setFields(prev =&gt; ({ ...prev, [name]: value }))<br>    if (errors[name]) setErrors(prev =&gt; ({ ...prev, [name]: undefined }))<br>  }<br>  async function handleSubmit() {<br>    const validationErrors = validateFields(fields)<br>    if (Object.keys(validationErrors).length &gt; 0) {<br>      setErrors(validationErrors)<br>      return<br>    }<br>    setSubmitting(true)<br>    try {<br>      await postLeadToSFDC(fields, OID, RET_URL)<br>      setSubmitted(true)<br>    } catch {<br>      alert(&#39;Something went wrong. Please try again.&#39;)<br>    } finally {<br>      setSubmitting(false)<br>    }<br>  }<br>  return (<br>    &lt;div className=&quot;wrapper&quot;&gt;<br>      {/* form fields here */}<br>      &lt;button onClick={handleSubmit} disabled={submitting || submitted}&gt;<br>        {submitted ? &#39;Submitted ✓&#39; : submitting ? &#39;Submitting…&#39; : &#39;Submit&#39;}<br>      &lt;/button&gt;<br>      {submitted &amp;&amp; &lt;p&gt;Thank you! We&#39;ll be in touch soon.&lt;/p&gt;}<br>    &lt;/div&gt;<br>  )<br>}</pre><h3>Web-to-Lead vs Salesforce REST API — When to Use Which</h3><p>Criteria Web-to-Lead Salesforce REST API Setup time ~5 minutes Hours to days Backend required ❌ No ✅ Yes (for credentials) OAuth required ❌ No ✅ Yes Reads data back ❌ No ✅ Yes Custom objects ❌ Leads only ✅ Any object Field mapping Limited to Lead fields Full flexibility Rate limits 500 submissions/day* API plan limits Best for Marketing lead capture Full CRM integration</p><p>*The 500/day default can be raised by Salesforce Support.</p><h3>Limitations to Know Before Shipping</h3><p><strong>1. You cannot confirm success.</strong> Because of no-cors, the response is always opaque. You cannot distinguish a successful submission from a failure at the Salesforce end (e.g. a duplicate rule blocking the lead). Show a success state optimistically — the request almost always goes through if the network doesn&#39;t throw.</p><p><strong>2. The 500 leads/day default limit.</strong> Fine for most marketing forms. If you expect high volume, contact Salesforce Support to increase the limit or switch to the REST API.</p><p><strong>3. Lead object fields only.</strong> Web-to-Lead maps to standard and custom Lead fields. You cannot create related records or write to other objects.</p><p><strong>4. No deduplication control.</strong> Salesforce’s default duplicate rules still apply, but you have less control over conflict resolution than with the REST API.</p><p><strong>5. Spam risk.</strong> Your OID is visible in the page source. Consider adding a CAPTCHA (Google reCAPTCHA v3 integrates well with React) to prevent bot submissions.</p><h3>Adding reCAPTCHA (Recommended)</h3><pre>npm install react-google-recaptcha</pre><pre>import ReCAPTCHA from &#39;react-google-recaptcha&#39;<br>// Inside your component<br>&lt;ReCAPTCHA<br>  sitekey=&quot;YOUR_RECAPTCHA_SITE_KEY&quot;<br>  onChange={(token) =&gt; setCaptchaToken(token)}<br>/&gt;<br>// Verify token exists before calling postLeadToSFDC<br>if (!captchaToken) {<br>  alert(&#39;Please complete the CAPTCHA.&#39;)<br>  return<br>}</pre><h3>Summary</h3><p>Salesforce Web-to-Lead is an underutilised feature that perfectly fits the “simple lead capture form” use case. No OAuth, no backend, no Connected App — just a POST request from your React app directly to Salesforce.</p><p>The trick is using the browser’s native fetch with mode: &#39;no-cors&#39; rather than axios, because no-cors is a Fetch API concept that XHR (which axios uses) simply does not support.</p><p>For marketing sites, landing pages, and event sign-up forms, this approach ships in an afternoon instead of a sprint.</p><p><em>Found this useful? Follow me for more practical Salesforce + React patterns.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9589949027b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Salesforce debug logs in Visual Studio Code directly]]></title>
            <link>https://tushar4530.medium.com/salesforce-debug-logs-in-visual-studio-code-directly-0d9150043caf?source=rss-4c75887dec95------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d9150043caf</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[salesforce-developer]]></category>
            <dc:creator><![CDATA[Tushar Sharma]]></dc:creator>
            <pubDate>Thu, 26 Jun 2025 18:56:05 GMT</pubDate>
            <atom:updated>2025-06-26T19:02:09.676Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello All, Just a blog to get the debug logs directly in vscode rather than downloading various files from org setup .</p><p>Firstly we needed to setup our vscode for the org can follow the below trailhead <a href="https://trailhead.salesforce.com/content/learn/projects/quickstart-vscode-salesforce">https://trailhead.salesforce.com/content/learn/projects/quickstart-vscode-salesforce</a></p><p>Now assuming we have configured our org in vscode now go the root folder of the project and create a folder named <strong>logs.<br>Use the below highlighted option to collapse all the open folders, files so that we can create the folder in root</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*2KGhHhcvmf4rFbg4rvKfJA.png" /></figure><p>Setup 1:- Create the folder, use the below highlighted symbol to create the folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*HB7CZAR0t_CqoFytiAV4EA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*xIwSWrheqeriM1Kl3SQlKQ.png" /></figure><p>Step 2:- Run the below command in terminal of project also first create a debug level through org if not created already I already have mine in place named “Finest”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fzZwNNGD1XgxHx_OjRbO3A.png" /></figure><p>Command to run in terminal</p><pre>sfdx force:apex:log:tail &gt; logs/apex.log — debug-level=Finest(Your debug level name)</pre><p>Look the command sfdx provide us a way to get logs directly in vscode using force:apex:log:tail and the later part of command specify where we wanted to keep the debug logs in my case I specified logs/apex.log which means folder logs and file apex.log. The above command will automatically create a file if not there in our folder.</p><p>When the command is executed in terminal our terminal should look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oWdR48AMV5p9sJqvvTuU_Q.png" /></figure><p>Now perform some operation in org like create a account and see the debug logs will be appended to this file apex.log</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zw1_MBZdvrIF1QorfAmz5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sOzCnAtrWKB87ARF-AQ4tw.png" /></figure><p>Now see the apex.log file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hJDxS5nqr1zE4BcN6cMYDg.png" /></figure><p>Advantages for using this</p><ol><li>We will have 1 file for the logs it just keep on appending in this one file only for the whole transaction or action performed by user</li><li>Its easy to debug in vscode direclty we don’t need to download many files and see in which we have our desired logs</li><li>Its work for a specific user too just apply the trace flag through org for a specific user and get the logs in vscode direclty.<br>When using a specified user run the command in terminal without<br><strong> — — debug — level = Finest</strong> part</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d9150043caf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Salesforce Experience in Capgemini]]></title>
            <link>https://tushar4530.medium.com/salesforce-experience-in-capgemini-f3018ed68e33?source=rss-4c75887dec95------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3018ed68e33</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[capgemini]]></category>
            <dc:creator><![CDATA[Tushar Sharma]]></dc:creator>
            <pubDate>Wed, 03 May 2023 13:56:35 GMT</pubDate>
            <atom:updated>2023-05-03T13:56:35.664Z</atom:updated>
            <content:encoded><![CDATA[<h3>Salesforce in Capgemini</h3><p>By Tushar Sharma</p><p>Capgemini is a global leader in digital transformation, technology services, and consulting. Salesforce consulting services are one of their main offerings, and they can assist businesses in transforming their customer experience, streamlining their sales processes, and increasing overall efficiency. In this blog, we will investigate Capgemini’s Salesforce offering and what compels it hang out on the lookout.</p><p><strong>Services for Salesforce Consulting Capgemini’s Salesforce consulting services include the following:</strong></p><p><strong>Revenue Cloud</strong>: Utilizing Salesforce’s Sales Cloud platform, Capgemini assists businesses in optimizing their sales processes and increasing revenue. This incorporates lead the executives, opportunity following, deals determining, and joint effort devices to help outreach groups work all the more proficiently.</p><p><strong>Cloud of Services</strong>: With Salesforce’s Service Cloud platform, Capgemini can assist businesses in providing exceptional customer service. Customer self-service, case management, and integration with other systems for a 360-degree view of customer interactions are all part of this.</p><p><strong>Cloud of Marketing</strong>: With Salesforce’s Marketing Cloud platform, Capgemini can assist businesses in increasing engagement and marketing ROI. Email marketing, social media management, and advertising tools are all included in this to help you reach the right people with the right message.</p><p><strong>Trade Cloud</strong>: With Salesforce’s Commerce Cloud platform, Capgemini can assist businesses in creating e-commerce experiences that are effortless. Management of product catalogs, processing of payments, and fulfillment of orders are all included in this.</p><p><strong>Local area Cloud</strong>: With the help of Salesforce’s Community Cloud platform, Capgemini can assist businesses in establishing vibrant online communities. This includes customer self-service, collaboration, and knowledge sharing tools.</p><p><strong>What sets Capgemini’s Salesforce product apart</strong>?</p><p>The Salesforce service provided by Capgemini stands out in several ways:</p><p>Expertise in the field: Capgemini has extensive experience working with businesses in a variety of industries, including healthcare, retail, and financial services. This permits them to bring a profound comprehension of industry-explicit provokes and potential open doors to their Salesforce counseling commitment.</p><p>Worldwide Reach: Capgemini is able to offer Salesforce consulting services to businesses worldwide due to its presence in more than 50 nations. They are also able to provide local support and expertise wherever their clients are located due to their global reach.</p><p>Collaboration with Salesforce: Capgemini is a Platinum Salesforce Counseling Accomplice, and that implies they have a nearby working relationship with Salesforce and admittance to the most recent instruments and assets. Additionally, this partnership guarantees that Capgemini consultants have received extensive Salesforce platform training and certification.</p><p>A focus on the customer: Capgemini places the customer at the center of everything they do, which means they collaborate closely with their clients to comprehend their individual requirements and create individualized solutions that provide real value.</p><p><strong>Conclusion</strong></p><p>Capgemini’s Salesforce counseling administrations are a useful asset for organizations hoping to change their client experience, smooth out their deals processes, and work on their general effectiveness. Capgemini is well-positioned to assist businesses in achieving their objectives with Salesforce due to its extensive industry expertise, global reach, close partnership with Salesforce, and customer-focused approach.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3018ed68e33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Things every Developer Should Know]]></title>
            <link>https://tushar4530.medium.com/things-every-developer-should-know-f037175ce5e9?source=rss-4c75887dec95------2</link>
            <guid isPermaLink="false">https://medium.com/p/f037175ce5e9</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Tushar Sharma]]></dc:creator>
            <pubDate>Tue, 23 Mar 2021 18:53:34 GMT</pubDate>
            <atom:updated>2021-03-23T18:56:29.197Z</atom:updated>
            <content:encoded><![CDATA[<h3>Things Every Developer Should Know</h3><p><strong>Algorithms and why are they important</strong></p><p>Algorithms are used throughout the board of computer science. They are the foundation of the field. An algorithm is a set of instructions that helps a machine to perform any task, such a calculator. At their core, computer programs are algorithms written in programming languages that the computer can read and understand.</p><p>I’ve compiled a list of algorithms and data structures that every programmer should be aware of, based on my experience in Competitive Programming and Software Development. With basic examples, we’ll see what they do and where they’re used. This list has been compiled with competitive programming and current production trends in mind.<br>Below are some of the algorithms everyone should know:<br>1.search algorithms<br>2.Sort algorithms<br>3.Dynamic programming<br>4.Hashing<br>5. String matching and parsing</p><p><strong>1.Sort algorithms</strong><br>In Computer Science, sorting is the most studied concept. The idea is to place a list’s objects in a particular order. Even though every major programming language has built-in sorting libraries, understanding how they operate is useful. You may use all of these, depending on the situation. Some of the sorting algorithms mentioned below:<br> <em>Quick Sort <br> Merge Sort<br> Heap Sort<br> Count Sort<br> Selection Sort</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGY1VNlAHRqTmZhUiyB5xA.jpeg" /></figure><p><strong>2. Search Algorithms</strong></p><p>Binary Search (in linear data structures) — Binary search is a technique for searching a sorted dataset quickly. O is the time complexity (log2N). The idea is to split the section of the list that may hold the item in half until there is only one possible item left. The following are some examples of applications:</p><p>i. Suppose searching a student name in the excel sheet based on String matching and binary search</p><p><strong>3. Hashing</strong></p><p>The most commonly used technique for finding suitable data by key or ID is hash lookup. We use the index to access info. We used to look for indexes using Sorting +Binary Search, but now we use hashing.</p><p>Some of the Applications are:-</p><ul><li>IP address -&gt; Path pair for routing mechanisms are stored in routers.</li><li>To evaluate whether a value in a list already exists.</li></ul><p><strong>4.String Parsing and Matching</strong></p><p>One of the most important problems in computer science is pattern matching and searching. There has been a lot of research done on the topic, but there are only two basic requirements for any programmer.</p><ul><li>Regular Expression (String Parsing)</li></ul><p>Frequently, we must validate a string by parsing it against a predefined constraint. It’s widely used in web creation to parse and fit URLs.</p><ul><li>KMP Algorithm (String Matching)</li></ul><p>When we need to fit a short pattern in a long series, we use the Knuth-Morris-Pratt algorithm. When we Ctrl +F a keyword in a document, for example, we conduct pattern matching through the whole document.</p><p><strong>5. Dynamic Programming</strong></p><p>Like the divide-and-conquer technique, solves problems by merging the solutions of subproblems. The Dynamic Programming algorithm solves each sub-problem only once and saves the result in an array or similar data structure, eliminating the need to re-compute the answer each time.</p><p>Applications of DP are:</p><ul><li>Matrix chain multiplication</li><li>Traveling salesman problem</li><li>Longest common subsequence</li></ul><h3><strong>Some reserved keywords one should know</strong></h3><ul><li><strong>INT_MIN and INT_MAX</strong></li></ul><p>In competitive programming, it is often important to assign the integer, the maximum or minimum value the data form can contain, but recalling such a broad and accurate number is difficult. As a result, C++ has macros that represent these numbers, allowing them to be directly added to variables without having to type the whole number.</p><ul><li>INT MAX is a macro that tells you that an integer variable can’t hold any more data than this.</li><li>INT MIN tells us that an integer number can’t have a value lower than this.</li></ul><p>For using these keywords we have to include a header file names as #include&lt;climits&gt;.</p><p>These INT_MAX and INT_MIN are used in computing the min and max in an array.</p><p>The value of INT_MAX is +2147483647.<br>The value of INT_MIN is -2147483648.</p><p>Now one would wonder why there is a need for such reserved keywords below is the answer to the question:-<br>For finding the maximum value in an array the logic is simple we assign the highest value to maxnumber(user-defined variable) to compute the max value.</p><p>Implementation for finding minimum and maximum</p><pre>#include&lt;iostream&gt;          //for computing minimum and maximum <br>#include&lt;climits&gt;<br>using namespace std;<br>int main(){<br>    int n;<br>    cin&gt;&gt;n;<br>    int arr[n];<br>    for(int i=0;i&lt;n;i++){<br>        cin&gt;&gt;arr[i];<br>    }<br>    int maxnumber=INT_MIN;<br>    int minnumber=INT_MAX;<br>    for(int i=0;i &lt;n;i++){<br>        maxnumber=max(maxnumber,arr[i]);<br>        minnumber=min(minnumber,arr[i]);<br>    }<br>    cout&lt;&lt;maxnumber&lt;&lt;endl;<br>    cout&lt;&lt;minnumber;<br>return -1<br>}</pre><h3><strong>Lets Learn :-</strong></h3><h3><strong>Search Algorithms</strong></h3><p>The most popular search algorithms are linear and binary search. Let&#39;s discuss a little for both of them.</p><h3>LINEAR SEARCH</h3><p>A technique for finding an element inside an array. It consecutively checks every element of the array until a match is found or the entire array has been transverse. The time complexity of the linear search is big O(n).</p><h3>BINARY SEARCH</h3><p>So for searching, we prefer to use binary over linear because of its time complexity. The time complexity of the binary search is big O(logn)</p><p>Let&#39;s take this by a general example:<br>Suppose there is a pile of answer sheets placed at your desk from roll number 1 to 100 and somebody asked u to give the answer sheet of roll number 50 then u instead of searching the roll number from 1 to 50 u pick half of the pile and kept it aside and now check which roll number is up if the roll number is greater than the required roll number then u discard the other pile of sheets and search for the pile having the required roll number.<br>One thing to note here there has to a sorted array to apply Binary Search. It works on the principle of Divide and Conquer.</p><p>For more information on algorithms and their implementation, one should go on geeks for geeks.</p><p><strong>Conclusion</strong></p><p>As I have given an idea of what important things a developer should know as many of them are not familiar with this stuff in their early stages. And every programmer has to practice daily for holding a good grasp in coding and its true “DATA STRUCTURES AND ALGORITHMS ARE THE HEART OF COMPUTER SCIENCE”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f037175ce5e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>