• Laxman Vattam 26
  • NEWBIE
  • 75 Points
  • Member since 2016

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 22
    Replies
Hi All,
I have one custom as Student__c. I have one custom picklist as Status__c and values for Status__c are New,Joined. Default value for Status__c is New.
I have one more field as Total_Students__c (Number Data type).
After creating first record, if Status__c is changed to Joined then I want to auto fill Total_Students__c = 1.
After creating second record, if Status__c is changed to Joined then I want to auto fill Total_Students__c = 2.
Like this I want auto number fill for  Total_Students__c when ever Status__c is changed to Joined.

Please suggest me how can I do this?

Thanks in Advance

 
Hello, 

I was asked to take a stab at implementing another system with Salesforce which will pull information from Salesforce Opportunity object into their mobile app. Since this is my very first time working with API's, I'm extremely lost on where to start. 

I read bunch of articles and the developer guide to understand the different API's and their use. However, my confusing is on what the first step is, I should be taking.

Problems or task at hand: We are looking at a mobile Timecard application, where users will use the app to login and pull up a Opportunity record (I'm guessing this is just the name of opportunity) and stamp their time to clock in and out of a job. I was provided with their TimeCard SOAP API documentation to take a look at the api's and the library. 

Questions
1. What is the first step should I be doing? (If I'm not wrong, I believe we will also be updating few fields on Opportunity after they have entered their time to clock in or out. If not Oppostunity record, then related object to Opportunity) 
2. What questions should I be asking them (the developer from Timecard app)? 
3. Do I write a webservice, generate Apex WSDL and give it to them? (Assuming data needs to go from Salesforce to their system)
4. I don't have any experience in .NET, do I need to? 
5. Why do I need to look at their API documentation? Are they assuming that I will be writing code on their end? Again, going back what should I be asking them? How does this usually work?
6. What do I do with the WSDL file when they give me their, if they do (steps by steps)? 

As you can tell I have never worked with webservices and api's but I think this is a very good opportunity for me to learn hands on and work with it. Even though it is very short amount of time to soak everything up, I am hoping someone will guide me to the right direction. Also, I do not have any mentor or go to person to ask since I'm the solo Salesforce person working here. SO, I will be needing lots of help. Any guidance will be truly appreciated! 

Thank you. 
We are recieving data from external system and we are trying to process the data using apex and bulk api 2.0
As per Salesforce documentation for Bulk Api 2.0, when trying to perform 'Patch' method, it is throwing an error that 'Patch' is not supported
Based on various forums, tried below solutions but they are not working. How to get around this issue and execute bulk api from apex?

https://salesforce.stackexchange.com/questions/13294/patch-request-using-apex-httprequest
https://salesforce.stackexchange.com/questions/57215/how-can-i-make-a-patch-http-callout-from-apex
https://salesforce.stackexchange.com/questions/13294/patch-request-using-apex-httprequest
 
what is the best way to post around 5000 records of data onto Salesforce in one go from external system?
Requirement: We have a requirement to download a particular version of file (contentVersion: using the versiondata field on contentversion) and upload this docuement to sharepoint. Documents can be of any type. For e.g. PDF, Doc, CSV, Png, txt etc. -

Problem Statement:  We are able to read the content version data from contentversion object. But Salesforce encodes the document into the binary file while storing it into Salesforce. While uploading the document(via REST integration) into SharePoint, we are not able to decode the binary file into the actual file stored and hence the uploaded document is not opening in SharePoint site with following error “Failed to load the document. 

Many solutions in forums suggest to use EncodingUtil.base64Decode(inputString) or convertToHex(inputBlob) but these conversions are failing with error message (Not a valid UTF 8 character or  Illegal hexadecimal character � at index )

Can someone shred some light on how to convert this before sending to sharepoint so that is is in readable format?
I have inline VF page on Account page layout. This inline page may or maynot have records and even if records are present, it can be very low in number. When the number of records are none/less, it is showing white space at the botton of this inline page which doesnt look good. How to remove this white space below the inline page?
I want to show 5 different custom object records in hierarchial way in Visualforce page. All these 5 objects are linked thru parent child relationships
CObject1
      CObject 2
             CObject3
                   CObject4
                         CObject5

As you see, each object is child to another. Now I want to display first record of CObject1 then followed by all its children and then second record of CObject1 followed by all 4 children and so on. How can I achieve it?



 
What is the best approach to implement retail websites using Salesforce? I'm trying to implement a construction equipment rental website using Salesforce. I'm trying to avoid creating logins on Salesforce for customers as there may be too many customers and it will be costly to maintain Salesforce/Force.com licenses or any other licenses for each of the customer. One of the approach can be hosting public websites that can make calls to Salesforce for all data extracts and updates. There will be few challenges in terms of maintaining security to make sure customer sees only his data. Any other suggestions or approaches to implement it?
I'm building a home page lightning component where once a user clicks a link, we should launch create page of particular (particular record type) 'Case' record. I'm trying to use the below code in lightning component. When the link is clicked, it is launching default 'Case' record create page. It does nto consider the record type being passed but rather launches create page for default record page. How to overcome of this issue and launch correct record type page for case?
 
<li class="slds-list__item slds-p-bottom--xxx-small">
     <a href="/500/e?retURL=%2F500%2Fo;RecordType=0120j0000008ABC">{!$Label.c.LblHomepage}</a>
</li>



 
Requirement: We have a requirement to download a particular version of file (contentVersion: using the versiondata field on contentversion) and upload this docuement to sharepoint. Documents can be of any type. For e.g. PDF, Doc, CSV, Png, txt etc. -

Problem Statement:  We are able to read the content version data from contentversion object. But Salesforce encodes the document into the binary file while storing it into Salesforce. While uploading the document(via REST integration) into SharePoint, we are not able to decode the binary file into the actual file stored and hence the uploaded document is not opening in SharePoint site with following error “Failed to load the document. 

Many solutions in forums suggest to use EncodingUtil.base64Decode(inputString) or convertToHex(inputBlob) but these conversions are failing with error message (Not a valid UTF 8 character or  Illegal hexadecimal character � at index )

Can someone shred some light on how to convert this before sending to sharepoint so that is is in readable format?
I have inline VF page on Account page layout. This inline page may or maynot have records and even if records are present, it can be very low in number. When the number of records are none/less, it is showing white space at the botton of this inline page which doesnt look good. How to remove this white space below the inline page?
I want to show 5 different custom object records in hierarchial way in Visualforce page. All these 5 objects are linked thru parent child relationships
CObject1
      CObject 2
             CObject3
                   CObject4
                         CObject5

As you see, each object is child to another. Now I want to display first record of CObject1 then followed by all its children and then second record of CObject1 followed by all 4 children and so on. How can I achieve it?



 

I want to create a schedulable APEX class that fetches data from an external system using their REST API. For the other system, the developer needs to create an app, and enter an authorized URL for my "app".

How does one get a URL to my Apex class that his app can redirect to?

Thanks for your help!

I want display "dislike" svg image in lightning component. SLDS file don't have this icon. But slds site https://www.lightningdesignsystem.com/icons/ showing this image. Can someone have a look?
  • Text – Required.
  • Length of Opportunity should be 40 or less characters.
  • Add Help Text with the following message:
Opportunity Name must be 40 characters or less.  Please refrain from using special characters in the name
I'm using the following modal example in Lightning Design System, however, inside Salesforce Lightning Experience, this does not display correctly. The top portion of the modal form does not show correctly and I was wondering how to adjust the positioning of this modal. This seems like a defect in the Lightning Design System and was wondering how to go around it. Thanks!



https://www.lightningdesignsystem.com/components/progress-indicator/
<div role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="header43">
  <div class="slds-modal__container">
    <div class="slds-modal__header">
      <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close">
  
        <span class="slds-assistive-text">Close</span>
      </button>
      <h2 id="header43" class="slds-text-heading--medium">Modal Header</h2>
    </div>
    <div class="slds-modal__content slds-grow slds-p-around--medium"></div>
    <div class="slds-modal__footer slds-grid slds-grid--align-spread">
      <div class="slds-progress slds-progress--shade slds-order--2">
        <ol class="slds-progress__list">
          <li class="slds-progress__item slds-is-completed">
            <button class="slds-button slds-button--icon slds-progress__marker slds-progress__marker--icon" aria-describedby="step-1-tooltip" title="settings">

              <span class="slds-assistive-text">Step 1 - Completed</span>
            </button>
          </li>
          <li class="slds-progress__item slds-is-active">
            <button class="slds-button slds-progress__marker" aria-describedby="step-2-tooltip">
              <span class="slds-assistive-text">Step 2 - Active</span>
            </button>
          </li>
          <li class="slds-progress__item">
            <button class="slds-button slds-progress__marker" aria-describedby="step-3-tooltip">
              <span class="slds-assistive-text">Step 3 </span>
            </button>
          </li>
          <li class="slds-progress__item">
            <button class="slds-button slds-progress__marker" aria-describedby="step-4-tooltip">
              <span class="slds-assistive-text">Step 4 </span>
            </button>
          </li>
          <li class="slds-progress__item">
            <button class="slds-button slds-progress__marker" aria-describedby="step-5-tooltip">
              <span class="slds-assistive-text">Step 5 </span>
            </button>
          </li>
        </ol>
        <div class="slds-progress-bar">
          <span class="slds-progress-bar__value" style="width:25%;">
            <span class="slds-assistive-text">Progress: 25%</span>
          </span>
        </div>
      </div>
      <button class="slds-button slds-button--neutral slds-order--1">Cancel</button>
      <button class="slds-button slds-button--brand slds-order--3">Save</button>
    </div>
  </div>
</div>
<div class="slds-backdrop slds-backdrop--open"></div>
This is the correct display and I should see the header of the modal like below

User-added image

Inside Salesforce Lightning Experience - this is what I see and this is not correct as the header of the modal is not displayed at all
User-added image
Hi,
I am totally new with lightning and I am trying to switch some objtects from classic to lightning.
I have one visualforce page that checks one variable, and if it is true it redirects to another direction.
In classic it uses the "window.location.href", but it won't work with lightning, so I have added the following code:
 
<apex:form id="form">
        
        <apex:outputPanel rendered="{!$User.UIThemeDisplayed == 'Theme4d'}">
            
            <script type="text/javascript">
            
            var precondition = {!Lead.Conversion_Precondition__c} || {!ISBLANK(Lead.RecordTypeId)};  
            
            if(precondition){
                String url="{!URLFOR($Action.Lead.Convert, Lead.Id, [retURL='/' + Lead.Id, nooppti=1, IsReminderSet_fu=0], true)}";
                sforce.one.navigateToSObject(url);
            }
            </script>        
        </apex:outputPanel>
        <apex:outputPanel rendered="{!$User.UIThemeDisplayed == 'Theme3'}">
            <script type="text/javascript">
            var precondition = {!Lead.Conversion_Precondition__c} || {!ISBLANK(Lead.RecordTypeId)};  
            if(precondition){
                
                window.location.href = "{!URLFOR($Action.Lead.Convert, Lead.Id, [retURL='/' + Lead.Id, nooppti=1, IsReminderSet_fu=0], true)}";
            }
            </script>
        </apex:outputPanel>

even if I put the sforce.one.navigateto alone it does not work.
any suggestion?

Thanks
Is there a way to know which reports a field from a specific object is being used in? And if it is used as a filter or just a column on the report?
Hi All,
I have one custom as Student__c. I have one custom picklist as Status__c and values for Status__c are New,Joined. Default value for Status__c is New.
I have one more field as Total_Students__c (Number Data type).
After creating first record, if Status__c is changed to Joined then I want to auto fill Total_Students__c = 1.
After creating second record, if Status__c is changed to Joined then I want to auto fill Total_Students__c = 2.
Like this I want auto number fill for  Total_Students__c when ever Status__c is changed to Joined.

Please suggest me how can I do this?

Thanks in Advance

 
Hi everybody,

Is there any way to put custom error message based on some field criteria before submitting for Approval .

Let's say i have field A if it is blank and when i submit for approval then i want custome error message to be dislayed !

Thanks in advance !
How to integrate sharepoint with salesforce??

I have completed code for sharepoint/salesforce integration code below,but I don't know how to implement this step by step i.e within one class or in different class.

I am new in salesforce development,please help me.

How Salesforce Performs Step 1
The main point for cloud based integration is to host a running service on Microsoft’s cloud app platform Azure, and leveraging it to interact with SharePoint. Since the service is hosted on a cloud platform, we usually access it via web-based URL. So our methods from Salesforce side to request authentication token look something like this:
public static String getToken() {
String token;
if(!Test.isRunningTest()) {
token = SharePointAPIUtility.SharePointAPIGet('http://testingalgoworks.azurewebsites.net/Api/Values/GetAuthToken','Test@test.com','TestingPassword');
}
system.debug('token>>> '+token);
if(token != null) {
return EncodingUtil.urlEncode(token.replaceAll('"',''), 'UTF-8');
}
return null;
}
public static String SharePointAPIGet(String endpointUrl,String username, String password) {
try {
HttpRequest httpRequestObject = new HttpRequest();
httpRequestObject.setEndPoint(endpointUrl);
httpRequestObject.setmethod('GET');

Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
httpRequestObject.setHeader('Authorization', authorizationHeader);
httpRequestObject.setTimeout(120000);

system.debug('httpRequestObject>> '+httpRequestObject);

Http http = new Http();
HttpResponse httpResponse ;

if(!test.isRunningTest())
httpResponse = http.send(httpRequestObject);

if(httpResponse != null && httpResponse.getStatus() == 'OK' && httpResponse.getStatusCode() == 200) {
system.debug('httpResponse.getBody();>>>>'+httpResponse.getBody()+'httpResponse.getBody();>>>>');
return httpResponse.getBody();
}
else if(httpResponse != null) {
return 'SharePoint Server Error: Status '+ httpResponse.getStatus()+' Status Code '+ httpResponse.getStatusCode() +' Body '+httpResponse.getBody();
}
} catch(CalloutException ce) {
throw ce;
} catch(Exception ex) {
throw ex;
}
return null;
}
This code hits the Azure service using the URL and receives the authentication token which the Azure service sends.
We will come to the steps 2,3 and 5 right after the 5th:
How Salesforce Performs Step 5
Once Salesforce has authentication token, it uses that to request files and folders from the adapter. Once again it uses the Azure service URL to hit the service.
Here’s a method to request files and a method to request folders
public static List<String> getAllFolders(SharePoint365APIParser objSharePoint365APIParser){
try {
list<String> objFolders = new list<String>();
if(objSharePoint365APIParser.folders != null && objSharePoint365APIParser.folders.size()>0) //null check
for(SharePoint365APIParser.folders sp:objSharePoint365APIParser.folders) {
objFolders.add(sp.name);
}
return objFolders;
} catch(Exception ex) {
throw ex;
}
return null;
}
public static List<String> getFilesByFolder(String folderName, SharePoint365APIParser objSharePoint365APIParser) {
//if(!test.isRunningTest()) {
try{
if(objSharePoint365APIParser.folders != null && objSharePoint365APIParser.folders.size()>0)
for(SharePoint365APIParser.folders sp:objSharePoint365APIParser.folders) {
if(sp.name.equalsIgnoreCase(folderName)) {
if(sp.files.size() > 0) { 
return sp.files;
} else {
return new list<String>();
}
}
}
} catch(Exception ex) {
throw ex;
}
//}//end running test loop

return null;
}
How Azure Performs Step 2, 3, and 4
Once Salesforce has sent the request for authentication token, here’s how Azure platform service authenticates login.
[HttpPost]
public bool Login(string email, string password) {
//throw new Exception("This is error!!");
bool validateLogin = false;
List<string> MessageList = new List<string>();
//string decryptedPassword = Encryption.Decrypt(encryptedPassword);
if (email == ConfigurationManager.AppSettings["Email"] && password == ConfigurationManager.AppSettings["Password"]) {
string authInfo = email + ":" + password;
authInfo = Convert.ToBase64String(System.Text.Encoding.Default.GetBytes(authInfo));
//authInfo = Encryption.Encrypt(authInfo);
System.Web.HttpContext.Current.Response.AppendHeader( "Authorization", "Basic " + authInfo);
// Insert User Token
MessageList.Add("Login Successful");
validateLogin = true;
}
else {
MessageList.Add("Invalid Username Or Password");
}
return validateLogin;
}
How Azure service handles Step 6
Now that Salesforce has authentication token and is logged in on SharePoint, here’s how our Azure service parses the request for file and folder lists.
[AuthorizeWebAPI()]
[HttpGet]
public Folders GetResourceData() {
Folders fld = new Folders();
try {
using (ClientContext clientContext = new ClientContext("https://yourprojectname.SharePoint.com/Resources"))
{
SecureString passWord = new SecureString();
foreach (char c in "TestPassword".ToCharArray()) 
passWord.AppendChar(c);

clientContext.Credentials = new SharePointOnlineCredentials("Test@test.com", passWord);
Web rootweb = clientContext.Web;
var folders = rootweb.GetFolderByServerRelativeUrl("/Resources").Folders;
string pString = @"\Resources\";
clientContext.Load(folders);
clientContext.ExecuteQuery();
fld.folders = new List<Folders>();
fld.name = "Resources";
foreach (Microsoft.SharePoint.Client.Folder myFolder in folders)
{
fld.folders.Add(GetFoldersAndFiles(myFolder, clientContext, pString));
}
}
}
catch (Exception)

fld.name = "Some error happened."; }
return fld;
}
private Folders GetFoldersAndFiles(Microsoft.SharePoint.Client.Folder mainFolder, ClientContext clientContext, string pathString) {
Folders fldr = new Folders();
List<string> fls = new List<string>();
fldr.folders = new List<Folders>();
clientContext.Load(mainFolder, k => k.Files, k => k.Folders);
clientContext.ExecuteQuery();
foreach (var folder in mainFolder.Folders)
{
string folderPath = string.Format(@"{0}{1}\", pathString, folder.Name);
if (folder.Name != "Forms")
fldr.folders.Add(GetFoldersAndFiles(folder, clientContext, folderPath));
}
foreach (var file in mainFolder.Files)
{
fls.Add(file.Name);
}
fldr.files = fls;
if (mainFolder.Name != "Forms")
fldr.name = mainFolder.Name;
return fldr;
}
Hi,

My task is to integrate salesforce with externl website using REST. & they have given me JSON Response code for fields in external website.

I am able to hit the External system URL. I was Struct here...!  and how we can get data from external website & how to code for that...?
Like whenever a user enter their account details in external website, those data should also get into salesforce accounts.

How we can achieve this...?
can anyone help for this scenario...!

 
  • March 22, 2016
  • Like
  • 2
Hi,

I have a custom object to store Milestones and Tasks for a Project Management application which I am building in Salesforce. The Mielstone and Tasks are distinguishable in the custom object using a different record type.

Since Tasks are child of milestones , I need to display my complete project hierarchy using a tree view. I am able to bring in the data however I am facing issues with aligning the column width if I go deeper in the tree view. I want to show 4 columns. Can someone please guide me how to show the tree view keeping the column width fixed?

I tried using nested table but the view becomes clumsy with indendation of the column header as well.

What I want to achieve is something like the one given below

Name                                  Duration                           Assigned to
Milestone 1
        Task 1                         10                                    ABC
        Task 2                         20                                    XYZ
        Milestone 2             
                  Task 1 M2          10                                    DEF
I want to delete a field from the system and wondered if there is a way to query the SFDC and get a list of all the objects the field is used in ?