Kumar Roopam
IndividualForum Replies Created
-
Kumar
MemberJanuary 23, 2017 at 10:50 am in reply to: How can we integrate through Ip address using REST API in salesforce?Hi Vikas,
You can use Sites for this purpose, and it does not require any authorisation too.
Hope this helps.
-
Kumar
MemberJanuary 23, 2017 at 9:58 am in reply to: How to display Salesforce fieldset using Lightning Component?You can refer to this post. Hope this helps.
-
Hi Vikas,
This is a known issue. Soon, salesforce will be requiring all connections to be TLS v1.1 or higher.
To fix this issue, follow this blog.
Hope this helps.
-
Kumar
MemberJanuary 23, 2017 at 7:51 am in reply to: What are the rules for Mapping URI S in salesforceHi Vikas,
URL mapping is used to expose your APEX class as a REST resource.
These are some considerations when using this annotation:
- The URL mapping is relative to https://instance.salesforce.com/services/apexrest/.
- A wildcard character (*) may be used.
- The URL mapping is case-sensitive. A URL mapping for my_url will only match a REST resource containing my_url and not My_Url.
- To use this annotation, your Apex class must be defined as global.
For more info regarding path mapping guidelines and what happens when the request URI is not the same, go to this link.
Hope this helps.
- This reply was modified 7 years, 10 months ago by Kumar.
-
Kumar
MemberJanuary 23, 2017 at 7:37 am in reply to: How can show input text as pick-list depends on the another pick-list value in salesforce?Hi Naveen,
Here is an example with countries and states. First, define your Visulforce Page with the picklists.
You can see that it uses a custom controller and an event "onchange" on country list to change the content of the states list when you select a country.Here is the code:
<apex:page controller="ctlDepPickLst">
<apex:form >
<apex:pageBlock>
<apex:pageBlockSection columns="2">
<apex:pageblockSectionItem>
<apex:outputLabel value="Country"/>
</apex:pageblockSectionItem>
<apex:pageblockSectionItem>
<apex:selectList size="1" value="{!country}">
<apex:selectOptions value="{!countries}"/>
<apex:actionSupport event="onchange" reRender="a"/>
</apex:selectList>
</apex:pageblockSectionItem>
<apex:pageblockSectionItem>
<apex:outputLabel value="State"/>
</apex:pageblockSectionItem>
<apex:pageblockSectionItem>
<apex:selectList size="1" value="{!state}" id="a">
<apex:selectOptions value="{!states}"/>
</apex:selectList>
</apex:pageblockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>Here is the custom controller:
public class ctlDepPickLst {
public String country {get;set;}
public String state {get;set;}public List<SelectOption> getCountries()
{
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('None','--- Select ---'));
options.add(new SelectOption('US','United States'));
options.add(new SelectOption('IN','India'));
return options;
}public List<SelectOption> getStates()
{
List<SelectOption> options = new List<SelectOption>();
if(country == 'US')
{
options.add(new SelectOption('CO','Colorado'));
options.add(new SelectOption('NE','Nevada'));
options.add(new SelectOption('TE','Texas'));
}
else if(country == 'IN')
{
options.add(new SelectOption('BI','Bihar'));
options.add(new SelectOption('KE','Kerala'));
options.add(new SelectOption('MA','Manipur'));
}
else
{
options.add(new SelectOption('None','--- Select ---'));
}
return options;
}
}Hope this helps.
- This reply was modified 7 years, 10 months ago by Kumar.
-
Kumar
MemberJanuary 19, 2017 at 2:21 pm in reply to: Controller calling from JavaScript in SalesforceHi Vikas,
You will have to use the <apex:actionFunction> tag for this, refer to the developer guide on how to use it.
Hope this helps.
-
Kumar
MemberJanuary 19, 2017 at 2:14 pm in reply to: How to Perform show/hide toggle using JavaScript on a salesforce visualforce page?Hi Sushant,
You will have to implement this by changing the style for each part of your page that you wish to hide and show. Something like:
<button onclick="myFunction()">Try it</button>
<div id="myDIV">
This is my DIV element.
</div><script>
function myFunction() {
var x = document.getElementById('myDIV');
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
}
</script> -
Kumar
MemberJanuary 19, 2017 at 2:12 pm in reply to: How can we resize image in upload in visualforce before save in attachment?Hi Mohit,
You may use the HTML5 canvas tag for this. I don't know much of HTML5, but you can refer to this link for more guidance.
Hope this helps.
-
Kumar
MemberJanuary 19, 2017 at 2:04 pm in reply to: How can I use pagination in a salesforce visualforce page when using a Controller Extension?Hi Sushant,
You will have to use offset in query. Check offset section in below link:
https://developer.salesforce.com/page/Paginating_Data_for_Force.com_Applications
Hope this helps.
-
Kumar
MemberJanuary 19, 2017 at 1:59 pm in reply to: Can a future method conflict with a queueable method in Salesforce?Hi Sushant,
You will have to use the FOR UPDATE clause to avoid this scenario.
In Apex, you use FOR UPDATE to lock sObject records while they’re being updated in order to prevent race conditions and other thread safety problems. While an sObject record is locked, no other client or user is allowed to make updates either through code or the Salesforce user interface. The client locking the records can perform logic on the records and make updates with the guarantee that the locked records won’t be changed by another client during the lock period. The lock gets released when the transaction completes.
To lock a set of sObject records in Apex, embed the keywords FOR UPDATE after any inline SOQL statement. For example, the following statement, in addition to querying for two accounts, also locks the accounts that are returned:
Account [] accts = [SELECT Id FROM Account LIMIT 2 FOR UPDATE];
Note: You can’t use the ORDER BY keywords in any SOQL query that uses locking. For more info, see avoiding deadlocks. -
Kumar
MemberJanuary 18, 2017 at 1:43 pm in reply to: How to change the color of a custom button in salesforce?Hi Tanu,
There is no way to declaratively modify the color of a standard button that is part of Salesforce configuration. You can see this other post on some crafty ways to modify the Salesforce CSS.
-
Kumar
MemberJanuary 18, 2017 at 1:38 pm in reply to: How to restrict my org code with an another user of my org in salesforce?Hi Pranav,
The visibility of the Apex classes is controlled by the system permission 'View Setup and Configuration’ on the user's profile. There is currently no option to make that more granular and e.g. exclude APEX code from the 'View Setup and Configuration'.
The 'Security' on Apex classes defines which users/profiles can run the code. More info on that here.
Hope this helps.
-
Kumar
MemberJanuary 18, 2017 at 1:35 pm in reply to: How to call an Apex class / method from Salesforce Visual Workflow?Hi Ashley,
You can also use the Process.Plugin interface to do the same. But this method is not recommended by Salesforce.
Refer to this link for details. Hope this helps.
-
Kumar
MemberJanuary 18, 2017 at 1:29 pm in reply to: How to select all fields of an object dynamically on Salesforce visualforce page?Hi Pranav,
To render the <apex:column> dynamically based on the number of fields queried, you should have a tap on number of fields queried in a list of string. Then use that list of fields to get the values from your list using <apex:repeat>.
For example:
String query;
public exportContactRecords()
{
String objectName = 'Contact';
Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Map<String, Schema.SObjectField> fieldMap = schemaMap.get(objectName ).getDescribe().fields.getMap();
set<string> mapset = fieldMap.keyset();Then do something like,
List<String> lstFields = new List<String>();
for ( String str:mapset )
{lstFields.add(str);
}
Then use this lstFields List in your repeat tag, like this,
<apex:repeat value="{!lstFields}" var="FieldLable">
<apex:column value="{!c[FieldLable]}"/>Hope this helps.
- This reply was modified 7 years, 10 months ago by Kumar.
-
Kumar
MemberJanuary 18, 2017 at 1:14 pm in reply to: How to get parent Salesforce lightning component's attribute in child component?Hi Tanu,
You have two options.
- Fire an event that your containing component can listen for and act upon.
- Pass in a reference to the attribute to the child component.
<c:childComponent myValue="{!v.B}"/>
When the childComponent updates myValue, v.B will also update.
Hope this helps.
-
Kumar
MemberJanuary 16, 2017 at 12:52 pm in reply to: How can I add a new Clean Rule in my Salesforce Developer Org?Hi Pranav,
Refer to this link, which explains the requirements and procedure to create new clean rules.
Hope this helps.
-
Hi Regula,
I don't you can directly do this, but this can be achieved by using a workaround.
- Add a check box to the object, but don't show it on the page layout.
- Check whether this is true on all your validations , workflows or triggers.
- During data import turn this check box off.
Hope this helps.
-
Kumar
MemberJanuary 16, 2017 at 10:24 am in reply to: Any method through which i can restore the deleted account in salesforce if i don't remember the account name?Hi Pranav,
If you remember the deletion time, then you can query by 'LastModifiedDate' which holds the deletion day and time of the record.
So, you could do something along the lines of:
SELECT Id,Name FROM Account WHERE isDeleted = True AND LastModifiedDate = '<your value>' ALL ROWS
and then undelete the specific account.
Hope this helps!
-
Kumar
MemberJanuary 16, 2017 at 10:12 am in reply to: How can we view records of Custom object without launching it as tab in Salesforce ?Hi Vikas,
You can use the query editor in the developer console to view any object's records, irrespective of if it has been launched as a tab.
For example:
SELECT Id, name, UnitPrice FROM PricebookEntry
Then use the 'open detail page' button for any specific record to view its detail page.
Hope this helps.
-
Kumar
MemberJanuary 16, 2017 at 10:07 am in reply to: When we install unmanage package in our org, do we need to rerun all the test classes in Salesforce?Hi Vikas,
Test classes need to pass in the dev org when packaging. Not needed when installing
However, you should design your tests as best you can to pass in customer org. Also if performing call outs, provide a framework that your subscriber can use in their tests to mock responses when your package makes a call out during their tests.
So while they do not have to pass in subscriber org technically, it is still considered a good practice to design your test classes to run in the customer org.
-
Kumar
MemberJanuary 16, 2017 at 10:04 am in reply to: Callback Function in Java Script Remoting in salesforceHi Vikas,
Remote Objects sends all requests to the Salesforce service asynchronously. Your code handles responses to Remote Objects operations in a callback function that you provide. Callback functions handle updating the page with the results of the operation and errors that are returned.
When you invoke a Remote Objects operation, you provide the parameters of the operation and, optionally, a callback function. Your JavaScript code continues uninterrupted after you invoke the operation. When the remote operation is completed and results are returned, your callback function is invoked and receives the results of the operation.
For an example and more information refer to the developer guide.
-
Kumar
MemberJanuary 16, 2017 at 7:25 am in reply to: What are the uses of Lightning Schema in Salesforce?Hi Sushant,
Schema Builder provides a dynamic environment to add new custom objects, custom fields, and relationships to your schema. This eliminates the need to click from page to page to find the details of a master-detail relationship or to add a new custom field to an object in your schema. For example, if you’re using Schema Builder to view the details of your schema, you can add a new custom object without leaving Schema Builder. The drag-and-drop interface lets you easily add a custom object or new field, and saves the layout of your schema any time you move an object.
Schema Builder provides details such as the field values, required fields, and how objects are related by displaying lookup and master-detail relationships. You can view the details for both standard and custom objects in Schema Builder.
For more info on how to use Schema Builder, refer to this trailhead module.
-
Hi Vikas,
Your controller code seems to be fine, please check your page. Maybe there is some minor formatting error associated with the button you made on the page.