• WahibIdris
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Salesforce Manager Consultant


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
Hi,

I was using HTML component in home page component for advance search functionality in Narrow (Left) Column of Home Layout. My HTML component was 
<script language="JavaScript" type="text/javascript"> 
function setFocusOnLoad() {} 
function submitSearchForm(){ 
var searchField = document.getElementById('advsearchfield'); 
document.advsrch.action = '/search/SearchResults?searchType=2&sen=0&setLast=1&str=' + encodeURIComponent(searchField.value); 
return true; 
} 

</script> 

<form name="advsrch" method="post" onsubmit="return submitSearchForm();"> 
<input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr" />
<input class="btn" value=" Go! " type="submit" /> 
</form>


Now that component is not visible in Summer 15 org, so for the workaround I have created visualforce component and create VF page, below is my code of VF page
<apex:page > 

<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" /> 
<apex:includeScript value="{!$Resource.advSearch}"/> 

</apex:page>

advSearch.js (Static Resource) is
 
$(document).ready(function () { 
function setFocusOnLoad() {} 
function submitSearchForm(){ 
var searchField = document.getElementById('advsearchfield'); 
document.advsrch.action = '/search/SearchResults?searchType=2&sen=0&setLast=1&str=' + encodeURIComponent(searchField.value); return true; 
} 

$form = $("<form/>",{name:"advsrch"},{method:"post"},{onsubmit:"return submitSearchForm();"} ); 
$form.append('<input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr" />'); 
$form.append('<input class="btn" value=" Go! " type="submit"/>'); 

$('body').append($form); });

After doing all the changes, I have found couple of issues 

1) Its not showing the blue container as it is now VF component. Requirement is to show the advance search text field and button in blue container just like other components.
2) Its not calling the function same way as it was before, now it refreshing the whole page   and not going link which I am providing. 

Not sure what am I missing or whats need to be done. Any help would be appreciated. Thanks much 
I am trying to make upsert call to sandbox using Partner WSDL through my .NET application but getting Invalid External id field error. Not sure why the external Id Name is correct and its unique in Salesforce. Please let me know if I am missing something. Below is my code snippet. Thanks 
 
public void upsertCASE()
        {
            try
            {
                // Create a new sObject of type Case
                // and fill out its fields.
                sObject CASE = new SFDC.sObject();
                System.Xml.XmlElement[] CASEFields = new System.Xml.XmlElement[4];

                // Create the Case's fields
                System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
                CASEFields[0] = doc.CreateElement("Status");
                CASEFields[0].InnerText = "Working";
                CASEFields[1] = doc.CreateElement("Description");
                CASEFields[1].InnerText = "Case Created by Partner API";
                CASEFields[2] = doc.CreateElement("Origin");
                CASEFields[2].InnerText = "Web";
                CASEFields[3] = doc.CreateElement("External_ID_POC__c");
                CASEFields[3].InnerText = ExternalId;
                CASE.type = "Case";
                CASE.Any = CASEFields;

                // Add this sObject to an arrayExternalId
                sObject[] CASEList = new sObject[1];
                CASEList[0] = CASE;
                UpsertResult[] results = null;
                LimitInfo[] LimitInfo = null;
                // Make a create call and pass it the array of sObjects 
                client.upsert(header, null, null, null, null, null, null, null, null, null, null, null, null, ExternalId, CASEList, out LimitInfo, out results);      
                // Iterate through the results list
                // and write the ID of the new sObject
                // or the errors if the object creation failed.
                // In this case, we only have one result
                // since we created one contact.
                for (int j = 0; j < results.Length; j++)
                {
                    if (results[j].success)
                    {
                        Console.Write("\nA CASE was created with an ID of: "
                                        + results[j].id);
                    }
                    else
                    {
                        // There were errors during the create call,
                        // go through the errors array and write
                        // them to the console
                        for (int i = 0; i < results[j].errors.Length; i++)
                        {
                            Error err = results[j].errors[i];
                            Console.WriteLine("Errors were found on item " + j.ToString());
                            Console.WriteLine("Error code is: " + err.statusCode.ToString());
                            Console.WriteLine("Error message: " + err.message);
                        }
                    }
                }
            }
            catch (SoapException e)
            {
                Console.WriteLine("An unexpected error has occurred: " + e.Message +
                    " Stack trace: " + e.StackTrace);
            }
        }

 
Hi All,

Its a bit strange. I am trying to integrate salesforce with .Net Application to explore new Soap api 33 with the help of guide but its seems the few methods are changed. Below are some examples of error which I have encountered. 

1) login() : I have used the below code from the guide
LoginResult lr;
            try
            {
                Console.WriteLine("\nLogging in...\n");
                lr = loginClient.login(null, username, password); 
            }
But it seems that now the login is accepting four arguments which are 
- LoginScopeHeader // Additional Argument
- CallOptions
- username
- password

2)  describeGlobal()
DescribeGlobalResult dgr = client.describeGlobal(
                         header, // session header
                         null // package version header
                         );
Now its excepting 
- SessionHeader
- CallOptions
- PackageVersionHeader
- DescribeGlobalResult // Additional Argument

3)  describeSObjects()
DescribeSObjectResult[] dsrArray =
                      client.describeSObjects(
                        header, // session header
                        null, // package version header
                        null, // locale options
                        new string[] { objectType } // object name array
                        );
Now its excepting 
- SessionHeader
- CallOptions
- PackageVersionHeader
- LocalOptions
- SObjectType
- DescribeGlobalResult // Additional Argument

4) query()
QueryResult qr = client.query(
                    header, // session header
                    null, //CallOptions
                    null, // query options
                    null, // mru options
                    null, // package version header
                    soqlQuery // query string
                    );
Now its excepting 
- SessionHeader
- CallOptions
- QueryOptions
- MruHeaders
- PackageVersionHeader
- Query String 
- QueryResult // Additional Argument

5) querymore()
qr = client.queryMore(
                                    header, // session header
                                    null, // query options
                                    qr.queryLocator // query locator
                                    );

Now its excepting 

- session header
- query options
- query locator
- QueryResult // Additional Argument

Please let me know if what  am I missing in the procedure. Thanks much. Much Appreciated !!