Abhinav Bhatia
IndividualForum Replies Created
-
Abhinav
MemberJune 2, 2016 at 8:53 am in reply to: Can we create a dynamic html table on visualforce page?Hi Ajit,
Yes you can create that. Below this the small snippet.
<HTML>
<HEAD>
<TITLE> Add/Remove dynamic rows in HTML table </TITLE>
<SCRIPT language="javascript">
function addRow(tableID) {var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);var cell1 = row.insertCell(0);
var element1 = document.createElement("input");
element1.type = "checkbox";
element1.name="chkbox[]";
cell1.appendChild(element1);var cell2 = row.insertCell(1);
cell2.innerHTML = rowCount + 1;var cell3 = row.insertCell(2);
var element2 = document.createElement("input");
element2.type = "text";
element2.name = "txtbox[]";
cell3.appendChild(element2);}
function deleteRow(tableID) {
try {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;for(var i=0; i<rowCount; i++) {
var row = table.rows[i];
var chkbox = row.cells[0].childNodes[0];
if(null != chkbox && true == chkbox.checked) {
table.deleteRow(i);
rowCount--;
i--;
}}
}catch(e) {
alert(e);
}
}</SCRIPT>
</HEAD>
<BODY><INPUT type="button" value="Add Row" onclick="addRow('dataTable')" />
<INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')" />
<TABLE id="dataTable" width="350px" border="1">
<TR>
<TD><INPUT type="checkbox" name="chk"/></TD>
<TD> 1 </TD>
<TD> <INPUT type="text" /> </TD>
</TR>
</TABLE></BODY>
</HTML> -
Hi Himanshu,
Please go through the below link. I hope this will help.
https://help.salesforce.com/HTViewHelpDoc?id=entitlements_process_overview.htm&language=en_US
-
Hi Suyash,
Permission for an Apex class is checked only at the top level. For example, if class A calls class B, and a user profile has access only to class A but not class B, the user can still execute the code in class A. Likewise, if a Visualforce page uses a custom component with an associated controller, security is only checked for the controller associated with the page. The controller associated with the custom component executes regardless of permissions.
You can set Apex class security via:
1.The Apex class list page
2.An Apex class detail page
3.Permission sets
4.Profiles -
Abhinav
MemberMay 31, 2016 at 3:33 pm in reply to: Can any one provide a code snippet for displaying the date time value on visualforce pageHi Ajit,
Please use the below snippet. I hope this will solve the issue.
<apex:page controller="TimeZoneController">
<apex:outputText value="{0,date,dd/MM/yyyy HH:mm:ss}">
<apex:param value="{!NOW()+offset}"/>
</apex:outputText>
</apex:page>public class TimeZoneController{
public Double offset{get{
TimeZone tz = UserInfo.getTimeZone();
//Milliseconds to Day
return tz.getOffset(DateTime.now()) / (1000 * 3600 * 24.0);
}}
public TimeZoneController(){
}
} -
Abhinav
MemberMay 30, 2016 at 2:56 pm in reply to: Can we create a collapsible pageblock table or Html table on a visualforce page?Hi Ajit,
Please use the below example/code. This will help you.
<apex:page >
<apex:pageBlock id="block1">
<apex:pageBlockSection id="section1" columns="2" collapsible="true" title="Title">
Example Area
</apex:pageBlockSection>
<font color="#FF0000"><script>
twistSection(document.getElementById('{!$Component.block1.section1}').getElementsByTagName('img')[0])
</script></font>
</apex:pageBlock>
</apex:page> -
Abhinav
MemberMay 30, 2016 at 2:54 pm in reply to: Is there any javascript by which we can provide a drag and drop functionality on a visualforce page?Hi Ajit,
You can refer to the link below. I hope this will help.
-
Abhinav
MemberMay 30, 2016 at 2:53 pm in reply to: What is the best way to move meta data from one org to another Salesforce org?Hi Ajit,
Eclipse is a good option to move entire code from One Dev Org to another. When you move your entire code from One Dev Org to another using Eclipse, you just need to select all components from source org. Validate the components. If you'll get any sync error. You need to fix it in your source org first. The custom button for VF page will be synced automatically when you select object and linked page. There is no separate option to select buttons.
-
Hi Ajit,
You can use the import tools provided by salesforce.
Setup> Data Management
You can choose:
1.Import Accounts/Contacts
2.Import Leads
3.Import Custom ObjectsThese imports tools will allow you to map fields from your files to the fields in your new org.
-
Abhinav
MemberMay 30, 2016 at 2:46 pm in reply to: I need to make a visualforce page that could support multiple languages, how translation workbench can be helpful in implementing the same.Hi Himanshu,
To use translation workbench, make sure to set desired target languages to active under Administration Setup -> Translation Workbench -> Translation Settings. If languages are set to active, field labe translations in VF site pages can be referenced using syntax "<apex:outputLabel value="{!$ObjectType.MyObject__c.fields.Name__c.label}" />" and the site will translate them correctly to the current site users' language.
-
Abhinav
MemberMay 30, 2016 at 2:43 pm in reply to: How to set up call centre in Salesforce using "Open CTI"?Hi Himanshu,
You can refer to the below document. This will make you more clear.
http://resources.docs.salesforce.com/200/20/en-us/sfdc/pdf/salesforce_cti_admin_cheatsheet.pdf
-
Abhinav
MemberMay 30, 2016 at 2:41 pm in reply to: How to deploy manage package through ANT migration tool?Hi Himanshu,
You cannot directly use ANT to deploy managed packaged components.
For deploying managed packages you have to use some ant macro like this :<macrodef name="installPackage" description="Installs the given managed package">
<attribute name="namespace" description="Namespace of managed package to install."/>
<attribute name="version" description="Version of managed package to install."/>
<attribute name="packagePassword" description="Password used to install the pacakge. Optional." default=""/>
<attribute name="username" description="Salesforce user name."/>
<attribute name="password" description="Salesforce password."/>
<sequential>
<!-- Generate optional <password> element? -->
<if><equals arg1="@{packagePassword}" arg2=""/>
<then><property name="passwordElement" value=""/></then>
<else><property name="passwordElement" value="<password>@{packagePassword}</password>"/></else>
</if>
<!-- Generate working folder and metadata files representing the package to install -->
<delete dir="${basedir}/installdeploy"/>
<mkdir dir="${basedir}/installdeploy"/>
<mkdir dir="${basedir}/installdeploy"/>
<mkdir dir="${basedir}/installdeploy/installedPackages"/>
<echo file="${basedir}/installdeploy/package.xml"><![CDATA[<Package xmlns="http://soap.sforce.com/2006/04/metadata"><types><members>@{namespace}</members><name>InstalledPackage</name></types><version>28.0</version></Package>]]></echo>
<echo file="${basedir}/installdeploy/installedPackages/@{namespace}.installedPackage"><![CDATA[<InstalledPackage xmlns="http://soap.sforce.com/2006/04/metadata"><versionNumber>@{version}</versionNumber>${passwordElement}</InstalledPackage>]]></echo>
<sf:deploy deployRoot="${basedir}/installdeploy" username="@{username}" password="@{password}"/>
</sequential>
</macrodef> -
Hi Himanshu,
Outbound Sales is when you go out to find and bring clients, or cold calling in other words push sales.
Inbound is when you try to bring the customers or leads to you, this is done by doing digital marketing, it is also called pull sales.
-
Abhinav
MemberMay 27, 2016 at 1:45 pm in reply to: Why is assignment within a predicate allowed in Apex?Hi Himanshu,
There are a few cases where this behaviour is useful in e.g. Java (reading files):
while((s = br.readLine()) != null) { ... }
or C (strcpy):while ((*s++ = *s2++) != 0);
or in Apex tests (where contact is a field of a fixture class);insert contact = new Contact(FirstName = 'Jane', LastName = 'Doe');
-
Hi Ravi,
I think this largely depends on how you frame the situation. If it's simply an integration between two systems then it's common practice to have an integration user in Salesforce to represent the remote system.
However, if the PHP application is more of a front end for Salesforce used by multiple users, who individually 'own' data records, then you should be using a licence per user, as all you're really doing is creating your own user authentication layer above the platform which is not allowed according to the T&Cs.
Update If the users own contacts as you say, then I'm afraid you're falling on the side of needed licences for each user. If they contacts are shared and visible to all, without being tied to particular users then you could just use the one licence, but it sounds like you'd still be toeing the line in this scenario.
-
Hi Ravi,
We have hit those limits by the nature of the things we were trying to implement. Luckily they are soft limits where a rep will get in touch to talk about increasing bandwith for a fee. If you think your going to be getting close, hedge your bets by letting the client know they might need to purchase extra capacity if their usage increases over time.
-
Abhinav
MemberMay 27, 2016 at 1:33 pm in reply to: How can we inactivate users who have not logged in last 120 days?Hi Himanshu,
List<User> usersToUpdate = new List<User>();
for(User u : [Select id, IsActive from User where isActive=true and lastLoginDate <= :DATE.TODAY()-120]){
u.IsActive = false;
usersToUpdate.add(u);
}if (usersToUpdate.size()>0){
update usersToUpdate;
}There are some limitation to do this:
1.Cannot deactivate self user record.
2.Cannot deactivate a user record which is referenced in another user record in a hierarchy custom field.
3.Make a Schedule Class apex and invoke via schedule UI in Salesforce. Every night for example.
-
Abhinav
MemberMay 27, 2016 at 1:31 pm in reply to: Can we open files/attachments in Salesforce1 without enabling Chatter?Hi Piyush,
I've confirmed with Salesforce support, we need to enable Chatter in-order to open files or attachments in Salesforce1. Currently, there is no option for separating Salesforce Files and Chatter.
-
Abhinav
MemberMay 27, 2016 at 1:29 pm in reply to: How does query() API call count against my daily limit?Hi Himanshu,
Every time the request is properly handled by the server, one API call is consumed. Specifically, in regards to queries, there's two functions, named query and queryMore. Every call to query and queryMore counts as one API call. So, the more records you return, the more times you'll have to call queryMore, and the more API calls you'll consume.
As you may know, query and queryMore are limited by a Batch Size, which means that the API consumption of a query is a function of how many results are returned and the Batch Size of that result set.
The cost complexity of the query (including sub-queries and other relationship queries) are not cost factors, although in exchange for this freedom, we do have limitations on what we can query so that the query cost has an upper limit on how many resources are used by the salesforce.com servers.
For example, there's limits on query complexity, and some special per-object limits. You can read more about those limits in SOQL and SOSL Limits. Fortunately, we have several tools available to us.
-
Abhinav
MemberMay 27, 2016 at 1:28 pm in reply to: Why have database rows not been inserted when the debug log says they have?Hi Himanshu,
When a queue owns a case record in SF and the sharing model for the case is private.
Only queue members and their direct reports can view or take ownership of [those] cases. -
Abhinav
MemberMay 27, 2016 at 1:27 pm in reply to: Is it possible to use Office-connect with sandbox?Hi Ravi,
Looks like this is possible.
-
Abhinav
MemberMay 27, 2016 at 1:26 pm in reply to: How to write test class for code coverage of pagereference method in Salesforce?Hi Ajay,
Min__c min1 = new Min__c();
min1.name='test1';
min1.SMS_Description__c ='test3';
insert min1;PageReference pageRef = Page.ExhibitAadminTier; // Adding VF page Name here
pageRef.getParameters().put('id', String.valueOf(min1.id));//for page reference
Test.setCurrentPage(pageRef);
ApexPages.currentPage().getParameters().put('RecordType','ExhibitAadminTier');
ApexPages.StandardController sc = new ApexPages.standardController(min1);
ExhibitAadminTier controller = new ExhibitAadminTier(sc);
controller.save1();//Page Reference method name -
Abhinav
MemberMay 27, 2016 at 1:23 pm in reply to: Is there a way to setup continuous integration for Apex tests?Hi Ravi,
I ran into some issues with this in practice and there was no way to get true automation (i.e., set it and forget it). We were also setting it up with Selenium.
Here were the issues that I have faced.
1. Some features aren't supported in the metadata API and cannot be moved via the ant migration. If you have any unit tests that work with those features, you have to manually work on your CI org.
2.Deletions are harder to maintain. You have to manually update and apply a destructiveChanges.xml file or replicate the deletion in the CI org.
3.We ran into a situation where some metadata XML files had 'invalid' data in them. The suggested solution was to build a post checkout script that manipulates the offending XMLs into valid XMLs. Not ideal.
4.On projects, we wanted to track just our changes and push out just our changes in source control. In theory, this would allow much easier rebaselining. This would have required more manual maintenance of XML files (e.g., 2 new fields added on Account and only want to push those 2 fields not all (*) fields).
My conclusion is that it is worth doing if you can get it set up, but if you are working on shorter term projects and don't have a decent amount of time budgeted in for it, it probably isn't worth setting up. -
Abhinav
MemberMay 27, 2016 at 1:20 pm in reply to: How to invite people to user chatter via Apex code?Hi Piyush,
You can do this in Apex by inserting a CollaborationInvitation.
String emailAddress = '[email protected]';
CollaborationGroup chatterGroup = [SELECT Id
FROM CollaborationGroup
WHERE Name='All acme.com'
LIMIT 1];
CollaborationInvitation inv = New CollaborationInvitation();
inv.SharedEntityId = chatterGroup.id;
inv.InvitedUserEmail = emailAddress;try {
Insert inv;
} catch(DMLException e){
System.debug('There was an error with the invite: '+e);
} -
Abhinav
MemberMay 27, 2016 at 1:19 pm in reply to: Is there some way to view a history of anonymous block executions?Hi Ravi,
Currently, there is no way of retrieving historical anonymous code block executions. If you close the IDE, then you lose what you have in the anonymous block, but if you are working with the Developer Console in the browser, and log out of your current session, you still have the last executed code when you log back in.
-
Hi Suyash,
According to Salesforce, “SalesforceIQ for Small Business is an out-of-the-box Customer Relationship Management (CRM) solution that can be set up in minutes. “It automatically tracks and analyzes the day-to-day interactions that create and sustain business relationships.” It works with your Gmail or Exchange email to collect and analyze “relationship intelligence.” Having such intelligence is supposed to help you be a better salesperson, says Salesforce.