• arosys
  • NEWBIE
  • 30 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 31
    Questions
  • 49
    Replies

I have uploaded managed beta package.

Now i want to delete a custom tab and custom field from that package.

Even on deprecating the uploaded version i am  unable to delete them.

As it is beta only , i should able to delete them.

Can anyone suggest what to do?

  • October 23, 2013
  • Like
  • 0

I  am stuck at this can anyone help me out in this.

 

This is my visualforce page

 

public class WebserviceAccountExtensionNew{

   
    
    

   
    public String[] result{get; private set;}
    public Map<String,String> accountMap{get;set;}
    public string AccountName{get;set;}
    public string OutPutString{get;set;}
    public string OrganisationId{get;set;}
    public string UserId{get;set;}
    public string type{get;set;}
    public string DMpwd{get;set;}
    public string DMSecureKey{get;set;}
    public boolean toperrmsg{get;set;}

    
    List<Datamapia__Datamapia_User__c> user; 
    
  
  

  
   public PageReference CallWebservice() { 
     if(AccountName == null || AccountName == '')
      {
       System.debug('.......') ;
       ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Account Name cannot be null');
       ApexPages.addMessage(myMsg);
     /*  if(!accountMap.isEmpty())
       {
       accountMap.clear();
       }*/
      } 
      else
      {   
      
      accountMap = new Map<String, String>();
      OrganisationId = UserInfo.getOrganizationId();
      UserId = UserInfo.getUserId();
      type= 'accounts';
      user=[SELECT Datamapia__DMSecureKey__c,Datamapia__Password__c FROM Datamapia__Datamapia_User__c];
      for(Datamapia__Datamapia_User__c u : user)
      {
      DMpwd = u.Datamapia__Password__c;
      DMSecureKey = u.Datamapia__DMSecureKey__c;
      }
      accountMap.clear();  
      searchnewDatamapiaCom.AccountsWSPort stub = new searchnewDatamapiaCom.AccountsWSPort();
      stub.timeout_x = 120000;
      result= stub.GetSuggestions(AccountName,type,OrganisationId,UserId,DMSecureKey,DMpwd);
      if(result != null ){
           for (Integer i=0; i < result.size(); i++)
           {
           String[] part = result[i].split('\\|');
           if(part.size() == 1)
           {
           OutPutString ='Invalid request !';
           accountMap.clear();   
           }
           else
           { 
           accountMap.put(part[0].substring(0,15), part[1]);
            OutPutString = 'Please reivew the account names below. If you still wish to continue , click Create New!'  ; 
           }
                 
           }
           }
      else {
          OutPutString ='No matches found !';
          accountMap.clear();         
           } 
           }    
      return null;
    }
    
    public PageReference doCancel()
    {
        return null;
    }
 
}

 This is my apex class :

 

public with sharing class WebserviceAccountExtension{

    private final Account acct;
    
    

   
    public String[] result{get; private set;}
    public Map<String,String> accountMap{get;set;}
    public string AccountName{get;set;}
    public string OutPutString{get;set;}
    public string OrganisationId{get;set;}
    public string UserId{get;set;}
    public string type{get;set;}
    public string DMpwd{get;set;}
    public string DMSecureKey{get;set;}
    ApexPages.standardController m_sc = null;
    List<Datamapia__Datamapia_User__c> user; 
    
  
    public WebserviceAccountExtension(ApexPages.StandardController stdController) {
        this.acct = (Account)stdController.getRecord();
        m_sc = stdController;
    }

  
  public PageReference CallWebservice() { 
     if(AccountName == null || AccountName == '')
      {
       System.debug('.......') ;
       ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Account Name cannot be null');
       ApexPages.addMessage(myMsg);
      } 
      else
      {   
      
      accountMap = new Map<String, String>();
      OrganisationId = UserInfo.getOrganizationId();
      UserId = UserInfo.getUserId();
      type= 'accounts';
      user=[SELECT Datamapia__DMSecureKey__c,Datamapia__Password__c FROM Datamapia__Datamapia_User__c];
      for(Datamapia__Datamapia_User__c u : user)
      {
      DMpwd = u.Datamapia__Password__c;
      DMSecureKey = u.Datamapia__DMSecureKey__c;
      }
      accountMap.clear();  
      searchnewDatamapiaCom.AccountsWSPort stub = new searchnewDatamapiaCom.AccountsWSPort();
      stub.timeout_x = 120000;
      result= stub.GetSuggestions(AccountName,type,OrganisationId,UserId,DMSecureKey,DMpwd);
      if(result != null ){
           for (Integer i=0; i < result.size(); i++)
           {
           String[] part = result[i].split('\\|');
           if(part.size() == 1)
           {
           OutPutString ='Invalid request !';
           accountMap.clear();   
           }
           else
           { 
           accountMap.put(part[0].substring(0,15), part[1]);
            OutPutString = 'Please reivew the account names below. If you still wish to continue , click Create New!'  ; 
           }
                 
           }
           }
      else {
          OutPutString ='No matches found !';
          accountMap.clear();         
           } 
           }    
      return null;
    }
    
    public PageReference doCancel()
    {
        return m_sc.cancel();
    }
 
}

 And this my test class :

 

@isTest
public class thecontrollerTests {


public static testMethod void testWebserviceAccountExtension() {
    String txt = 'test';
    PageReference pageRef = Page.DatamapiaAccount;
 
    Test.setCurrentPage(pageRef); 
    Account a = new Account(name='Tester');
    insert a;
    
    
    ApexPages.StandardController sc = new ApexPages.standardController(a);
    
    Test.startTest();
    
    WebserviceAccountExtension e = new WebserviceAccountExtension(sc);
    System.assert( e != null);
    
    e.AccountName= txt;
    System.assertEquals(txt,e.AccountName);
    
    List<Apexpages.Message> msgs = ApexPages.getMessages();
    boolean b = false;
    for(Apexpages.Message msg:msgs){
    System.assertEquals(ApexPages.Severity.ERROR, msg.getSeverity()); 
     }   
   
    String testCancel = e.doCancel().getUrl(); 
    
    Test.stopTest();
   
    
    
}
}

 

On uploading the package it says "Average test coverage across all Apex Classes and Triggers is 69%, at least 75% test coverage is required."

 

Thanks in advance.

  • October 22, 2013
  • Like
  • 0

I want to add a custom object in my managed package.

And i want that content of that custom object will be 

visible to only admins of org installing the package.

how to achieve this?

 

 

Scenario is i want to make webservice call out from sfdc , and want to validate users in my webservice which is called by sfdc

i.e. salesforce org will register for my webservice first , while registration i will store the credentials in a custom object in their sfdc org in encrypted form

and later when sfdc will call the webservice it will pass the credentials in encrypted form , and my webservice will validate them first and then only will give response

please help me out in this.

Thanks

 

  • September 12, 2013
  • Like
  • 0

I created a managed package .

I want to add a custom object into it , but i want that organisations

who will install this package could not see content of object.

Is it possible?

How to achieve this?

  • September 11, 2013
  • Like
  • 0

Hi 

I am having problem in re render when using with command button .

command button is calling web service , but output panel is not geting refreshed.

Please help me in this 

Here's my code . 

this is my visual force page :

 

<apex:page standardController="Account" extensions="WebserviceAccountExtension" >
    <style type="text/css">
     .dataCol { float: left;
    width: 18% !important; }
    </style>

<apex:form >

<apex:pageBlock title="New Account">

<apex:pageBlockButtons >
   <apex:commandButton value="Create New" action="{!URLFOR( $Action.Account.New, null, null,true)}"  />
   <apex:commandButton value="Cancel" action="{!doCancel}" immediate="true"/>
</apex:pageBlockButtons>


<apex:pageBlockSection title="Account Information" collapsible="false">
   <apex:inputField value="{!Account.Name}" />
   <apex:actionStatus id="mySaveStatus1">
         <apex:facet name="stop">
             <apex:commandButton value="Check Accounts" action="{!CallWebservice}" status="mySaveStatus1" reRender="message"/>
         </apex:facet>
         <apex:facet name="start">
             <apex:outputPanel >
                   <apex:image value="/img/loading32.gif" style="height: 15px;"/>
                   <apex:commandButton value="Processing..." status="mySaveStatus1" disabled="true"/>
               </apex:outputPanel>
           </apex:facet>
        </apex:actionStatus>
</apex:pageBlockSection>
 
<br/>



<apex:outputPanel id="message">
<b><apex:outputText value="{!OutPutString}"  /></b><br/>
<apex:repeat value="{!accountMap}" var="key" >
 
  <apex:outputLink value="/{!key}">
  <apex:outputText style="font-style:italic" value="{!accountMap[key]}"/><br/> 
  </apex:outputLink> 

</apex:repeat>
</apex:outputPanel>


</apex:pageBlock>
</apex:form>


</apex:page>

 This is controller  code :

 

 public PageReference CallWebservice() { 
      System.debug(LoggingLevel.DEBUG,'Webservice called');
      accountMap = new Map<String, String>();
      OrganisationId = UserInfo.getOrganizationId();
      UserId = UserInfo.getUserId();
      type= 'accounts';
      accountMap.clear();
      sfdcBaseURL = URL.getSalesforceBaseUrl().toExternalForm();
      
      searchDatamapiaCom.AccountsWSPort stub = new searchDatamapiaCom.AccountsWSPort();
      stub.timeout_x = 120000;
      result = stub.GetSuggestions(acct.name,type,OrganisationId,UserId);
      if(result != null ){
           for (Integer i=0; i < result.size(); i++)
           {
           String[] part = result[i].split('\\|');
           accountMap.put(part[0].substring(0,15), part[1]);
           }
           msize=accountMap.size();
          OutPutString = 'Please reivew the account names below. If you still wish to continue , click Create New!'  ;
          System.debug(LoggingLevel.DEBUG,'Mtaches found Account Map size.....'+ msize);
      }
      else{
          OutPutString ='No matches found !';
          accountMap.clear();
          msize=accountMap.size();
          System.debug(LoggingLevel.DEBUG,'No match found Account Map size.....'+ msize);
          
      }
      
      return ApexPages.currentPage();
    }

 

  • September 09, 2013
  • Like
  • 0

Hi
I wnat to send mass email using template .
In my template i have merge fileds of a custom object .
I am using following code to do it :

Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
         mail.setTargetObjectIds(contactids);
         mail.setTemplateId('00X90000001EePt');
         mail.setWhatId(SelectedId);
         Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });

 

But this gives error setWhatId method does not exist and i saw yes there is no such method.

Any alternative to achieve this ?

 

Thanks

  • August 13, 2013
  • Like
  • 0

Hi
till now i was using force.com builder for development purpose, for that i'll need internet connection all the time.
now , i want to use force.com ide for development purpose so that i can do some work locally.
So i downloaded force.com ide .
I cannot see the applications which i had developed , so i cannot edit vf pages or classes which i had already developed.
Its giving me option to create new apps, but not showing those already built.
Please suggest how to get them in local.

Thanks in advance.

I want to insert value of a javscript variable (SessionStorage html5 componenet) in to a custom object.

 

is it possible ?

Please suggest.

Thanks

I have a a java script requirement

 

I want to pass value to java script function like this :

This is my visual force page code:

 

<apex:dataTable value="{!products}" var="prod" >
<apex:column >
<apex:commandLink onclick="AddId({!prod.Id})" value="Add to Cart">
</apex:commandLink>
</apex:column>
</apex:dataTable>

 

function AddId(ProdId) {
alert(ProdId);
}

 

This is not working .

Please suggest how to pass it.

 

I searched for maintaining session variable , but i found session variables are not there in salesforce.

 

Please suggest any alernative to this in case i want to make a shopping cart.

 

Thanks

I created a static list in my apex class like this :

 

Static List<String> Storeitems = new List<String>();
Static List<Integer> Qty= new List<Integer>();

 

I  am adding values in to it from my vf page like this :

 

<apex:commandLink action="{!addtolist}" value="Add to List">
<apex:param name="ProductId" value="{!prod.Id}"/>
</apex:commandLink>

 

And this is my function in apex class :

 

 

public pagereference addtolist(){

String ProductId = System.currentPageReference().getParameters().get('ProductId');

System.Debug('ProductId >>>>>>>>>>>>>>>>'+ProductId);

Storeitems.add(ProductId );
Qty.add(1);

 

System.Debug('StoreItems >>>>>>>>>>>>>>>>'+Storeitems.get(0));
System.Debug('Qty >>>>>>>>>>>>>>>>>>'+Qty.get(0));


Pagereference pg = new PageReference('/apex/SiteProducts');

pg.setredirect(true);

return pg;

}

 

 

 

But every time i am adding a new Productid in list , it shows the new one at list.get(0).

means its not appending it to existing one rather every time adding it as first element.

 

Is there anything like function "ListFind" in apex.

 

such that  ListFind(a,b) returns true or false depending on if  an element "b" is there in list "a" or not.

Hi

I am new in salescforce.

 

I want to create ecommerce site using force.com site not using any provided in app exchnge.

 

I have a doubt how to manage guest users while shopping.

 

I read about customer portal but it will allow only authenticated users to do shopping.

 

What in case if i want guest user to do shopping as well , how will i manage session for guest users.

 

If any one can help me in this.

 

Thanks.

I hav two object custom objects cart & product.

cart has two fields a master detail field related to product object and quantity.

what i want to do is when i insert a new cart , it will check if product already exist it will increment the value of quantity else

insert the cart.

This is what i am presently doing .

 

     String ProductId = System.currentPageReference().getParameters().get('ProductId');
        
        cart__c cart = new cart__c ();
        
        cart.Product__c = ProductId ;
        
        cart.Quantity__c= 1;
        
        insert cart ;

 

Can anyone please help me in this.

 

I have a custom object "SiteCart__c

It has Master-Detail Relationship field "SiteProduct__c"

which is related to another custom object "SiteProduct__c"

 

"SiteCart__c" has two fields "Quantity__c" and related field "SiteProduct__c"

 

I want to retrieve fields of SiteCart__c such that it will show Quantity and name,description,price etc of related product filed.

 

I am using following query :

 

SELECT Quantity__c,(Select Name,Description__c,Price__c,Image__c From SiteProduct__r) FROM SiteCart__c

 

But this showing error

"Didn't understand relationship 'SiteProduct__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names."

 

Please help me.

 

Hi 

i am new in salesforce.

I had created a vf page products which shows list of products from a custom object "siteproducts"

Also there is a sidebar in the vf page for categories which also comes from custom object "categories"

I want that when ever i click on a particular category only corresponding products should be displayed.

I want to do it using Ajax. I am pasting a portion of my code here :

 

Product List :

 

<apex:outputPanel id="detail">
<apex:dataTable value="{!products}" var="prod" id="theTable" >

<apex:column >

<apex:facet name="header">Name</apex:facet>

<apex:outputText value="{!prod.Name}"/>

</apex:column>

<apex:column >

<apex:facet name="header">Image</apex:facet>

<apex:outputField value="{!prod.Image__c}"/>

</apex:column>

<apex:column >
<apex:outputLink value="/apex/ProductDetail?Id={!prod.Id}">
Details
</apex:outputLink>
</apex:column>

 

<apex:column >
<apex:outputLink value="/apex/ProductDetail?Id={!prod.Id}">
Add to Cart
</apex:outputLink>
</apex:column>

</apex:dataTable>
</apex:outputPanel>

 

 

Side bar of category :

 

<apex:dataList value="{!categories}" var="cat">
<apex:commandLink reRender="detail">{!cat.Name}
<apex:param name="categoryid" value="{!cat.id}"/>
</apex:commandLink>
</apex:dataList>

 

How will i implement this .Please help.

Thanks.

 

 

Hi

 

I have a customised object Merchandise having a rich text field in which i am storing image.

How to show that image on force.com sites.

 

Thanks

Hi

 

I have a customised object Merchandise having a rich text field in which i am storing image.

How to show that image on force.com sites.

 

Thanks

 

Hi

 

I have created a site using force.com site.

Now i want that in product page it show list of products available in product object.

Also i want that each product should have an image .

How to implement this?

 

Thanks

Hi

 

I am newbie in salesforce , i created an ecommerce using the application IDA apps provided in appexchange.

As i am using developer edition it is not allowing me to create a new site.(cannot make more than one site in developer edition).

Is it possible to delete the previous one , so that i can create another one.

 

Thanks.

I have uploaded managed beta package.

Now i want to delete a custom tab and custom field from that package.

Even on deprecating the uploaded version i am  unable to delete them.

As it is beta only , i should able to delete them.

Can anyone suggest what to do?

  • October 23, 2013
  • Like
  • 0

I created a managed package .

I want to add a custom object into it , but i want that organisations

who will install this package could not see content of object.

Is it possible?

How to achieve this?

  • September 11, 2013
  • Like
  • 0

Hi 

I am having problem in re render when using with command button .

command button is calling web service , but output panel is not geting refreshed.

Please help me in this 

Here's my code . 

this is my visual force page :

 

<apex:page standardController="Account" extensions="WebserviceAccountExtension" >
    <style type="text/css">
     .dataCol { float: left;
    width: 18% !important; }
    </style>

<apex:form >

<apex:pageBlock title="New Account">

<apex:pageBlockButtons >
   <apex:commandButton value="Create New" action="{!URLFOR( $Action.Account.New, null, null,true)}"  />
   <apex:commandButton value="Cancel" action="{!doCancel}" immediate="true"/>
</apex:pageBlockButtons>


<apex:pageBlockSection title="Account Information" collapsible="false">
   <apex:inputField value="{!Account.Name}" />
   <apex:actionStatus id="mySaveStatus1">
         <apex:facet name="stop">
             <apex:commandButton value="Check Accounts" action="{!CallWebservice}" status="mySaveStatus1" reRender="message"/>
         </apex:facet>
         <apex:facet name="start">
             <apex:outputPanel >
                   <apex:image value="/img/loading32.gif" style="height: 15px;"/>
                   <apex:commandButton value="Processing..." status="mySaveStatus1" disabled="true"/>
               </apex:outputPanel>
           </apex:facet>
        </apex:actionStatus>
</apex:pageBlockSection>
 
<br/>



<apex:outputPanel id="message">
<b><apex:outputText value="{!OutPutString}"  /></b><br/>
<apex:repeat value="{!accountMap}" var="key" >
 
  <apex:outputLink value="/{!key}">
  <apex:outputText style="font-style:italic" value="{!accountMap[key]}"/><br/> 
  </apex:outputLink> 

</apex:repeat>
</apex:outputPanel>


</apex:pageBlock>
</apex:form>


</apex:page>

 This is controller  code :

 

 public PageReference CallWebservice() { 
      System.debug(LoggingLevel.DEBUG,'Webservice called');
      accountMap = new Map<String, String>();
      OrganisationId = UserInfo.getOrganizationId();
      UserId = UserInfo.getUserId();
      type= 'accounts';
      accountMap.clear();
      sfdcBaseURL = URL.getSalesforceBaseUrl().toExternalForm();
      
      searchDatamapiaCom.AccountsWSPort stub = new searchDatamapiaCom.AccountsWSPort();
      stub.timeout_x = 120000;
      result = stub.GetSuggestions(acct.name,type,OrganisationId,UserId);
      if(result != null ){
           for (Integer i=0; i < result.size(); i++)
           {
           String[] part = result[i].split('\\|');
           accountMap.put(part[0].substring(0,15), part[1]);
           }
           msize=accountMap.size();
          OutPutString = 'Please reivew the account names below. If you still wish to continue , click Create New!'  ;
          System.debug(LoggingLevel.DEBUG,'Mtaches found Account Map size.....'+ msize);
      }
      else{
          OutPutString ='No matches found !';
          accountMap.clear();
          msize=accountMap.size();
          System.debug(LoggingLevel.DEBUG,'No match found Account Map size.....'+ msize);
          
      }
      
      return ApexPages.currentPage();
    }

 

  • September 09, 2013
  • Like
  • 0

Hi
I wnat to send mass email using template .
In my template i have merge fileds of a custom object .
I am using following code to do it :

Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
         mail.setTargetObjectIds(contactids);
         mail.setTemplateId('00X90000001EePt');
         mail.setWhatId(SelectedId);
         Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });

 

But this gives error setWhatId method does not exist and i saw yes there is no such method.

Any alternative to achieve this ?

 

Thanks

  • August 13, 2013
  • Like
  • 0

I want to insert value of a javscript variable (SessionStorage html5 componenet) in to a custom object.

 

is it possible ?

Please suggest.

Thanks

I searched for maintaining session variable , but i found session variables are not there in salesforce.

 

Please suggest any alernative to this in case i want to make a shopping cart.

 

Thanks

I created a static list in my apex class like this :

 

Static List<String> Storeitems = new List<String>();
Static List<Integer> Qty= new List<Integer>();

 

I  am adding values in to it from my vf page like this :

 

<apex:commandLink action="{!addtolist}" value="Add to List">
<apex:param name="ProductId" value="{!prod.Id}"/>
</apex:commandLink>

 

And this is my function in apex class :

 

 

public pagereference addtolist(){

String ProductId = System.currentPageReference().getParameters().get('ProductId');

System.Debug('ProductId >>>>>>>>>>>>>>>>'+ProductId);

Storeitems.add(ProductId );
Qty.add(1);

 

System.Debug('StoreItems >>>>>>>>>>>>>>>>'+Storeitems.get(0));
System.Debug('Qty >>>>>>>>>>>>>>>>>>'+Qty.get(0));


Pagereference pg = new PageReference('/apex/SiteProducts');

pg.setredirect(true);

return pg;

}

 

 

 

But every time i am adding a new Productid in list , it shows the new one at list.get(0).

means its not appending it to existing one rather every time adding it as first element.

 

Is there anything like function "ListFind" in apex.

 

such that  ListFind(a,b) returns true or false depending on if  an element "b" is there in list "a" or not.

I hav two object custom objects cart & product.

cart has two fields a master detail field related to product object and quantity.

what i want to do is when i insert a new cart , it will check if product already exist it will increment the value of quantity else

insert the cart.

This is what i am presently doing .

 

     String ProductId = System.currentPageReference().getParameters().get('ProductId');
        
        cart__c cart = new cart__c ();
        
        cart.Product__c = ProductId ;
        
        cart.Quantity__c= 1;
        
        insert cart ;

 

Can anyone please help me in this.