<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Manage Package &#8211; Jitendra Zaa</title>
	<atom:link href="https://www.jitendrazaa.com/blog/tag/manage-package/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.jitendrazaa.com/blog</link>
	<description>AI, Salesforce, ServiceNow &#38; Enterprise Tech Guides</description>
	<lastBuildDate>Fri, 27 Dec 2019 23:33:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">87744916</site><atom:link rel="search" type="application/opensearchdescription+xml" title="Search Jitendra Zaa" href="https://www.jitendrazaa.com/blog/wp-json/opensearch/1.1/document" />	<item>
		<title>Install Manage Package in Scratch Org using Salesforce DX</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/install-manage-package-in-scratch-org-using-salesforce-dx/</link>
					<comments>https://www.jitendrazaa.com/blog/salesforce/install-manage-package-in-scratch-org-using-salesforce-dx/#respond</comments>
		
		<dc:creator><![CDATA[Jitendra]]></dc:creator>
		<pubDate>Fri, 27 Dec 2019 23:33:51 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[B2B Commerce Cloud]]></category>
		<category><![CDATA[Cloud Craze]]></category>
		<category><![CDATA[CPQ]]></category>
		<category><![CDATA[Field Service Lightning]]></category>
		<category><![CDATA[Manage Package]]></category>
		<category><![CDATA[Salesforce DX]]></category>
		<category><![CDATA[scratch org]]></category>
		<guid isPermaLink="false">https://www.jitendrazaa.com/blog/?p=6930</guid>

					<description><![CDATA[Install CPQ, Field Service Lightning, B2B Commerce cloud in Scratch Org using SFDX Command]]></description>
										<content:encoded><![CDATA[
<p class="justify">There are tons of useful SFDX commands available to help automate Salesforce deployment. However one of most important aspect of Salesforce DX is capability of spinning org within few minutes with features enabled like Person Account, Communities etc. </p>



<p class="justify">There could be times, where these commands might not be sufficient. I recently cam across such  scenario where I wanted to install manage package for quick capability check.</p>



<p class="justify">Scanned through documentation, Stack Exchange and spent lots of time figuring out on how to automate package installation. There are many commands available to install second generation package but not manage package itself. Then I came across <a href="https://github.com/martyychang">marty chang&#8217;s</a> github repository with instruction. </p>



<span id="more-6930"></span>



<p>Here is what we need to do :</p>



<p class="justify">Create a folder named <em>installedPackage</em>s in <em>force-app/main/default</em> folder.</p>



<p class="justify">For this blog post, we would be installing Salesforce CPQ, place below file in <em>installedPackages </em>folder with name <em>SBQQ.installedPackages-meta.xml</em></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;InstalledPackage xmlns=&quot;http://soap.sforce.com/2006/04/metadata&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
    &lt;activateRSS&gt;false&lt;/activateRSS&gt;
    &lt;versionNumber&gt;216.10.1&lt;/versionNumber&gt;
&lt;/InstalledPackage&gt;
</pre></div>


<p class="justify">As you can see, file naming convention is <em>&lt;managepackagenamespace>.installedPackages-meta.xml</em> </p>



<p class="justify">Example of Field Service Lightning , file name <em>FSL.installedPackage-meta.xml</em></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;InstalledPackage xmlns=&quot;http://soap.sforce.com/2006/04/metadata&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
    &lt;activateRSS&gt;false&lt;/activateRSS&gt;
    &lt;versionNumber&gt;4.0.17&lt;/versionNumber&gt;
&lt;/InstalledPackage&gt;
</pre></div>


<p class="justify">Example of B2B Commerce Cloud, file name <em>ccrz.installedPackage-meta.xml</em></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;InstalledPackage xmlns=&quot;http://soap.sforce.com/2006/04/metadata&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
    &lt;activateRSS&gt;false&lt;/activateRSS&gt;
    &lt;versionNumber&gt;3.133.2&lt;/versionNumber&gt;
&lt;/InstalledPackage&gt;
</pre></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.jitendrazaa.com/blog/salesforce/install-manage-package-in-scratch-org-using-salesforce-dx/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6930</post-id>	</item>
		<item>
		<title>Storing secrets or passwords using manage package in Salesforce &#8211; Video</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/storing-secrets-or-passwords-in-salesforce-video/</link>
					<comments>https://www.jitendrazaa.com/blog/salesforce/storing-secrets-or-passwords-in-salesforce-video/#comments</comments>
		
		<dc:creator><![CDATA[Jitendra]]></dc:creator>
		<pubDate>Mon, 15 Feb 2016 04:20:02 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Live coding]]></category>
		<category><![CDATA[Manage Package]]></category>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=5322</guid>

					<description><![CDATA[Designing application to store passwords or secrets in Salesforce using Manage packages]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">Salesforce supports <strong>Encrypted Field </strong>out of the box on standard or custom objects. However, users with appropriate profile or permission set can easily view content of those fields. If we want to store secure information like passwords (of external systems), then there is no direct way to achieve this. If we think about passwords, no one should be able to view it. If we forget password, then instead of system sending old password, it forces us to reset it.</p>
<p style="text-align: justify;">We will create same behaviour in Salesforce where stored password cannot be viewed by anyone.</p>
<p><figure id="attachment_5325" aria-describedby="caption-attachment-5325" style="width: 684px" class="wp-caption aligncenter"><a href="https://i0.wp.com/www.jitendrazaa.com/blog/wp-content/uploads/2016/02/Storing-Passwords-in-Salesforce.png?ssl=1" rel="attachment wp-att-5325"><img data-recalc-dims="1" fetchpriority="high" decoding="async" class="size-full wp-image-5325" src="https://i0.wp.com/www.jitendrazaa.com/blog/wp-content/uploads/2016/02/Storing-Passwords-in-Salesforce.png?resize=684%2C518&#038;ssl=1" alt="Storing Passwords in Salesforce" width="684" height="518" srcset="https://i0.wp.com/www.jitendrazaa.com/blog/wp-content/uploads/2016/02/Storing-Passwords-in-Salesforce.png?w=684&amp;ssl=1 684w, https://i0.wp.com/www.jitendrazaa.com/blog/wp-content/uploads/2016/02/Storing-Passwords-in-Salesforce.png?resize=300%2C227&amp;ssl=1 300w" sizes="(max-width: 684px) 100vw, 684px" /></a><figcaption id="caption-attachment-5325" class="wp-caption-text">Storing Passwords in Salesforce</figcaption></figure></p>
<p style="text-align: justify;"><span id="more-5322"></span>We will need a developer org with any namespace. In my case, namespace is &#8220;Livecoding&#8221;. Namespace can be created from &#8220;Setup | Build | Create | Packages | Developer Settings | Edit&#8221;. We need namespace so that <strong>manage package</strong> can be created. Idea is to have a <strong>protected custom setting. </strong>Protected custom setting can only be accessed in manage package and we will create <strong>global class, </strong>which can be used in subscriber (Client) org to perform various operations related to storing and getting passwords.</p>
<p style="text-align: justify;">I have created custom setting by name &#8220;Livecoding__secrets__c&#8221; (Livecoding is namespace added by default in API name). Field of type text is created to store password by name &#8220;Livecoding__Password__c&#8221;.</p>
<p style="text-align: justify;">To perform various operations, below global class is created with three methods:</p>
<pre class="brush: java; title: ; notranslate">
/**
 * 	@Author			:	Jitendra Zaa
 * 	@Date			:	13-Feb-2016
 * 	@Description	:	Various operations to be performed on passwords	
 * 
 * */
global class Operations {
    
    /**
     * To store username and secret, use this method
     * */
    global static void addSecrets(String username, String password){
        
        Livecoding__Secrets__c obj = new Livecoding__Secrets__c(name = username, Livecoding__Password__c= password);
        insert obj;
    }

	/**
	 * This method checks if password entered is correct or not 
	 * */    
    global static boolean isPasswordCorrect(String username, String password)
    { 
        //read custom setting using SOQL
        List&lt;Livecoding__Secrets__c&gt; lstRecords = &#x5B;SELECT ID FROM Livecoding__Secrets__c WHERE Name = :username AND  Livecoding__Password__c =: password ];
        
        if(lstRecords.isEmpty())
        {
            return false;
        }
        return true;
    }
    
    /**
     * Reset password of existing user 
     * */
    global static boolean resetPassword(String username, String password){
        
        //read custom setting without SOQL
        Livecoding__Secrets__c userRecord = Livecoding__Secrets__c.getValues(username);
         
        if(userRecord == null)
        {
            return false;
        }
        
        userRecord.Livecoding__Password__c = password ;
        update userRecord; 
        
        return true;
    } 
}
</pre>
<p style="text-align: justify;">To create manage package, we must need to have minimum 75% of test coverage. Below test class gives 100% test coverage to our manage package.</p>
<pre class="brush: java; title: ; notranslate">
/**
 * 	@Author			:	Jitendra Zaa
 * 	@Date			:	13-Feb-2016
 * 	@Description	:	Test class for &quot;Operations&quot;
 * */

@isTest
public class OperationsTest {
	
    
    @testSetup 
    static void setupCustomSetting() {
        Livecoding__Secrets__c obj = new Livecoding__Secrets__c(name = 'abc@livecoding.tv', Livecoding__Password__c= 'sample1');
        insert obj;
	}
    
    
    static testMethod void addSecrets_Test(){
        Operations.addSecrets('xyz@livecoding.tv','xyz');
        
        List&lt;Livecoding__Secrets__c&gt; lstCustomSettings = Livecoding__Secrets__c.getAll().values();
        System.assertEquals(lstCustomSettings.size(), 2);  
    }
    
    static testMethod void isPasswordCorrect_No_Test(){
        boolean retValue = Operations.isPasswordCorrect('abc@livecoding.tv', 'password') ;
        System.assertNotEquals(retValue, true) ;        
    }
    
    static testMethod void isPasswordCorrect_Yes_Test(){
        boolean retValue = Operations.isPasswordCorrect('abc@livecoding.tv', 'sample1') ;
        System.assertEquals(retValue, true) ;        
    }
    
    static testMethod void resetPassword_No_Test(){
        boolean retValue = Operations.resetPassword('abc@livecoding.com', 'password') ;
        System.assertEquals(retValue, false) ;  
    }
    
    static testMethod void resetPassword_Yes_Test(){
        boolean retValue = Operations.resetPassword('abc@livecoding.tv', 'password') ;
        System.assertEquals(retValue, true) ;  
        
        retValue = Operations.isPasswordCorrect('abc@livecoding.tv', 'password') ;
        System.assertEquals(retValue, true) ;    
    }    
}
</pre>
<p style="text-align: justify;">In above test class, we have used <strong>@testSetup</strong> method. It is used to create a common test records being used by all <strong>testmethod</strong>. This method is implicitly called before each testmethod in class.</p>
<p style="text-align: justify;">It&#8217;s time to create <strong>Manage package</strong> now. Navigate to &#8220;Setup | Build | Packages | New&#8221;. This manage package will have below three components</p>
<ol>
<li>Protected public setting</li>
<li>Global Apex class to perform operations on Custom Setting</li>
<li>Test class for Apex to cover minimum 75%</li>
</ol>
<p style="text-align: justify;">If we need to store password in any org, we can install above manage package in that org. To perform operations related to password, we can use any of three global methods available in manage package.</p>
<p><strong>Other resources:</strong></p>
<ul>
<li><a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04to0000000Wp7r">Manage package (discussed in this post) to install in client org</a></li>
<li><a href="https://www.livecoding.tv/video/how-to-store-secrets-in-salesforce-2/">Livecoding video</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jitendrazaa.com/blog/salesforce/storing-secrets-or-passwords-in-salesforce-video/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5322</post-id>	</item>
		<item>
		<title>How to Debug Manage Package in Salesforce</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-debug-manage-package-in-salesforce/</link>
					<comments>https://www.jitendrazaa.com/blog/salesforce/how-to-debug-manage-package-in-salesforce/#comments</comments>
		
		<dc:creator><![CDATA[Jitendra]]></dc:creator>
		<pubDate>Wed, 06 Feb 2013 11:47:05 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Manage Package]]></category>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3192</guid>

					<description><![CDATA[Many times as a developer we need to debug the manage package for possible run time error. For example , while uploading contacts using Import wizard we get &#8220;Internal Server Error&#8221; and when we try to look into debug log there is no clear indications. However in my experience i have seen this kind of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">Many times as a developer we need to debug the manage package for possible run time error. For example , while uploading contacts using Import wizard we get &#8220;Internal Server Error&#8221; and when we try to look into debug log there is no clear indications. However in my experience i have seen this kind of error may be because of manage package installed from AppExchange. As per &#8220;Intellectual property&#8221; rights , Salesforce cannot show the debug logs to everyone, However there is one way to achieve by System admins to some extent.</p>
<p style="text-align: justify;">For purpose of this article, i am using one manage package from AppExchange to show how it works.<span id="more-3192"></span></p>
<p style="text-align: justify;">Before performing any operation on installed package, just open the &#8220;<strong>Developer Console</strong>&#8220;. Once you are done, check the logs. You will see something like below screen shot and you will be able to debug at least till some level.</p>
<p><figure id="attachment_3193" aria-describedby="caption-attachment-3193" style="width: 606px" class="wp-caption aligncenter"><a href="https://i0.wp.com/jitendrazaa.com/blog/wp-content/uploads/2013/02/Debug-Manage-Package.png?ssl=1"><img data-recalc-dims="1" decoding="async" class=" wp-image-3193 " alt="Debug Manage Package in Salesforce Using Developer Console" src="https://i0.wp.com/jitendrazaa.com/blog/wp-content/uploads/2013/02/Debug-Manage-Package.png?resize=606%2C458&#038;ssl=1" width="606" height="458" /></a><figcaption id="caption-attachment-3193" class="wp-caption-text">Debug Manage Package in Salesforce Using Developer Console</figcaption></figure></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jitendrazaa.com/blog/salesforce/how-to-debug-manage-package-in-salesforce/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3192</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: www.jitendrazaa.com @ 2026-04-03 18:02:21 by W3 Total Cache
-->