• cnp_naresh
  • NEWBIE
  • 30 Points
  • Member since 2011

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

HI Friends,

 

    

<apex:repeat value="{!displayFields}" var="f">
                    <apex:inputfield value="{!acct[f]}" rendered="cond"/>
<apex:selectlist value="{!acct[f]}" rendered="cond" onchange="showstates('this.value')">
<apex:selectOptions value="{!showcountries}">

</apex:selectlist>
<apex:outputpanel id="staterefresh">
<apex:selectlist value="{!acct[f]}" rendered="cond">
<apex:selectOptions value="{!showStates}">
</apex:selectlist>
<apex:outputpanel>
                </apex:repeat>

 According to the country selected, I need to refresh the State values... But this is not at all happening in visualforce page. I am able to refresh the values according to the country selected but when I submit the form to save the record, I am getting error 'Mailing State/Province: Validation Error: Value is not valid'. 

 

Please help me.

 

Thanks,

Naresh B

HI Everybody,

 

    I have a new requirement in my project. My requirement is I want to customize related list.For a custom object we will have a page layout.In that page layout I can add related lists.If I drag and drop this related list in layout I can see this in detail page of record of that custom object. 

Now how can I get the fields of that related list in apex code. If I get these fields in apex code, I can display them in visualforce in a very customized way.

 

If you need any more information please let me know.

 

   Kindly help me.

 

Thanks,

Naresh B

HI All,

 

    I have HelpText attributes in <apex:pageblocksectionitem> in visualforce pages. When I keep mouse on ? symbol, it displaying helptext well till yesterday. Today I am unable to see help text when I keep mouse on? symbol. This is happening in all visualforce pages and all fields.

 

   What is the problem here. And how to resolve this.

 

Thanks,

Naresh B

HI Every body,

 

    I have a popup registration form(VF page), in sites. Users will register from that popup registration form. This working fine in all browsers but not in IE9 compatibility mode. IN IE 9, the popup is coming, but after entering the data, when we click save button, record is not saving in the database.

 

    Have anybody come across the same issue? Please let me know how you resolved.

 

 

   If you need any more information, please let me know.

 

Thanks,

Naresh B 

HI Every body,

 

     I created a public site by using "Sites" in salesforce and displaying some visualforce pages through public site. When I run the security scanner on this salesforce instance, it showing one problem in "SiteRegisterController" class regarding a hardcode Id. I am not at all using this class and this class is not a part of my application.

 

      Do any one come across the same problem?Please let me know how to resolve it.

 

Thanks,

Naresh B

HI Everybody,

 

     I made a managed package and uploaded to appexhange. Now I made some modifications to the application and upgraded the managed package after including all the modified tasks. Now when I installed the package, I am unable to see some of those changes.

 

      Can any one guess the problem here. Please let me know if you need any other information.

 

Thanks,

Naresh B

HI every body... I created a site in my salesforce developer instance.I want to edit contact record from this site. I checked in public access settings page, it has only read,create permissions for contact standard object from external site.

 

    But I need to edit contact record from external site. Is there any way to achieve this feature.

 

    If you need any other information please let me know.

 

Thanks,

Naresh b

HI every body... I created a site in my salesforce developer instance.I want to edit contact record from this site. I checked in public access settings page, it has only read,create permissions for contact standard object from external site.

 

    But I need to edit contact record from external site. Is there any way to achieve this feature.

 

    If you need any other information please let me know.

 

Thanks,

Naresh b

HI Every one,

 

    I have a custom object "Events", I wrote a visualforce page by using apex:inputfield and displaying all the fields of custom object events and displaying them. 

 

   Now I created a force.com site and used above visualforce page as a default home page. I given all the permissions in

Custom Object Permissions, for Events object and I given all field level permissions tooin GUEST PROFILE.But I am unable to see the  events fields in force.com sites page. Kindly help me if you have any information.

 

Thanks,

Naresh B

HI All,

 

    I uploaded a PDF doc in the Documents standard object. I unchecked Internal Use Only option and checked Externally Available Image . How to display this PDF doc in the external sites. 

 

Thanks,

Naresh B

HI All, I tried a lot.But didn't get the solution.

 

           I have a custom objects Registration_level__c and Attendee_Session__c. The  Attendee_Session__c custom object has lookup field of Registration_level__c.

 

           How can I display the related list of Attendee_Session__c which is in Registration_level__c detail page in a visualforce page.

 

 

Kindly help me. If you need any more information please let me know.

 

Thanks,

Naresh

HI all,

 

        In visualforce we can write like this.

<apex:inputField value="{!CreateAnEvent.Event_title__c}" style="width:250px" id="Eventinfo_title"/>.

 

Is it possible to concatenate another variable which is defined in apex class to the value attribute in <apex:inputField>. Its a very urgent requirement.Please help me. 

 

My requirement is, I will select few field names randomly  of an Object in apex class.I need to display these fields dynamically in visualforce page. How can I achieve this.

 

If you need any other information please let me know.

 

Thanks,

Naresh B                   

 

HI all,

 

     Salesforce has its own template concept as "My Templates". Can I use these templates in building sites in salesforce.

I am building a website in salesforce by using "sites" feature through visualforce pages.

 

 

How can I use salesforce templates for this site. Can someone please provide me some information regarding this.

 

Thanks,

Naresh B

HI everybody,

 

     Can anybody please help me with below query.

 

     I have a custom object and rich textarea field in that. I uploaded a image in that rich textarea field and saved the record.

Now I want to retrieve this image in apex. I used

 

  CustomObject__c img=[select Id,Name,richtextareaimage__c from CustomObject__c];

  string imagvar=img.richtextareaimage__c;

 

   Here I am getting string only not the image.I tried with blob datatype also.its aslo not working.How can I get the image in apex.and print that variable in visualforce.

 

    If you need any other information please let me know.

 

Thanks,

Naresh B

HI Everybody,


     I have a managed packaged in that User will upload a logo in a form, I will save that logo in documents.How can I        display this logo image on a site dynamically.


    I will add a default visualforce page for a site, but how can I replace the standard salesforce logo with my logo image

Please help.


Thanks,

Naresh B

HI Every body, I have a apex class, visualforce page. I am creating records and updating records of a custom object with this class and page only.Inserting is working well.But updating was working fine before but now its not working.

 

Apex class:

public with sharing class DiscountPlan{

    public DiscountPlan() {

    }
    public string DiscountRecordId {get;set;}

    public DiscountPlan(ApexPages.StandardController controller) 
                        {
                        DiscountRecordId=ApexPages.currentPage().getParameters().get('Id');
                        if(DiscountRecordId == null) 
                                {
                                    CreateDiscountPlan= new Discount_plan__c();
    
                                }
                        if(DiscountRecordId != null)
                                {
                                    CreateDiscountPlan=[select Id,Name,End_of_plan__c,Coupon_code__c,discount__c,expire_date__c,Event_name__c,fixed_discount__c,inventory__c,Max_number__c,Min_number__c,Registration_level__c,Start_date__c,Registration_level__r.Price__c from Discount_plan__c where id=:DiscountRecordId];
                                }
    
                        }

    Discount_plan__c CreateDiscountPlan;
    public Discount_plan__c GetCreateDiscountPlan(){return CreateDiscountPlan;}
    public void setCreateDiscountPlan(Discount_plan__c CreateDiscountPlan) {this.CreateDiscountPlan=CreateDiscountPlan;}
    public boolean Inventory{get;set;}
    public boolean AddGroupDiscount {get;set;}
    public boolean AddCouponDiscount{get;set;}
    public string EndOfInventory{get;set;}
    public string SelectPlan{get;set;}
    public Decimal EventPrice1{get;set;}
    Decimal EventPrice;
    public string TotalDiscount{get;set;}
    list<string> ObjectFields=new list<string>();
    public integer RelatedDiscountPlansSize{get;set;}
   

    public decimal getEventPrice()
                    {
                    Registration_level__c LevelRec=[Select Id,Price__c from Registration_level__c where Id=:ApexPages.currentPage().getParameters().get('RL_id') or Id=:CreateDiscountPlan.Registration_level__c];
                    EventPrice=LevelRec.Price__c;
                    EventPrice=EventPrice.setscale(2);
                    
                    return EventPrice;
                    }
    public void setEventPrice(decimal EventPrice){this.EventPrice=EventPrice;}
    public string getEventName(){return ApexPages.currentPage().getParameters().get('Event_name');}

    public string getRegistrationLevelName(){return ApexPages.currentPage().getParameters().get('Rl_name');}
           
    
    
    public PageReference save(){
                        if(DiscountRecordId == null){
                        CreateDiscountPlan.Registration_level__c=ApexPages.currentPage().getParameters().get('RL_id');
                        CreateDiscountPlan.Event_name__c=ApexPages.currentPage().getParameters().get('Event_Id');
                        system.debug('Session id'+ApexPages.currentPage().getParameters().get('Session_id'));
                        insert CreateDiscountPlan;
                        }
                        if(DiscountRecordId != null){
                        system.debug('check inventory'+CreateDiscountPlan.inventory__c);
                        update CreateDiscountPlan;
                        }
                        PageReference RedirectUrl;
                        If(CreateDiscountPlan.Registration_level__c!=null){
                        RedirectUrl= new PageReference('/'+CreateDiscountPlan.Registration_level__c);
                        }
                        RedirectUrl.setRedirect(true);

                        return RedirectUrl;
                 }
    public PageReference cancel(){
                        CreateDiscountPlan.Registration_level__c=ApexPages.currentPage().getParameters().get('RL_id');
                        PageReference RedirectUrl;
                        If(CreateDiscountPlan.Registration_level__c!=null){
                        RedirectUrl= new PageReference('/'+CreateDiscountPlan.Registration_level__c);
                        }
                        RedirectUrl.setRedirect(true);
                        return RedirectUrl;

}
/*public void SaveAndNew(){
CreateDiscountPlan.Registration_level__c=ApexPages.currentPage().getParameters().get('RL_id');
CreateDiscountPlan.Event_name__c=ApexPages.currentPage().getParameters().get('Event_Id');
//CreateDiscountPlan.Session__c=ApexPages.currentPage().getParameters().get('Session_id');
system.debug('Session id'+ApexPages.currentPage().getParameters().get('Session_id'));
insert CreateDiscountPlan;
CreateDiscountPlan=null;
}*/

    public PageReference UploadCouponfile(){
                            PageReference returnURL;
                            returnURL = new PageReference('/apex/UploadCSVDiscounts');
                            returnURL.setRedirect(true);
                            return returnURL;
                        }

    public List<SelectOption> getRelatedDiscountPlans() {
                                 List<SelectOption> options = new List<SelectOption>();
                                string LevelId=ApexPages.currentPage().getParameters().get('RL_id');

                                String queryString = 'SELECT Id,Name FROM Discount_plan__c where Registration_level__c=:LevelId';
                                options.add(new SelectOption('--Select--','--Select--'));
                                for(sObject o : Database.query(queryString)){
                                            options.add(new SelectOption((String)o.get('Id'),(String)o.get('Name')));
                                            //Event_Id_Name_Map.put((String)o.get('Name'),(Id)o.get('Id'));
                                            }
                                RelatedDiscountPlansSize=options.size();
                            return options;
                    }
}

 Visualforce page:

<apex:page standardController="Discount_plan__c" extensions="DiscountPlan">
<script>
window.onload=DisableFunction;
function DisableFunction(){
var Pricefield= document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_Price}');
Pricefield.disabled=true;
TotalDiscount();

}
function TotalDiscount(){
//alert('naresh');
var desc= document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_Cdiscount}').value;
var Price= document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_Price}').value;
var FixedDisc= document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_Fixeddiscount}').value;
var totalDisc=document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_TotalDisc}');
var IntFixedDesc=parseFloat(FixedDisc)
totalDisc.value=(desc*Price+IntFixedDesc);

//alert(totalDisc.value);

}
</script>
<apex:form id="CreateDiscountPlan">
        <apex:pageBlock id="CouponRecord" title="Discount plan">
                <apex:pageBlockButtons >
                        <apex:commandButton action="{!save}" value="Save" immediate="true"/>
                        
                        <!--<apex:commandButton action="{!SaveAndNew}" value="Save and new"/>-->
                        <apex:commandButton action="{!cancel}" value="Cancel"/>
                        <apex:commandButton action="{!UploadCouponfile}" value="Upload a discount file"/>
                </apex:pageBlockButtons>
                <apex:pageBlockSection id="CouponInfo" title="Plan details" columns="1" collapsible="false">
                        <apex:pageBlockSectionItem rendered="{!IF(EventName!=null,true,false)}">
                                <apex:outputLabel value="Event name"/>
                                <apex:outputText value="{!EventName}"/>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem rendered="{!if((RegistrationLevelName!=null && EventName!=null),true,false)}">
                                <apex:outputLabel value="Registration level name"/>
                                <apex:outputText value="{!RegistrationLevelName}"/>
                        </apex:pageBlockSectionItem>                                               
                        <apex:pageBlockSectionItem rendered="{!IF(CreateDiscountPlan.Event_name__c!=null,true,false)}">
                                <apex:outputLabel value="Event name"/>
                                <apex:outputPanel >
                                        <apex:inputField value="{!CreateDiscountPlan.Event_name__c}" style="width:250px" id="FieldInfo_Event"/>
                                        <script>document.getElementById('{!$Component.FieldInfo_Event}').disabled = true; </script>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem rendered="{!IF(CreateDiscountPlan.Registration_level__c!=null,true,false)}">
                                <apex:outputLabel value="Registration level name"/>
                                        <apex:outputPanel >
                                                <apex:inputField value="{!CreateDiscountPlan.Registration_level__c}" style="width:250px" id="FieldInfo_level"/>
                                                <script>document.getElementById('{!$Component.FieldInfo_level}').disabled = true; </script>
                                        </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:inputField value="{!CreateDiscountPlan.Name}" id="Eventinfo_PlanName"/>
                        <apex:pageBlockSectionItem Id="AmountItem">
                                <apex:outputPanel >
                                        <b><apex:outputLabel value="Total Discount"/></b>
                                </apex:outputPanel>
                                <apex:outputPanel onkeyup="TotalDiscount();">
                                        &nbsp;&nbsp;&nbsp;Discount %&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Price&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fixed discount&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total discount<br />
                                        &nbsp;(&nbsp;<apex:inputField value="{!CreateDiscountPlan.discount__c}" style="width:60px;" id="Eventinfo_Cdiscount"/>&nbsp;&nbsp;X&nbsp;&nbsp;
                                        <apex:inputText value="{!EventPrice}" style="width:90px;" id="Eventinfo_Price" />
                                        &nbsp;)+&nbsp;
                                        <apex:inputField value="{!CreateDiscountPlan.fixed_discount__c}" style="width:80px;" id="Eventinfo_Fixeddiscount"/>&nbsp;=&nbsp;
                                        <apex:inputText value="{!TotalDiscount}" style="width:60px;" disabled="true" id="Eventinfo_TotalDisc"/>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                                <apex:outputLabel value="Start date" />
                                        <apex:outputPanel >
                                        <apex:inputField value="{!CreateDiscountPlan.Start_date__c}" id="Eventinfo_Startdate"/>
                                        <apex:outputPanel rendered="{!IF(RelatedDiscountPlans.size>1,true,false)}">
                                        <b>OR</b> End of plan &nbsp;&nbsp;&nbsp;
                                        <apex:selectList id="AccountId" value="{!CreateDiscountPlan.End_of_plan__c}" size="1">                 
                                                <apex:selectOptions value="{!RelatedDiscountPlans}"/>
                                        </apex:selectList>
                                </apex:outputPanel>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:inputField value="{!CreateDiscountPlan.expire_date__c}" id="Eventinfo_Enddate"/>
                        <apex:pageBlockSectionItem > 
                                <apex:outputPanel style="position:relative;left:90px;">
                                <apex:inputCheckbox value="{!Inventory}">
                                <apex:actionSupport event="onchange" reRender="DisplayInventory"/>
                                </apex:inputCheckbox>
                                <apex:outputLabel value="Add inventory"></apex:outputLabel><br />
                                <apex:outputPanel id="DisplayInventory"  style="position:relative;left:50px;">
                                <apex:outputPanel rendered="{!Inventory==true}">
                                <b><apex:outputLabel value="Inventory"></apex:outputLabel></b>
                                <apex:inputField value="{!CreateDiscountPlan.inventory__c}" style="position:relative;left:15px;" id="Eventinfo_CInventory"/><br /><br />
                                </apex:outputPanel>
                                </apex:outputPanel>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                                <apex:outputPanel style="position:relative;left:90px;">
                                <apex:inputCheckbox value="{!AddGroupDiscount}">
                                <apex:actionSupport event="onchange" reRender="DisplayGroupDiscount"/>
                                </apex:inputCheckbox>
                                <apex:outputLabel value="Add group discount"></apex:outputLabel><br />
                                <apex:outputPanel id="DisplayGroupDiscount"   style="position:relative;left:50px;">
                                <apex:outputPanel rendered="{!AddGroupDiscount==true}">
                                <b><apex:outputLabel value="Based on # registered" /></b>&nbsp;&nbsp;&nbsp;&nbsp;
                                <apex:outputLabel value="Min number"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<apex:outputLabel value="Max number"/><br />
                                <apex:inputField value="{!CreateDiscountPlan.Min_number__c}" style="position:relative;left:130px;width:80px;" id="Eventinfo_MinNumber"/>&nbsp;&nbsp;&nbsp;&nbsp;
                                <apex:inputField value="{!CreateDiscountPlan.Max_number__c}" style="position:relative;left:130px;width:80px;"  id="Eventinfo_MaxNumber"/>
                                </apex:outputPanel>
                                </apex:outputPanel>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                                <apex:outputPanel style="position:relative;left:90px;">
                                <apex:inputCheckbox value="{!AddCouponDiscount}">
                                <apex:actionSupport event="onchange" reRender="DisplayCouponDiscount"/>
                                </apex:inputCheckbox>
                                <apex:outputLabel value="Add discount coupon" /><br />
                                <apex:outputPanel id="DisplayCouponDiscount" style="position:relative;left:50px;">
                                <apex:outputPanel rendered="{!AddCouponDiscount==true}">
                                <b><apex:outputLabel value="Coupon code" /></b>
                                <apex:inputField value="{!CreateDiscountPlan.Coupon_code__c}"  style="position:relative;left:20px;" id="Eventinfo_Ccode"/>
                                </apex:outputPanel>
                                </apex:outputPanel>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                </apex:pageBlockSection>                 
        </apex:pageBlock>
</apex:form> 
</apex:page>

 

   I did inserting and updating records like this many times, every where its working fine, but here its not working.

 

  I checked with debug logs.The problem is I am unable to get the new value from visualforce page to apex method(save). So only updating is happening with old values.

 

  I spent many hours to find the issue But I am unable to find. can somebody please help me.

 

Thanks,

Naresh

HI Every one,

 

    I have a visualforce page and corresponding apex class like this

<apex:page standardController="Event__c" extensions="CreateAnEvent">
...code.........
...code.........
</apex:page>

 Now I want to call a method in apex class, from JavaScript function.Can any one have any idea. Can you please help me in this requirement.

 

Thanks,

Naresh 

HI Every one,

 

I released a managed package to the appexchange successfully. After the first release, again by adding few more featureas I released a new version.

 

Can I configure my package such that users(who already installed my package) can upgrade my package automatically when I release a new version. How can I do this.

 

 

Now automatic upgrades are not happening in user instances.

 

Thanks,

Naresh B

HI Every one,

 

     I created a custom button in contacts standard object.I given the url, as /apex/virtualterminal?ContactId={!Contact.Id}  .When user clicks on this button it displays a page with this url  https://cnp.na3.visual.force.com/apex/virtualterminal?ContactId={!Contact.Id} . I created a managed package and installed in a developer account for testing.

 

     When I click on the custom button it displaying a page with url https://c.na3.visual.force.com/apex/virtualterminal?ContactId={!Contact.Id} . and its giving a error, "Page virtualterminal does not exist".I am unable to understand why cnp is changing to c in the url. I did a lot search but did not find the solution.please help me.

 

Thanks,

Naresh B

 

 

HI Friends,

 

    

<apex:repeat value="{!displayFields}" var="f">
                    <apex:inputfield value="{!acct[f]}" rendered="cond"/>
<apex:selectlist value="{!acct[f]}" rendered="cond" onchange="showstates('this.value')">
<apex:selectOptions value="{!showcountries}">

</apex:selectlist>
<apex:outputpanel id="staterefresh">
<apex:selectlist value="{!acct[f]}" rendered="cond">
<apex:selectOptions value="{!showStates}">
</apex:selectlist>
<apex:outputpanel>
                </apex:repeat>

 According to the country selected, I need to refresh the State values... But this is not at all happening in visualforce page. I am able to refresh the values according to the country selected but when I submit the form to save the record, I am getting error 'Mailing State/Province: Validation Error: Value is not valid'. 

 

Please help me.

 

Thanks,

Naresh B

HI Everybody,

 

    I have a new requirement in my project. My requirement is I want to customize related list.For a custom object we will have a page layout.In that page layout I can add related lists.If I drag and drop this related list in layout I can see this in detail page of record of that custom object. 

Now how can I get the fields of that related list in apex code. If I get these fields in apex code, I can display them in visualforce in a very customized way.

 

If you need any more information please let me know.

 

   Kindly help me.

 

Thanks,

Naresh B

HI All,

 

    I have HelpText attributes in <apex:pageblocksectionitem> in visualforce pages. When I keep mouse on ? symbol, it displaying helptext well till yesterday. Today I am unable to see help text when I keep mouse on? symbol. This is happening in all visualforce pages and all fields.

 

   What is the problem here. And how to resolve this.

 

Thanks,

Naresh B

HI Every body,

 

    I have a popup registration form(VF page), in sites. Users will register from that popup registration form. This working fine in all browsers but not in IE9 compatibility mode. IN IE 9, the popup is coming, but after entering the data, when we click save button, record is not saving in the database.

 

    Have anybody come across the same issue? Please let me know how you resolved.

 

 

   If you need any more information, please let me know.

 

Thanks,

Naresh B 

HI Every body,

 

     I created a public site by using "Sites" in salesforce and displaying some visualforce pages through public site. When I run the security scanner on this salesforce instance, it showing one problem in "SiteRegisterController" class regarding a hardcode Id. I am not at all using this class and this class is not a part of my application.

 

      Do any one come across the same problem?Please let me know how to resolve it.

 

Thanks,

Naresh B

HI Everybody,

 

     I made a managed package and uploaded to appexhange. Now I made some modifications to the application and upgraded the managed package after including all the modified tasks. Now when I installed the package, I am unable to see some of those changes.

 

      Can any one guess the problem here. Please let me know if you need any other information.

 

Thanks,

Naresh B

HI Every one,

 

    I have a custom object "Events", I wrote a visualforce page by using apex:inputfield and displaying all the fields of custom object events and displaying them. 

 

   Now I created a force.com site and used above visualforce page as a default home page. I given all the permissions in

Custom Object Permissions, for Events object and I given all field level permissions tooin GUEST PROFILE.But I am unable to see the  events fields in force.com sites page. Kindly help me if you have any information.

 

Thanks,

Naresh B

HI All, I tried a lot.But didn't get the solution.

 

           I have a custom objects Registration_level__c and Attendee_Session__c. The  Attendee_Session__c custom object has lookup field of Registration_level__c.

 

           How can I display the related list of Attendee_Session__c which is in Registration_level__c detail page in a visualforce page.

 

 

Kindly help me. If you need any more information please let me know.

 

Thanks,

Naresh

HI Every body, I have a apex class, visualforce page. I am creating records and updating records of a custom object with this class and page only.Inserting is working well.But updating was working fine before but now its not working.

 

Apex class:

public with sharing class DiscountPlan{

    public DiscountPlan() {

    }
    public string DiscountRecordId {get;set;}

    public DiscountPlan(ApexPages.StandardController controller) 
                        {
                        DiscountRecordId=ApexPages.currentPage().getParameters().get('Id');
                        if(DiscountRecordId == null) 
                                {
                                    CreateDiscountPlan= new Discount_plan__c();
    
                                }
                        if(DiscountRecordId != null)
                                {
                                    CreateDiscountPlan=[select Id,Name,End_of_plan__c,Coupon_code__c,discount__c,expire_date__c,Event_name__c,fixed_discount__c,inventory__c,Max_number__c,Min_number__c,Registration_level__c,Start_date__c,Registration_level__r.Price__c from Discount_plan__c where id=:DiscountRecordId];
                                }
    
                        }

    Discount_plan__c CreateDiscountPlan;
    public Discount_plan__c GetCreateDiscountPlan(){return CreateDiscountPlan;}
    public void setCreateDiscountPlan(Discount_plan__c CreateDiscountPlan) {this.CreateDiscountPlan=CreateDiscountPlan;}
    public boolean Inventory{get;set;}
    public boolean AddGroupDiscount {get;set;}
    public boolean AddCouponDiscount{get;set;}
    public string EndOfInventory{get;set;}
    public string SelectPlan{get;set;}
    public Decimal EventPrice1{get;set;}
    Decimal EventPrice;
    public string TotalDiscount{get;set;}
    list<string> ObjectFields=new list<string>();
    public integer RelatedDiscountPlansSize{get;set;}
   

    public decimal getEventPrice()
                    {
                    Registration_level__c LevelRec=[Select Id,Price__c from Registration_level__c where Id=:ApexPages.currentPage().getParameters().get('RL_id') or Id=:CreateDiscountPlan.Registration_level__c];
                    EventPrice=LevelRec.Price__c;
                    EventPrice=EventPrice.setscale(2);
                    
                    return EventPrice;
                    }
    public void setEventPrice(decimal EventPrice){this.EventPrice=EventPrice;}
    public string getEventName(){return ApexPages.currentPage().getParameters().get('Event_name');}

    public string getRegistrationLevelName(){return ApexPages.currentPage().getParameters().get('Rl_name');}
           
    
    
    public PageReference save(){
                        if(DiscountRecordId == null){
                        CreateDiscountPlan.Registration_level__c=ApexPages.currentPage().getParameters().get('RL_id');
                        CreateDiscountPlan.Event_name__c=ApexPages.currentPage().getParameters().get('Event_Id');
                        system.debug('Session id'+ApexPages.currentPage().getParameters().get('Session_id'));
                        insert CreateDiscountPlan;
                        }
                        if(DiscountRecordId != null){
                        system.debug('check inventory'+CreateDiscountPlan.inventory__c);
                        update CreateDiscountPlan;
                        }
                        PageReference RedirectUrl;
                        If(CreateDiscountPlan.Registration_level__c!=null){
                        RedirectUrl= new PageReference('/'+CreateDiscountPlan.Registration_level__c);
                        }
                        RedirectUrl.setRedirect(true);

                        return RedirectUrl;
                 }
    public PageReference cancel(){
                        CreateDiscountPlan.Registration_level__c=ApexPages.currentPage().getParameters().get('RL_id');
                        PageReference RedirectUrl;
                        If(CreateDiscountPlan.Registration_level__c!=null){
                        RedirectUrl= new PageReference('/'+CreateDiscountPlan.Registration_level__c);
                        }
                        RedirectUrl.setRedirect(true);
                        return RedirectUrl;

}
/*public void SaveAndNew(){
CreateDiscountPlan.Registration_level__c=ApexPages.currentPage().getParameters().get('RL_id');
CreateDiscountPlan.Event_name__c=ApexPages.currentPage().getParameters().get('Event_Id');
//CreateDiscountPlan.Session__c=ApexPages.currentPage().getParameters().get('Session_id');
system.debug('Session id'+ApexPages.currentPage().getParameters().get('Session_id'));
insert CreateDiscountPlan;
CreateDiscountPlan=null;
}*/

    public PageReference UploadCouponfile(){
                            PageReference returnURL;
                            returnURL = new PageReference('/apex/UploadCSVDiscounts');
                            returnURL.setRedirect(true);
                            return returnURL;
                        }

    public List<SelectOption> getRelatedDiscountPlans() {
                                 List<SelectOption> options = new List<SelectOption>();
                                string LevelId=ApexPages.currentPage().getParameters().get('RL_id');

                                String queryString = 'SELECT Id,Name FROM Discount_plan__c where Registration_level__c=:LevelId';
                                options.add(new SelectOption('--Select--','--Select--'));
                                for(sObject o : Database.query(queryString)){
                                            options.add(new SelectOption((String)o.get('Id'),(String)o.get('Name')));
                                            //Event_Id_Name_Map.put((String)o.get('Name'),(Id)o.get('Id'));
                                            }
                                RelatedDiscountPlansSize=options.size();
                            return options;
                    }
}

 Visualforce page:

<apex:page standardController="Discount_plan__c" extensions="DiscountPlan">
<script>
window.onload=DisableFunction;
function DisableFunction(){
var Pricefield= document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_Price}');
Pricefield.disabled=true;
TotalDiscount();

}
function TotalDiscount(){
//alert('naresh');
var desc= document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_Cdiscount}').value;
var Price= document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_Price}').value;
var FixedDisc= document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_Fixeddiscount}').value;
var totalDisc=document.getElementById('{!$Component.CreateDiscountPlan.CouponRecord.CouponInfo.AmountItem.Eventinfo_TotalDisc}');
var IntFixedDesc=parseFloat(FixedDisc)
totalDisc.value=(desc*Price+IntFixedDesc);

//alert(totalDisc.value);

}
</script>
<apex:form id="CreateDiscountPlan">
        <apex:pageBlock id="CouponRecord" title="Discount plan">
                <apex:pageBlockButtons >
                        <apex:commandButton action="{!save}" value="Save" immediate="true"/>
                        
                        <!--<apex:commandButton action="{!SaveAndNew}" value="Save and new"/>-->
                        <apex:commandButton action="{!cancel}" value="Cancel"/>
                        <apex:commandButton action="{!UploadCouponfile}" value="Upload a discount file"/>
                </apex:pageBlockButtons>
                <apex:pageBlockSection id="CouponInfo" title="Plan details" columns="1" collapsible="false">
                        <apex:pageBlockSectionItem rendered="{!IF(EventName!=null,true,false)}">
                                <apex:outputLabel value="Event name"/>
                                <apex:outputText value="{!EventName}"/>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem rendered="{!if((RegistrationLevelName!=null && EventName!=null),true,false)}">
                                <apex:outputLabel value="Registration level name"/>
                                <apex:outputText value="{!RegistrationLevelName}"/>
                        </apex:pageBlockSectionItem>                                               
                        <apex:pageBlockSectionItem rendered="{!IF(CreateDiscountPlan.Event_name__c!=null,true,false)}">
                                <apex:outputLabel value="Event name"/>
                                <apex:outputPanel >
                                        <apex:inputField value="{!CreateDiscountPlan.Event_name__c}" style="width:250px" id="FieldInfo_Event"/>
                                        <script>document.getElementById('{!$Component.FieldInfo_Event}').disabled = true; </script>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem rendered="{!IF(CreateDiscountPlan.Registration_level__c!=null,true,false)}">
                                <apex:outputLabel value="Registration level name"/>
                                        <apex:outputPanel >
                                                <apex:inputField value="{!CreateDiscountPlan.Registration_level__c}" style="width:250px" id="FieldInfo_level"/>
                                                <script>document.getElementById('{!$Component.FieldInfo_level}').disabled = true; </script>
                                        </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:inputField value="{!CreateDiscountPlan.Name}" id="Eventinfo_PlanName"/>
                        <apex:pageBlockSectionItem Id="AmountItem">
                                <apex:outputPanel >
                                        <b><apex:outputLabel value="Total Discount"/></b>
                                </apex:outputPanel>
                                <apex:outputPanel onkeyup="TotalDiscount();">
                                        &nbsp;&nbsp;&nbsp;Discount %&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Price&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fixed discount&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total discount<br />
                                        &nbsp;(&nbsp;<apex:inputField value="{!CreateDiscountPlan.discount__c}" style="width:60px;" id="Eventinfo_Cdiscount"/>&nbsp;&nbsp;X&nbsp;&nbsp;
                                        <apex:inputText value="{!EventPrice}" style="width:90px;" id="Eventinfo_Price" />
                                        &nbsp;)+&nbsp;
                                        <apex:inputField value="{!CreateDiscountPlan.fixed_discount__c}" style="width:80px;" id="Eventinfo_Fixeddiscount"/>&nbsp;=&nbsp;
                                        <apex:inputText value="{!TotalDiscount}" style="width:60px;" disabled="true" id="Eventinfo_TotalDisc"/>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                                <apex:outputLabel value="Start date" />
                                        <apex:outputPanel >
                                        <apex:inputField value="{!CreateDiscountPlan.Start_date__c}" id="Eventinfo_Startdate"/>
                                        <apex:outputPanel rendered="{!IF(RelatedDiscountPlans.size>1,true,false)}">
                                        <b>OR</b> End of plan &nbsp;&nbsp;&nbsp;
                                        <apex:selectList id="AccountId" value="{!CreateDiscountPlan.End_of_plan__c}" size="1">                 
                                                <apex:selectOptions value="{!RelatedDiscountPlans}"/>
                                        </apex:selectList>
                                </apex:outputPanel>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:inputField value="{!CreateDiscountPlan.expire_date__c}" id="Eventinfo_Enddate"/>
                        <apex:pageBlockSectionItem > 
                                <apex:outputPanel style="position:relative;left:90px;">
                                <apex:inputCheckbox value="{!Inventory}">
                                <apex:actionSupport event="onchange" reRender="DisplayInventory"/>
                                </apex:inputCheckbox>
                                <apex:outputLabel value="Add inventory"></apex:outputLabel><br />
                                <apex:outputPanel id="DisplayInventory"  style="position:relative;left:50px;">
                                <apex:outputPanel rendered="{!Inventory==true}">
                                <b><apex:outputLabel value="Inventory"></apex:outputLabel></b>
                                <apex:inputField value="{!CreateDiscountPlan.inventory__c}" style="position:relative;left:15px;" id="Eventinfo_CInventory"/><br /><br />
                                </apex:outputPanel>
                                </apex:outputPanel>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                                <apex:outputPanel style="position:relative;left:90px;">
                                <apex:inputCheckbox value="{!AddGroupDiscount}">
                                <apex:actionSupport event="onchange" reRender="DisplayGroupDiscount"/>
                                </apex:inputCheckbox>
                                <apex:outputLabel value="Add group discount"></apex:outputLabel><br />
                                <apex:outputPanel id="DisplayGroupDiscount"   style="position:relative;left:50px;">
                                <apex:outputPanel rendered="{!AddGroupDiscount==true}">
                                <b><apex:outputLabel value="Based on # registered" /></b>&nbsp;&nbsp;&nbsp;&nbsp;
                                <apex:outputLabel value="Min number"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<apex:outputLabel value="Max number"/><br />
                                <apex:inputField value="{!CreateDiscountPlan.Min_number__c}" style="position:relative;left:130px;width:80px;" id="Eventinfo_MinNumber"/>&nbsp;&nbsp;&nbsp;&nbsp;
                                <apex:inputField value="{!CreateDiscountPlan.Max_number__c}" style="position:relative;left:130px;width:80px;"  id="Eventinfo_MaxNumber"/>
                                </apex:outputPanel>
                                </apex:outputPanel>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                                <apex:outputPanel style="position:relative;left:90px;">
                                <apex:inputCheckbox value="{!AddCouponDiscount}">
                                <apex:actionSupport event="onchange" reRender="DisplayCouponDiscount"/>
                                </apex:inputCheckbox>
                                <apex:outputLabel value="Add discount coupon" /><br />
                                <apex:outputPanel id="DisplayCouponDiscount" style="position:relative;left:50px;">
                                <apex:outputPanel rendered="{!AddCouponDiscount==true}">
                                <b><apex:outputLabel value="Coupon code" /></b>
                                <apex:inputField value="{!CreateDiscountPlan.Coupon_code__c}"  style="position:relative;left:20px;" id="Eventinfo_Ccode"/>
                                </apex:outputPanel>
                                </apex:outputPanel>
                                </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                </apex:pageBlockSection>                 
        </apex:pageBlock>
</apex:form> 
</apex:page>

 

   I did inserting and updating records like this many times, every where its working fine, but here its not working.

 

  I checked with debug logs.The problem is I am unable to get the new value from visualforce page to apex method(save). So only updating is happening with old values.

 

  I spent many hours to find the issue But I am unable to find. can somebody please help me.

 

Thanks,

Naresh

HI Every one,

 

    I have a visualforce page and corresponding apex class like this

<apex:page standardController="Event__c" extensions="CreateAnEvent">
...code.........
...code.........
</apex:page>

 Now I want to call a method in apex class, from JavaScript function.Can any one have any idea. Can you please help me in this requirement.

 

Thanks,

Naresh 

HI Every one,

 

     I created a custom button in contacts standard object.I given the url, as /apex/virtualterminal?ContactId={!Contact.Id}  .When user clicks on this button it displays a page with this url  https://cnp.na3.visual.force.com/apex/virtualterminal?ContactId={!Contact.Id} . I created a managed package and installed in a developer account for testing.

 

     When I click on the custom button it displaying a page with url https://c.na3.visual.force.com/apex/virtualterminal?ContactId={!Contact.Id} . and its giving a error, "Page virtualterminal does not exist".I am unable to understand why cnp is changing to c in the url. I did a lot search but did not find the solution.please help me.

 

Thanks,

Naresh B

 

 

HI, I made a managed package and uploaded it to appexchange.I upgraded it many times.Yesterday evening(at 1 st March 2011, 6 pm Indian time) also I upgraded the managed package with a bug fix. I am able to install the package in a developer edition successfully. But while I was installing the same package in enterprise edition, I got this error 

"Package Not Found 
The requested package does not exist or has been deleted. Please contact the package publisher for assistance. If this is a recently uploaded package, please try again soon. " 

After that I tried many times, I got the same error. After 20 hrs also I am getting the same error. 

Another thing is, now I am unable to install the same package in developer edition also. Because I am getting the same error.But I was installed the same package successfully once yesterday. 

 

 

Please help me. I am unable to find any info related to this.

 

Thanks,

Naresh