• Gurditta Garg
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 17
    Replies

Hi,

 

I'm newbie in Salesforce API's intigration, so could anyone please let me know how can i generate and consume java web services in salesforce. Actually i'm able to create wsdl using Eclipse for a java class but i'm not able to use it in salesforce, and i don't know whether its wsdl that the resource has to expose or something else.

 

PS : for example i've a java class which has functions for database interaction with some parameters and now can i create a interface in salesforce with some textboxes which would be actually the parameters for the functions that are written in java class (which would be actually our web service i believe).

 

Thanks in advance

Gurditta Garg

Hi, 

 

please help,

i'm need to add sub deparments (child) under department(parent) object and also have to do crud on both objects.

 

this is controller so far :-

public class DepartmentController {
    public Department__c record{get;set;}
    public List<Department__c> Departments{get;set;}
    public Sub_Department__c recordSub{get;set;}
    public List<Sub_Department__c> subD{get;set;}
    
    public DepartmentController() {
        Departments = [SELECT Id, Name, Description__c FROM Department__c];
    }
    public Department__c getDepartment() {
        Id id = System.currentPageReference().getParameters().get('id');
        subD = [SELECT Id, Name,Description__c FROM Sub_Department__c 
                WHERE Department__c = :id];
        If(id == null){
            record = new Department__c();
        }else{
            record  = [SELECT Id, Name,Description__c FROM Department__c WHERE Id = :id];
        }
        return record;
    }
    public void addSubDeptRow(){
        Id id = System.currentPageReference().getParameters().get('id');
        insert new Sub_Department__c(Name = 'Sub',Department__c = id);
        //recordSub = new Sub_Department__c();
        //system.debug('####before subD : '+subD.size());
        //subD.add(recordSub);
       // system.debug('####after subD : '+subD.size());
    }
    public PageReference save(){
        upsert(record);
        PageReference redirect = new PageReference('/apex/listViewDepartment');
        redirect.setRedirect(true); 
        return redirect;
    }
    public void add(){
        upsert(record);
    }
    public PageReference deleteRow(){
        Id id = System.currentPageReference().getParameters().get('id');
        delete [Select Id From Department__c WHERE Id = :id];
        PageReference redirect = new PageReference('/apex/listViewDepartment');
        redirect.setRedirect(true); 
        return redirect;
    }
    public PageReference deleteSubRow(){
        Id id = System.currentPageReference().getParameters().get('id');
        delete [Select Id From Sub_Department__c WHERE Id = :id];
        PageReference redirect = new PageReference('/apex/listViewDepartment');
        redirect.setRedirect(true); 
        return redirect;
    }
}

 this is visualforce :

 

<apex:page controller="DepartmentController" showHeader="false">
        <apex:stylesheet value="{!$Resource.detailForms}"/>
        <apex:includescript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/ColReorder.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/ColVis.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/TableTools.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/ColumnFilterWidgets.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/styles-min.css')}"/>
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/jquery.dataTables.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/ColVis.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/ZeroClipboard.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/TableTools.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/ColumnFilterWidgets.js')}" />
        <style>
            .selected { background-color:blue; }
        </style>
        
        <script type="text/javascript" charset="UTF-8">
            window.onload = hideall;
            function hideall(){
                $('.onrowSelect:first').trigger('click');
                $('.add:first').hide();
                $('.edit:first').hide();    
            }        
            $(document).ready( function () {
              var oTable = $('#contacttable').dataTable( {
                  "sDom": 'WRC<"clear">lftip',
                  "bJQueryUI": true,
                  "sPaginationType": "full_numbers",
                  "aoColumnDefs": [ { "bVisible": false, "aTargets": [ ] }],
                  "oColumnFilterWidgets": { "aiExclude": [ 0, 3, 4 ] }
             });
             $('.onrowSelect').click(function() {
                    var selRow = $(this).attr('value');
                    $(this).parent().parent().find("tr").removeClass("selected");
                    $(this).parent().addClass("selected");
                    //alert(selRow1);
                    $('.'+selRow).trigger('click');
                    displayedit();
            });
          });
        function confirmDelete() {
            return confirm('Are you sure you want to delete?');
        }
        function displayadd() {
            $('.add:first').show();
            $('.edit:first').hide();
        }
        function displayedit() {
            $('.add:first').hide();
            $('.edit:first').show();
        }         
        </script>
<div id="customdiv">
<apex:pageBlock id="page">
 <apex:form >
  <apex:commandbutton onclick="displayadd();" reRender="add" value="Add Department" />
 </apex:form>

<table cellpadding="0" cellspacing="0" border="0" class="display" id="contacttable" style="margin-top:20px;"> 
<thead><tr><th>Department</th><th>Description</th><th>Action</th></tr></thead>
<tbody>
    <apex:repeat value="{!Departments}" var="c">
        <tr value="{!c.Id}" >
            <td value="{!c.Id}" class="onrowSelect" colspan="1">{!c.Name}</td>
            <td value="{!c.Id}" class="onrowSelect">{!c.Description__c}</td>
    <apex:form >
        <td>
            <apex:commandbutton reRender="edit" value="edit" styleClass="{!c.Id}" status="status" style="display:none;">
            <apex:param name="id" value="{!c.Id}" /></apex:commandbutton>
            <apex:commandbutton reRender="page" value="delete" onClick="if (!confirmDelete()) return false;" action="{!deleteRow}">
            <apex:param name="id" value="{!c.Id}" /></apex:commandbutton>
        </td>
    </apex:form>
</tr></apex:repeat></tbody>
</table></apex:pageBlock></div>

<apex:outputPanel id="edit" styleClass="edit">
<apex:form id="theForm73">
 <div class="formBg">
        <apex:actionStatus startText="processing..." id="status"/><br/>
            <apex:inputHidden value="{!Department.id}" />
            <div class="formDetails">        
                <span class="detailsTitle">Department Name : </span><apex:inputText value="{!Department.name}" />
            </div>
            <div class="formDetails">
                <span class="detailsTitle">Description : </span><apex:inputText value="{!Department.Description__c}" />
            </div>
            <div class="addButton">
                <apex:commandButton value="update" action="{!save}" rerender="page" styleClass="button" />
            </div>

  <table cellpadding="0" cellspacing="0" border="0" class="display" id="contacttable" style="margin-top:20px;"> 
    <thead><tr><th>SubDepartment</th><th>Description</th><th>Action</th></tr></thead>
    <tbody>
      <apex:repeat value="{!subD}" var="c">
        <tr>
            <td class="formDetails"><apex:inputField value="{!c.Name}"/></td>
            <td class="formDetails"><apex:inputField value="{!c.Description__c}"/></td>
            <td>
                <apex:commandbutton reRender="edit" value="delete" onClick="if (!confirmDelete()) return false;" action="{!deleteSubRow}">
                <apex:param name="id" value="{!c.Id}" /></apex:commandbutton>
            </td>
        </tr>
      </apex:repeat>     
    </tbody>
                <apex:commandbutton reRender="edit" value="addSubDeptRow" action="{!addSubDeptRow}">
                <apex:param name="id" value="{!Department.Id}" /></apex:commandbutton>
  </table>
 </div>
</apex:form>     
</apex:outputPanel>

<apex:outputPanel id="add" styleClass="add">
    <apex:form >
        <div class="formBg">
            <div class="formDetails">
                <span class="detailsTitle">SubDepartment Name : </span><apex:inputText value="{!record.name}" required="true"/>
            </div>
            <div class="formDetails">
                <span class="detailsTitle">Description : </span><apex:inputText value="{!record.Description__c}" />
            </div>
            <div class="addButton">
                <apex:commandButton value="Add" action="{!save}" styleClass="button"> </apex:commandButton>
            </div>
        </div>
    </apex:form>
</apex:outputPanel>

</apex:page>

Hi,

 

I've a list of Object's record (Department) and i'm able to apply crud on this object, could anyone please tell me how to apply crud on all the child records(SubDepartment) of its object(Department).

 

thanks in advance.

 

Hi,

 

I've a listing of a Object's records in a jQuery's dataTable and when i'll select a row i want to display the information of that row in a editable form under the listing of the records without refreshing the page.

 

Thanks

Hi,

 

I've created so much mess in my account and now i want to delete the account and also want to create with the same email id.

 

thanks.

Hi,

 

i was trying to create a Master-Detail relationship, it gave me error that the records for the related objects need to be deleted when i deleted and tried again it gave me below error : 

 

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 467228631-21711 (623707184)

Hi,

 

 <apex:pageBlock title="Scorecard">
   <apex:pageBlockButtons location="bottom">
     <apex:commandButton action="{!save}" value="Save" style="width:100px" />
   </apex:pageBlockButtons>

 <apex:pageBlockSection columns="2">
    <apex:inputField value="{!scoreform.Name}" required="true"/>
    <apex:inputField value="{!scoreform.Department__c}" required="true"/>
    <apex:inputField value="{!scoreform.Frequency__c}" required="true"/>
    <apex:inputField value="{!scoreform.Sub_Department__c}" required="true"/>   
    <apex:inputField value="{!scoreform.Weighted_Score_1_Owner__c}" />
    <apex:inputField value="{!scoreform.Weighted_Score_2_Owner__c}" />
    <c:MultiselectPicklist leftLabel="Available Metrics" 
        leftOption="{!allMetrics}" 
        rightLabel="Selected Metrics" 
        rightOption="{!selectedMetrics}" 
        size="14" 
        width="150px"/>
        
</apex:pageBlockSection>

I'm using the above <c> tag component for multiselectPicklist.

in left list i've list of available records (a1,a2,a3,a4....) of an object (say A) which i want to add to the another object's (say B) record (b1).

Hi,

 

I've a list of records(rows) for a custom object(table) where i want to apply crud operations i.e. create new object instance (record), update the existing ones (editng the records not inline instead in a new page). i want to use only one controller for all the operations.

 

please let me know the possible solutions.

 

thanks in advance.

I've a developer edition and which mean I'm the system administrator, I develop some pages and classes and after I logout I don't know exactly what happened to my account, for every link it displays me the following error :

 

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

url on the this page : https://ap1.salesforce.com/secur/NoAccess.jsp

 

I tried it with my other developer edition account same problem again. I've all the credentials for my account i.e.. username, password, security token. Don't know if it is a bug or my problem.??

Hi,

 

Can someone assist me in suggesting how can i transfer file attachments from sales force to a third party java application.

 

We are trying to integrate salesforce to our custom app where salesforce can pass some string values AND few file attachments to our custom java app. On doing some research, we saw something like outbound messaging. Can someone assist if that supports file attachments as well?

 

Any suggestions how can that be accomplished while integrating with salesforce?

 

Thanks,

Pranay.

Hi,

 

I'm newbie in Salesforce API's intigration, so could anyone please let me know how can i generate and consume java web services in salesforce. Actually i'm able to create wsdl using Eclipse for a java class but i'm not able to use it in salesforce, and i don't know whether its wsdl that the resource has to expose or something else.

 

PS : for example i've a java class which has functions for database interaction with some parameters and now can i create a interface in salesforce with some textboxes which would be actually the parameters for the functions that are written in java class (which would be actually our web service i believe).

 

Thanks in advance

Gurditta Garg

Hi, 

 

please help,

i'm need to add sub deparments (child) under department(parent) object and also have to do crud on both objects.

 

this is controller so far :-

public class DepartmentController {
    public Department__c record{get;set;}
    public List<Department__c> Departments{get;set;}
    public Sub_Department__c recordSub{get;set;}
    public List<Sub_Department__c> subD{get;set;}
    
    public DepartmentController() {
        Departments = [SELECT Id, Name, Description__c FROM Department__c];
    }
    public Department__c getDepartment() {
        Id id = System.currentPageReference().getParameters().get('id');
        subD = [SELECT Id, Name,Description__c FROM Sub_Department__c 
                WHERE Department__c = :id];
        If(id == null){
            record = new Department__c();
        }else{
            record  = [SELECT Id, Name,Description__c FROM Department__c WHERE Id = :id];
        }
        return record;
    }
    public void addSubDeptRow(){
        Id id = System.currentPageReference().getParameters().get('id');
        insert new Sub_Department__c(Name = 'Sub',Department__c = id);
        //recordSub = new Sub_Department__c();
        //system.debug('####before subD : '+subD.size());
        //subD.add(recordSub);
       // system.debug('####after subD : '+subD.size());
    }
    public PageReference save(){
        upsert(record);
        PageReference redirect = new PageReference('/apex/listViewDepartment');
        redirect.setRedirect(true); 
        return redirect;
    }
    public void add(){
        upsert(record);
    }
    public PageReference deleteRow(){
        Id id = System.currentPageReference().getParameters().get('id');
        delete [Select Id From Department__c WHERE Id = :id];
        PageReference redirect = new PageReference('/apex/listViewDepartment');
        redirect.setRedirect(true); 
        return redirect;
    }
    public PageReference deleteSubRow(){
        Id id = System.currentPageReference().getParameters().get('id');
        delete [Select Id From Sub_Department__c WHERE Id = :id];
        PageReference redirect = new PageReference('/apex/listViewDepartment');
        redirect.setRedirect(true); 
        return redirect;
    }
}

 this is visualforce :

 

<apex:page controller="DepartmentController" showHeader="false">
        <apex:stylesheet value="{!$Resource.detailForms}"/>
        <apex:includescript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/ColReorder.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/ColVis.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/TableTools.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/ColumnFilterWidgets.css')}"/>
        <apex:stylesheet value="{!URLFOR($Resource.DataTables, 'DataTables/css/styles-min.css')}"/>
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/jquery.dataTables.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/ColVis.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/ZeroClipboard.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/TableTools.js')}" />
        <apex:includeScript value="{!URLFOR($Resource.DataTables, 'DataTables/js/ColumnFilterWidgets.js')}" />
        <style>
            .selected { background-color:blue; }
        </style>
        
        <script type="text/javascript" charset="UTF-8">
            window.onload = hideall;
            function hideall(){
                $('.onrowSelect:first').trigger('click');
                $('.add:first').hide();
                $('.edit:first').hide();    
            }        
            $(document).ready( function () {
              var oTable = $('#contacttable').dataTable( {
                  "sDom": 'WRC<"clear">lftip',
                  "bJQueryUI": true,
                  "sPaginationType": "full_numbers",
                  "aoColumnDefs": [ { "bVisible": false, "aTargets": [ ] }],
                  "oColumnFilterWidgets": { "aiExclude": [ 0, 3, 4 ] }
             });
             $('.onrowSelect').click(function() {
                    var selRow = $(this).attr('value');
                    $(this).parent().parent().find("tr").removeClass("selected");
                    $(this).parent().addClass("selected");
                    //alert(selRow1);
                    $('.'+selRow).trigger('click');
                    displayedit();
            });
          });
        function confirmDelete() {
            return confirm('Are you sure you want to delete?');
        }
        function displayadd() {
            $('.add:first').show();
            $('.edit:first').hide();
        }
        function displayedit() {
            $('.add:first').hide();
            $('.edit:first').show();
        }         
        </script>
<div id="customdiv">
<apex:pageBlock id="page">
 <apex:form >
  <apex:commandbutton onclick="displayadd();" reRender="add" value="Add Department" />
 </apex:form>

<table cellpadding="0" cellspacing="0" border="0" class="display" id="contacttable" style="margin-top:20px;"> 
<thead><tr><th>Department</th><th>Description</th><th>Action</th></tr></thead>
<tbody>
    <apex:repeat value="{!Departments}" var="c">
        <tr value="{!c.Id}" >
            <td value="{!c.Id}" class="onrowSelect" colspan="1">{!c.Name}</td>
            <td value="{!c.Id}" class="onrowSelect">{!c.Description__c}</td>
    <apex:form >
        <td>
            <apex:commandbutton reRender="edit" value="edit" styleClass="{!c.Id}" status="status" style="display:none;">
            <apex:param name="id" value="{!c.Id}" /></apex:commandbutton>
            <apex:commandbutton reRender="page" value="delete" onClick="if (!confirmDelete()) return false;" action="{!deleteRow}">
            <apex:param name="id" value="{!c.Id}" /></apex:commandbutton>
        </td>
    </apex:form>
</tr></apex:repeat></tbody>
</table></apex:pageBlock></div>

<apex:outputPanel id="edit" styleClass="edit">
<apex:form id="theForm73">
 <div class="formBg">
        <apex:actionStatus startText="processing..." id="status"/><br/>
            <apex:inputHidden value="{!Department.id}" />
            <div class="formDetails">        
                <span class="detailsTitle">Department Name : </span><apex:inputText value="{!Department.name}" />
            </div>
            <div class="formDetails">
                <span class="detailsTitle">Description : </span><apex:inputText value="{!Department.Description__c}" />
            </div>
            <div class="addButton">
                <apex:commandButton value="update" action="{!save}" rerender="page" styleClass="button" />
            </div>

  <table cellpadding="0" cellspacing="0" border="0" class="display" id="contacttable" style="margin-top:20px;"> 
    <thead><tr><th>SubDepartment</th><th>Description</th><th>Action</th></tr></thead>
    <tbody>
      <apex:repeat value="{!subD}" var="c">
        <tr>
            <td class="formDetails"><apex:inputField value="{!c.Name}"/></td>
            <td class="formDetails"><apex:inputField value="{!c.Description__c}"/></td>
            <td>
                <apex:commandbutton reRender="edit" value="delete" onClick="if (!confirmDelete()) return false;" action="{!deleteSubRow}">
                <apex:param name="id" value="{!c.Id}" /></apex:commandbutton>
            </td>
        </tr>
      </apex:repeat>     
    </tbody>
                <apex:commandbutton reRender="edit" value="addSubDeptRow" action="{!addSubDeptRow}">
                <apex:param name="id" value="{!Department.Id}" /></apex:commandbutton>
  </table>
 </div>
</apex:form>     
</apex:outputPanel>

<apex:outputPanel id="add" styleClass="add">
    <apex:form >
        <div class="formBg">
            <div class="formDetails">
                <span class="detailsTitle">SubDepartment Name : </span><apex:inputText value="{!record.name}" required="true"/>
            </div>
            <div class="formDetails">
                <span class="detailsTitle">Description : </span><apex:inputText value="{!record.Description__c}" />
            </div>
            <div class="addButton">
                <apex:commandButton value="Add" action="{!save}" styleClass="button"> </apex:commandButton>
            </div>
        </div>
    </apex:form>
</apex:outputPanel>

</apex:page>

what is the difference between customization and configuration in salesforce,

 

thanks in advance

 

Hi,

 

I've a listing of a Object's records in a jQuery's dataTable and when i'll select a row i want to display the information of that row in a editable form under the listing of the records without refreshing the page.

 

Thanks

Hi,

 

I've a list of records(rows) for a custom object(table) where i want to apply crud operations i.e. create new object instance (record), update the existing ones (editng the records not inline instead in a new page). i want to use only one controller for all the operations.

 

please let me know the possible solutions.

 

thanks in advance.

I've a developer edition and which mean I'm the system administrator, I develop some pages and classes and after I logout I don't know exactly what happened to my account, for every link it displays me the following error :

 

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

url on the this page : https://ap1.salesforce.com/secur/NoAccess.jsp

 

I tried it with my other developer edition account same problem again. I've all the credentials for my account i.e.. username, password, security token. Don't know if it is a bug or my problem.??