• Ishan K Sharma
  • NEWBIE
  • 55 Points
  • Member since 2013
  • Senior Consultant

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 28
    Replies

I have a VF page that is launched from a custom button on a Contact record.
It will open a new subtab in a console view, or a new browser tab in a standard view and provide a limited set of fields to the end user for quick Case creation.
I have two separate issues.

1. When clicking the Save button, there is no indication that it has been clicked and the end user can repeatedly click it for ever creating dozens of Cases.  I attempted to resolve this using <apex:facet /> with start and stop which will work for the top button set of the page block but not the bottom.  Additionally when the page encounters an error, the error is not displayed.

2. If I remove the rerender phrase the error messages will appear as they should but then I end up with duplicated Cases.

______________________ VF PAGE _________________________

<apex:page standardController="Case" extensions="CreateCaseController" showHeader="false">
<apex:includeScript value="/support/console/20.0/integration.js"/>
<script>
    sforce.console.setTabTitle('New Case');
</script>
    <apex:form >
        <apex:pageMessages />
        <apex:pageBlock title="New Case">
            <apex:pageBlockButtons >
                <apex:actionStatus id="status">
                    <apex:facet name="start">
                        <apex:outputpanel >
                            Saving...
                        </apex:outputpanel>
                    </apex:facet>
                    <apex:facet name="stop">
                        <apex:outputpanel >
                            <apex:commandButton value="Save" action="{!Save}" rerender="error1,error2" status="status"/>
                            <apex:commandButton value="Cancel" action="{!Cancel}" immediate="true" />
                        </apex:outputpanel>
                    </apex:facet>
                </apex:actionStatus>
            </apex:pageBlockButtons>
            <apex:outputLabel value="Account:  " for="acc"/ >
            <apex:outputField id="acc" value="{!case.accountid}" /><br/>
            <apex:outputLabel value="Contact:  " for="con"/>
            <apex:outputField id="con" value="{!case.contactid}" />
       
            <apex:pageBlockTable value="{!$ObjectType.Case.FieldSets.CaseQuickCreate}" var="f">
                <apex:outputField value="{!case.contactid}"/>
                <apex:outputField value="{!case.accountid}"/>
                <apex:column value="{!f.Label}">
                    <apex:facet name="header"></apex:facet>
                </apex:column>
                <apex:column >
                    <apex:inputField value="{!Case[f]}" required="{!f.Required}" />
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>
___________________ END VF PAGE _________________________

___________________ CONTROLLER ________________________
public class CreateCaseController{

public Account account{get; set;}
public Contact contact{get; set;}
public Case cs{get; set;}
public Boolean isSaveSuccess{get; set;}
Public string retURL{get; set;}
Public string csPhone{get; set;}

public CreateCaseController(ApexPages.StandardController controller){

    cs=((case) controller.getRecord());
    cs.contactid=ApexPages.currentPage().getParameters().get('cid');
    cs.accountid=ApexPages.currentPage().getParameters().get('aid');
    }
   
public void createCase(){
    cs.contactid=ApexPages.currentPage().getParameters().get('cid');
    cs.accountid=ApexPages.currentPage().getParameters().get('aid');
   
    try{       
        insert cs;
        isSaveSuccess = true;
        retUrl=cs.id;
        }
    catch(DmlException ex) {
        ApexPages.addMessages(ex);
        }       
    }
 }
_________________ END CONTROLLER ______________________

Desired outcome -
1. When clicking on the Save button, all buttons are greyed out like standard Salesforce functionality.  When saved the tab is redirected to the new Case.
2. When an error is encountered the page shows the specifics of the error.

Any direction toward this solution will be greatly appreciated.

 

Hi All,

It looks like salesforce doesnot allow to create quick actions on opportunity products. Also salesforce does not recommend to use javascript button as it could conflict with lightning scripts.
As all new orgs are on lightning now, what are the options do we have to create a tiny cute button on opp products layout so that users can update something on opp products just by hitting it? Happy days!!

Thanks
Ishan
Hi,

Below is a simple example of lightnng form  but it is not showing lightning experience. CSS is not working. Do i need to call Lightning CSS style sheet all the time in every lightning component? Or i am missing something else ?
 
<aura:component>
    <div class="slds-p-bottom_large slds-p-left_large" style="width:500px">
        <lightning:recordEditForm aura:id="recordViewForm"
                                     recordId="0036F00002mr8eC"
                                     objectApiName="Contact">
            <lightning:messages />
            <lightning:inputField fieldName="FirstName" />
            <lightning:inputField fieldName="LastName" />
            <lightning:inputField fieldName="Birthdate" />
            <lightning:inputField fieldName="Phone" />
            <!--Picklist-->
            <lightning:inputField fieldName="Level__c" />
            <lightning:button aura:id="submit" type="submit" label="Update record" class="slds-m-top_medium" />
            </lightning:recordEditForm>
    </div>
</aura:component>

User-added image
Hi All,

I am overriding opportunity creation. I wanted to make it configurable so i just created a quick action with some fields on action layout and hide the standard new button.
Now i want some more customization. I am now creating a custom Iightning component and want to call that quick action layout within my custom component so that if somebody change the layout it will change on custom component automatically.

Is it possible to show quick action or global action layouts in custom lightning components? Or Any other possiblities like flow screen etc?
Hi All

I need to show thousands of records through search button on vf page. I was facing view state and heapsize issues and i resolved this by giving pagination.I provide next and previous button for this and show data in blocks of 500.
But i need to export whole data i.e all thousands of records in csv.For which i need to create a list having all the data and export it via vf page.But it again show heapsize error.
What should be the possible solution for this.

I think export functionality should be done by batch.I want to know whether it is feasible or not. Can we create vf page through batch?
Or is there any other solution for this?

Thanks
Ishan
Hi All

I need to show thousands of records through search button on vf page. I was facing view state and heapsize issues and i resolved this by giving pagination.I provide next and previous button for this and show data in blocks of 500.
But i need to export whole data i.e all thousands of records in csv.For which i need to create a list having all the data and export it via vf page.But it again show heapsize error.
What should be the possible solution for this.

I think export functionality should be done by batch.I want to know whether it is feasible or not. Can we create vf page through batch?
Or is there any other solution for this?


Thanks
Ishan
 

Scenerio:

I have 4 objects in relation.Let's say obj1,obj2,obj3,obj4.Obj2 and obj3 both have lookup to obj1 or say obj1 is parent of both.And Obj4 is child of obj3. Now i want to create dynamic tables on basis of no. of records in Obj1 whose rows will come from obj2 and obj4's records. No. of tables in my vf page wil be no. of records user inserted in obj1 . Rows of every table will be no.of records in obj2 plus records of obj4 related to obj1 respectively. Table has 2 colums which is the fields of obl2 and obj4.

 

Now problem is obj4 is not direct child of obj1 and i cannot do subquerry into a subquerry. How should i approch this?

Hi

 

Ihave list which i want to show in two columns only.

Suppose My list have 1,2,3,4,5,6

 repeater display like this

1                                

2                                 

3        

4

5

6

 

I want layout like ..

 

1            2

3            4

5            6

 

Thanks & Regards

Ishan Sharma

Hi

 

I have two vf pages sharing one controller.one is vf page and other is vf page(renderas pdf). 1st vf page search and show some records with checkbox.  On the basis selected records a pdf generates which is my 2nd vf page . pdf page also uses  instance variables of controller to show dynamic values in it. Now i am saving this generated pdf to NOTES & ATTACHMENTS of some specific object.

I am able to save it but all Dynamic values are not available in notes and attachments.Only hardcoded valus are available

 

I think it is related to binding i.e my constructor is calling 2 times and thatswhy all the selected records wash away. Pdf generates when constructor calls 2nd time .I am not able to bind it.

Please suggest some solution.

 

Tkanks

Ishan Sharma

 

 

https://cs5.salesforce.com/widg/filepicker_fs.jsp?lktp=015&mode=1&eid=00YO0000000MQcZ&utype=00P&omod...

 

This is my url. I want to know what exactly these parameters reference to??.

lktp,&mode,eid , utype &omode and otype..what does it stands for?

 

Thanks&Regards

Ishan Sharma

 

https://cs5.salesforce.com/widg/filepicker_fs.jsp?lktp=015&mode=1&eid=00YO0000000MQcZ&utype=00P&omode=1&otype=2

 

This is my url. I want to know what exactly these parameters reference to??.

lktp,&mode,eid , utype &omode and otype..what does it stands for?

 

Thanks&Regards

Ishan Sharma

Hi

 

i have scenerio to which i am stuck up with. I need help with it.

 

I created a vf page render as pdf type which have two buttons on top SAVE and SAVE&EMAIL. On click of SAVE&EMAIL  it will save as attachment of notesandattachment of some specific object  and also will redirect to send email page of Activity and this vf page(pdf type) should be attached as an attachment of it automatically. So that we dont need to attach file manually and can send it as attachment of email by just hitting the send email button.

 

I am able to attach it to Notes and attachments but i am stuck up with 2nd scenerio. I need help with it. What should be the approch.

 

Thanks 

Ishan Sharma

Hi

 

i have scenerio to which i am stuck up with. I need help with it.

 

I created a vf page render as pdf type which have two buttons on top SAVE and SAVE&EMAIL. On click of SAVE&EMAIL  it will save as attachment of notesandattachment and also will redirect to send email page of Task and this vf page(pdf type) should be attached as an attachment of it automatically. So that we dont need to attach file manually and can send it as attachment of email by just hitting the send email button.

 

I am able to attach it to Notes and attachments but i am stuck up with 2nd scenerio. I need help with it.

 

Thanks 

Ishan Sharma

Hi

 

I want to create new user on the button click on my vf page. What should be the logic in my controller. Any advice

 

Thanks

Ishan Sharma

Hi

 

How to have a default value in the inputField in Visualforce in a blur format, For e.g. to enter a Number field : the value should be 'Enter a Number'.

 

As soon as the user clicks to enter the value in the inputField, it should not display anything.

Any advice.

 

Thanks

Ishan Sharma

Hi

I am new to test classes. I have made controller which contain only querries. I need help to make a test class of it.

what should be the approach?

 

///////////////////////controller///////////////////////////////////////

 

public with sharing class Bcaformatcontroller{

public String workstations { get; set; }
public date today{get;set;}
public String offerID = ApexPages.currentPage().getParameters().get('Id');
public List <RealSteer__LeaseOffer__c> records {get;set;}
public List<Contact> licenseeCon {get;set;}
public List<AccountContactRole> licenseeConID {get;set;}
public List<AccountContactRole> licensorConID {get;set;}
public List<Contact> licensorCon {get;set;}
public List<Services__c> charge{get; set;}
public List<Services__c> chargeParking{get; set;}
public String pdfURL{get;set;}

public Bcaformatcontroller(){
today = System.today();
records = [Select r.Deposit_ask_for__c, r.Start_Date__c, r.RealSteer__Property__r.Name,RealSteer__Property__r.RealSteer__Street__c,RealSteer__Property__r.RealSteer__City__c,
RealSteer__Property__r.RealSteer__State__c,RealSteer__Property__r.RealSteer__Country__c, Offer_Through__c, RealSteer__Property__r.Account__c,
r.RealSteer__Property__c, r.Name, r.Id, r.End_Date1__c, r.Duration__c,Company_Name__r.Name,r.RealSteer__Property__r.Total_L_Shaped__c, r.RealSteer__Property__r.Total_Linear__c,
r.Company_Name__c, Broker_Name__c,Company_Name__r.BillingCountry,Company_Name__r.BillingPostalCode,
Company_Name__r.BillingState,Company_Name__r.BillingCity,Company_Name__r.BillingStreet ,r.Lock_In_Period__c, r.Notice_Period__c
From RealSteer__LeaseOffer__c r where id = :offerID];

licenseeConID = [SELECT ContactId FROM AccountContactRole WHERE (IsPrimary =: true AND AccountId =: records[0].Company_Name__c)];
licenseeCon = [Select LastName,Phone,Fax, FirstName, Salutation From contact where id =: licenseeConID[0].ContactId ];

licensorConID = [SELECT ContactId FROM AccountContactRole WHERE (IsPrimary =: true AND AccountId =: records[0].RealSteer__Property__r.Account__c)];
licensorCon = [Select LastName,Phone,Fax, FirstName, Salutation From contact where id =: licensorConID[0].ContactId ];

charge = [Select Charges_Per_Hour__c from Services__c where (Business_Center_Name__c = :records[0].Company_Name__c AND RecordTypeid in(select id from recordtype where name = : 'Internet Services'))];
chargeParking = [Select Parking_Rate__c from Services__c where (Business_Center_Name__c = :records[0].Company_Name__c AND RecordTypeid in(select id from recordtype where name = : 'Parking'))];


}


}

 

Thanks

Ishan Sharma

Error: Compile Error: Method does not exist or incorrect signature: [String].isEmpty() at line 14 column 22

 

public class Signupcontroller{

  public String name{get;set;}
  public String password{get;set;}
  public String email{get;set;}
  public String reEnter{get;set;}        
    
   public Pagereference signup(){
    
      Integer result = reEnter.compareTo(email);                
         try {
           if(result !=0){
            ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Invalid'));}
            else if (name.isBlank()){
             ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Invalid username'));}            
            else{
            Credential__c obj = new Credential__c(Name = name , Password__c = password ,Your_Email__c = email);
             insert obj;
            }                       
         } catch(DmlException ex){
           // ApexPages.addMessages(ex);
          //  obj.Name.addError('Exception occured');
         //   ApexPages.addMessage(new Apexpages.Message(ApexPages.Severity.ERROR, 'Exception occured on insert'));             
          }       
        
         return null;
    }      
}

 

I am trying to null check on string name? Can any one help me with this

 

Thanks

Ishan Sharma

Hi

 

I have 4 checkbox field and a commandbutton on my vf page. My requirement is out of 4 checkbox atleast 1 must be true . if not then it show error on  click of that commandbutton. 

 

How should i approch this?

 

Thanks

Ishan Sharma

Hi

I have word docx file in notes and attachments. I want to display it in my vf page. Is there any way to do this.

 

Thanks

Ishan Sharma

Hi

 

I have word docx file in notes and attachments.I want to display it on my vf page.Is there any way to do this?

 

Thanks

Ishan Sharma

Hi

I am new to salesforce.i need little help with this scenerio

 

I want  to fetch contact record which is highest in organization chart in report to field.

 

My schema is like i have say 3 cont. on same acc. . cont. have a reportsto field(look up-cont) which make an organization chart.

i want to fetch the topmost cont. in org chart through soql.

 

Is there any way to do this or i have to use some other approach...

 

Thanks 

Ishan Sharma

Hi All,

I am overriding opportunity creation. I wanted to make it configurable so i just created a quick action with some fields on action layout and hide the standard new button.
Now i want some more customization. I am now creating a custom Iightning component and want to call that quick action layout within my custom component so that if somebody change the layout it will change on custom component automatically.

Is it possible to show quick action or global action layouts in custom lightning components? Or Any other possiblities like flow screen etc?
Hello,
I have created method in trigger handler class but method is taking more CPU time and sometime give error. Anyone Please suggested better approch of doing this. Thanks in Advance!!
Boolean QueryrunOnce = true;
Public void updatecheckandtoggle(List<AMM_ODR__REL__C> triggerNew)
{
Try{
Set<Id> OppIds = new set<id> ();
List<AMM_Opportunity__c> ListAMMOpptoUpdate;
If (Trigger.isInsert ||Trigger.isUpdate )
{
for (AMM_ODR__REL__C Odr : triggerNew )
{
OppIds.add(Odr.AMM_Opportunity__c);
}

}
if(OppIds.size() > 0 && QueryrunOnce )
{
QueryrunOnce = false;
ListAMMOpptoUpdate = New List<AMM_Opportunity__c> ([Select Id,AMM_OPP_Check__c,(Select TTPI__C from Summury_Flex__Jo__r) from AMM_Opportunity__c where id:=OppIds];
}
If(!ListAMMOpptoUpdate.isEmpty())
{
for (AMM_Opportunity__c Opps: ListAMMOpptoUpdate )
{
If (Opps.Summury_Flex__Jo__r.size()>0)
{
for (AMM_ODR__REL__C Odrr : Opps.Summury_Flex__Jo__r)
{
if(Odrr!null && odrr.TTPI__C!=null && Odrr.TTPI__C.startwith('14') )
{
Opps.AMM_OPP_Check__c = true;
opps.AMM_OPP_toggle__c=true;
} else
{
Opps.AMM_OPP_Check__c = true;
opps.AMM_OPP_toggle__c=true;
}
}
}
} Update ListAMMOpptoUpdate;
}
} Catch (Exception ex) {system.debug('The Exception Occur - ')}

 

I have a VF page that is launched from a custom button on a Contact record.
It will open a new subtab in a console view, or a new browser tab in a standard view and provide a limited set of fields to the end user for quick Case creation.
I have two separate issues.

1. When clicking the Save button, there is no indication that it has been clicked and the end user can repeatedly click it for ever creating dozens of Cases.  I attempted to resolve this using <apex:facet /> with start and stop which will work for the top button set of the page block but not the bottom.  Additionally when the page encounters an error, the error is not displayed.

2. If I remove the rerender phrase the error messages will appear as they should but then I end up with duplicated Cases.

______________________ VF PAGE _________________________

<apex:page standardController="Case" extensions="CreateCaseController" showHeader="false">
<apex:includeScript value="/support/console/20.0/integration.js"/>
<script>
    sforce.console.setTabTitle('New Case');
</script>
    <apex:form >
        <apex:pageMessages />
        <apex:pageBlock title="New Case">
            <apex:pageBlockButtons >
                <apex:actionStatus id="status">
                    <apex:facet name="start">
                        <apex:outputpanel >
                            Saving...
                        </apex:outputpanel>
                    </apex:facet>
                    <apex:facet name="stop">
                        <apex:outputpanel >
                            <apex:commandButton value="Save" action="{!Save}" rerender="error1,error2" status="status"/>
                            <apex:commandButton value="Cancel" action="{!Cancel}" immediate="true" />
                        </apex:outputpanel>
                    </apex:facet>
                </apex:actionStatus>
            </apex:pageBlockButtons>
            <apex:outputLabel value="Account:  " for="acc"/ >
            <apex:outputField id="acc" value="{!case.accountid}" /><br/>
            <apex:outputLabel value="Contact:  " for="con"/>
            <apex:outputField id="con" value="{!case.contactid}" />
       
            <apex:pageBlockTable value="{!$ObjectType.Case.FieldSets.CaseQuickCreate}" var="f">
                <apex:outputField value="{!case.contactid}"/>
                <apex:outputField value="{!case.accountid}"/>
                <apex:column value="{!f.Label}">
                    <apex:facet name="header"></apex:facet>
                </apex:column>
                <apex:column >
                    <apex:inputField value="{!Case[f]}" required="{!f.Required}" />
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>
___________________ END VF PAGE _________________________

___________________ CONTROLLER ________________________
public class CreateCaseController{

public Account account{get; set;}
public Contact contact{get; set;}
public Case cs{get; set;}
public Boolean isSaveSuccess{get; set;}
Public string retURL{get; set;}
Public string csPhone{get; set;}

public CreateCaseController(ApexPages.StandardController controller){

    cs=((case) controller.getRecord());
    cs.contactid=ApexPages.currentPage().getParameters().get('cid');
    cs.accountid=ApexPages.currentPage().getParameters().get('aid');
    }
   
public void createCase(){
    cs.contactid=ApexPages.currentPage().getParameters().get('cid');
    cs.accountid=ApexPages.currentPage().getParameters().get('aid');
   
    try{       
        insert cs;
        isSaveSuccess = true;
        retUrl=cs.id;
        }
    catch(DmlException ex) {
        ApexPages.addMessages(ex);
        }       
    }
 }
_________________ END CONTROLLER ______________________

Desired outcome -
1. When clicking on the Save button, all buttons are greyed out like standard Salesforce functionality.  When saved the tab is redirected to the new Case.
2. When an error is encountered the page shows the specifics of the error.

Any direction toward this solution will be greatly appreciated.

 

I am rendering a pdf on a button click. After doing this it will not let me do again as the pdf gives the same information eventhough i have choose a different task to pdf. Is there a way to clear values on the click before updating the values.

  • September 15, 2013
  • Like
  • 0

Hi,

I am trying to insert/update the value when the status change to Reviewed it should put the date time in a_date__C  and

when status changed to Approved it should put the date time in r_date__C. 

But it's not giving me an error neither its' updating the field.

 

 

trigger updatefield on imp__c (after update) {
Map<String,imp__c > recordsimp = new Map<String,imp__c >();
List<account> accountToUpdate = new List<account>();

List<imp__c> impToInsert = new List<imp__c>();

 

if (Trigger.isInsert){
        for (imp__c impRecord : trigger.new){
            if(imprecord.Status__c == 'Reviewed' || imprecord.Status__c == 'Approved'){
                imp__c impObj = new imp__c (a_Date__c = datetime.Now(),r_date__c=datetime.now());
                insert  impObj;                  
            }
              
        }
        insert impToInsert;
    }

 

 

Else{

 

 


for(imp__c impRecord : trigger.new){

Imp__c oldImp = trigger.oldMap.get(impRecord.Id);

// only add IMP record Ids to the Map if the IMP record Status__c field changes

if(impRecord.Status__c != oldImp.Status__c)
recordsimp.put(impRecord.rec_ID__c,impRecord);
}

 

// only execute below if the Map is not empty (any Status__c changes occured above)

if(!recordsimp.isEmpty(){
accountToUpdate = [select id,Status__c,account_num__c from account where account_num__c IN: recordsimp.keyset()];
for(account accounts: accountToUpdate){
accounts.status__c = recordsimp.get(accounts.account_num__c).Status__c;
}
if(accountToUpdate.size() > 0){
update accountToUpdate;
}
}

}

}

hello.  odd behavior.  i have a vf page which allows the user to upload an attachment (standard inputFile stuff).  the attachment area is displayed conditionally - based on a controller variable.  when i browse to the page and try to upload an attachment, i get an error:  REQUIRED_FIELD_MISSING, Required fields are missing: [File Name, Body]: [File Name, Body].  However if i remove the "rendered" flag from the outputPanel, it works correctly.  what am i doing wrong?  all info is below.  thanks so much for your time.

 

thanks

chris 

 

the code is pasted below.  i tried to remove all unnecessary code...

 

VF Page is below.  offending "rendered" attribute in bold italics.  when the user clicks "CLICK ME", it calls the controller and flips the flag so that the inputFile area is displayed:

 

<apex:form >

<apex:outputPanel id="fullPagePanel">
<table >
<tr>

<td width="25%" valign="top">
<apex:outputPanel id="leftTablePanel">
<table >
<apex:actionRegion >
<apex:repeat value="{!itemWrapList}" var="itemWrap" id="itemWrapListRepeat">
<tr>
<td width="20%">
<apex:outputLink value="#">CLICK ME
<apex:actionSupport event="onclick" action="{!selectItemForEdit}" rerender="leftTablePanel, detailsPanelOuter, controllerMessagePanel, attachmentOuterPanel">
<apex:param name="selectedItemId" value="{!itemWrap.tmpId}" assignTo="{!itemIdForEdit}"/>
</apex:actionSupport>
</apex:outputLink>
</td>
</tr>
</apex:repeat>
</apex:actionRegion>
</table>
</apex:outputPanel>

<apex:outputPanel id="attachmentOuterPanel">
<apex:outputPanel id="attachmentPanel" rendered="{!AND(itemWrapForEdit != null, itemWrapForEdit.item.Id != null)}">
<apex:actionRegion >
<apex:outputText value="Input File: "/><apex:inputFile value="{!attachmentObj.body}" filename="{!attachmentObj.name}"/><br/>
<apex:commandButton value="Upload" action="{!upload}"/>
</apex:actionRegion>
</apex:outputPanel>
</apex:outputPanel>
</td>

</tr>
</table>
</apex:outputPanel>

</apex:form>

 

Apex below - upload function.  with the "rendered" attribute present, the attachmentObj is always empty, but without the "rendered" attribute, it works correctly:

 

 

public void upload() {
attachmentObj.ParentId = 'a0rM0000000KrVT';
insert attachmentObj;
attachmentObj = new Attachment();
return;
}

 

more Apex - selectItemForExit - which is what toggles the flag so that the inputFile is rendered...

public void selectItemForEdit() {
controllerMessage = null;
System.Debug(' #### in selectItemForEdit:'+itemIdForEdit);
if (itemIdForEdit != null) {
for (ItemWrapClass wrap : itemWrapList) {
System.Debug(' #### wrap.tmpId:'+wrap.tmpId);
if (itemIdForEdit == wrap.tmpId) {
// found
wrap.currentItemFlag = true;
itemWrapForEdit = wrap;

} else {
wrap.currentItemFlag = false;
}

}
}
System.Debug(' #### itemWrapForEdit:'+itemWrapForEdit);
}

Hi

 

I want to create new user on the button click on my vf page. What should be the logic in my controller. Any advice

 

Thanks

Ishan Sharma

Hi

 

How to have a default value in the inputField in Visualforce in a blur format, For e.g. to enter a Number field : the value should be 'Enter a Number'.

 

As soon as the user clicks to enter the value in the inputField, it should not display anything.

Any advice.

 

Thanks

Ishan Sharma

Hi,

 

I created the object with some fields which collects the details of  students.

 

I want to upload an image via the field.

 

Which datatype is suitable for upload an image and how to do it?

 

Can I use the VisualForce for it? If it is, please help me how to do that?

 

Any help is appreciated.

 

Regards.,

R.Ambiga

Hi

I am new to test classes. I have made controller which contain only querries. I need help to make a test class of it.

what should be the approach?

 

///////////////////////controller///////////////////////////////////////

 

public with sharing class Bcaformatcontroller{

public String workstations { get; set; }
public date today{get;set;}
public String offerID = ApexPages.currentPage().getParameters().get('Id');
public List <RealSteer__LeaseOffer__c> records {get;set;}
public List<Contact> licenseeCon {get;set;}
public List<AccountContactRole> licenseeConID {get;set;}
public List<AccountContactRole> licensorConID {get;set;}
public List<Contact> licensorCon {get;set;}
public List<Services__c> charge{get; set;}
public List<Services__c> chargeParking{get; set;}
public String pdfURL{get;set;}

public Bcaformatcontroller(){
today = System.today();
records = [Select r.Deposit_ask_for__c, r.Start_Date__c, r.RealSteer__Property__r.Name,RealSteer__Property__r.RealSteer__Street__c,RealSteer__Property__r.RealSteer__City__c,
RealSteer__Property__r.RealSteer__State__c,RealSteer__Property__r.RealSteer__Country__c, Offer_Through__c, RealSteer__Property__r.Account__c,
r.RealSteer__Property__c, r.Name, r.Id, r.End_Date1__c, r.Duration__c,Company_Name__r.Name,r.RealSteer__Property__r.Total_L_Shaped__c, r.RealSteer__Property__r.Total_Linear__c,
r.Company_Name__c, Broker_Name__c,Company_Name__r.BillingCountry,Company_Name__r.BillingPostalCode,
Company_Name__r.BillingState,Company_Name__r.BillingCity,Company_Name__r.BillingStreet ,r.Lock_In_Period__c, r.Notice_Period__c
From RealSteer__LeaseOffer__c r where id = :offerID];

licenseeConID = [SELECT ContactId FROM AccountContactRole WHERE (IsPrimary =: true AND AccountId =: records[0].Company_Name__c)];
licenseeCon = [Select LastName,Phone,Fax, FirstName, Salutation From contact where id =: licenseeConID[0].ContactId ];

licensorConID = [SELECT ContactId FROM AccountContactRole WHERE (IsPrimary =: true AND AccountId =: records[0].RealSteer__Property__r.Account__c)];
licensorCon = [Select LastName,Phone,Fax, FirstName, Salutation From contact where id =: licensorConID[0].ContactId ];

charge = [Select Charges_Per_Hour__c from Services__c where (Business_Center_Name__c = :records[0].Company_Name__c AND RecordTypeid in(select id from recordtype where name = : 'Internet Services'))];
chargeParking = [Select Parking_Rate__c from Services__c where (Business_Center_Name__c = :records[0].Company_Name__c AND RecordTypeid in(select id from recordtype where name = : 'Parking'))];


}


}

 

Thanks

Ishan Sharma

Error: Compile Error: Method does not exist or incorrect signature: [String].isEmpty() at line 14 column 22

 

public class Signupcontroller{

  public String name{get;set;}
  public String password{get;set;}
  public String email{get;set;}
  public String reEnter{get;set;}        
    
   public Pagereference signup(){
    
      Integer result = reEnter.compareTo(email);                
         try {
           if(result !=0){
            ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Invalid'));}
            else if (name.isBlank()){
             ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Invalid username'));}            
            else{
            Credential__c obj = new Credential__c(Name = name , Password__c = password ,Your_Email__c = email);
             insert obj;
            }                       
         } catch(DmlException ex){
           // ApexPages.addMessages(ex);
          //  obj.Name.addError('Exception occured');
         //   ApexPages.addMessage(new Apexpages.Message(ApexPages.Severity.ERROR, 'Exception occured on insert'));             
          }       
        
         return null;
    }      
}

 

I am trying to null check on string name? Can any one help me with this

 

Thanks

Ishan Sharma

Hi

 

I have 4 checkbox field and a commandbutton on my vf page. My requirement is out of 4 checkbox atleast 1 must be true . if not then it show error on  click of that commandbutton. 

 

How should i approch this?

 

Thanks

Ishan Sharma

Hi

I have word docx file in notes and attachments. I want to display it in my vf page. Is there any way to do this.

 

Thanks

Ishan Sharma

Hi

I am new to salesforce.i need little help with this scenerio

 

I want  to fetch contact record which is highest in organization chart in report to field.

 

My schema is like i have say 3 cont. on same acc. . cont. have a reportsto field(look up-cont) which make an organization chart.

i want to fetch the topmost cont. in org chart through soql.

 

Is there any way to do this or i have to use some other approach...

 

Thanks 

Ishan Sharma