• Thathula
  • NEWBIE
  • 50 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 24
    Replies
Hi All,

I have already created 2 text fields in my custom object. 
I need to bind those two text fields to my visualforce and behave as country , state dependency.
[I've a different object for country and its state also]

I found this example which binds country and state to a property
https://developer.salesforce.com/forums/?id=906F0000000Ar9DIAS

But i need to bind to my two text fields. 

Can someone help me on this..

Thank you very much
 
Hi all,

I've a VF page and its controller, 
I've used page action as below 
<apex:page action="{!validateUser}" 


in my controller i've a method like this

public pageReference validateUser(){

if(someconditionTrue)

        PageReference errorPage = new PageReference('apex/ErrorPage');
        errorPage.setRedirect(true);
        return errorPage;


}

else{


//I need to stay in this page.


}


I'm not sure sure how to code for stay in this page, because this page is always recursively called. 
Hi ALL,

In a VF page, 
I need to check for a condition in Controller class (Constuctor) when page loads and re-direct to insuffient Privileges page after checking a condition.

In controller constructor i've called a method like this

ServiceClass.ValidateUser();

And ValidateUser will be like this :

public static PageReferance validateUser (){

// Need to fill up the code

}

Is there any URL in Salesforce to direct to Insuffient Privilages page ??



 
Hi All 

I have a list of Tasks which created in a apex class;
Task task1=new Task();
task1.subject;..
...

Task task2=new Task();
task2.subject....
....

etc

myTasklist.add(task1);
myTasklist.add(task2);
......
......

And finally i need to insert all the tasks ( List) ??

How can i do that????

Thanks a lot everyone...
 
Hi My Friends,

I've a task Trigger, Its Service Class and another custom object related trigger ( That custom object will be a parent to Tasks)

When custom object field changes to 'Not Use' all the Tasks related to that custom object should be updated

I've a code like this:
CustomObjectTirgger-->TaskMainTrigger----> TaskserviceClass--> TaskServiceClassMethod
In this TaskServiceClassMethod i do check for a condition and i will update the customObject again. I am unable to handle this situation.. Has anyone experince with this situation?


 
Hi, I've a trigger and a service class.
I need to check for a condition in service class and if that matches i need to terminate that event(terminate), not that just function but whole process

How can i do that?

Trigger--> Service Class Function 



Thanks
 
Hi All,

I've senario like this. 
Have some series of winzard type service classes 
Once page one submitted it goes to a page two, page two submitted then it goes to page 3. like wise it goes until wizard ends. 
each page has submitNext (under that save())  and submitBack (Under that SaveBack()) to go to the Next page and Back page. 

each save and saveback functions call a common class method to access database and consume 5-6 queries. 

Is it possible me write a one test class and cover the test coverage of all the controllers, without exceeding SQL 101 limitation. 


Please help me 
Best regards. 


 
Hi EveryOne, 

I need to know how many queries have run so far. Is there any direct method to get that info?
I'm writting a test class for controllers

Thanks alot............
Hi all,

I need to check the record type we selected when we create the case. As an example please check below screenshot. 
i need to capture which record type user has created (i need to capture that in Triger.Insert
User-added image

Thanks alot
Hi i've a custom field called lastmodifiedcom__c  in Task object.

But when i'm trying to set myTaskObj.lastmodifiedcom__c value it gives 
System.TypeException: Invalid date/time error..

This is my code 

 String systemDate=System.now().format('yyyy-MM-ddHH:mm:ss');
   system.debug('TIMEDATE IS'+systemDate);
   myTaskObj.lastmodifiedcom__c =  DateTime.parse(systemDate);


Thank you very much
Hi i need to compare new status and previous status in Task. I've a VF page and its controller.
How can i compare new(after user changed) and old staus(before user change) in apex controller class. Its pretty easy in Triggers, but when it comes to the controller class?

Thanks all my friends.. 
Hi all,

I've a Trigger and in that Trigger i've used addError method.
Everything is fine except i get two error statements like below, All i need is first line, i don't need second one..
Any suggestions?Please fill in Welcome Kit/ E-ID mailing address information
GT_taskCreation: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a2nf000000075GmAAI; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Please fill in Welcome Kit/ E-ID mailing address information: [] Trigger.GT_taskCreation: line 464, column 1 Trigger.GT_taskCreation: line 128, column 1
Thank you very much

User-added image
 Hi all ,

I'm writing a test class for a controller, And test class is like this.. 
Please note that hard coding values isn't good at all, but i'll change it later, this is just for the time being..

    myType__c  Obj= new myType__c();
          Obj.Name='Test  Object';
          Obj.ST_Ref__c='a2Ne0000000JAUo';
          Obj.A_Ref__c='001e000000HPgd1';
          insert Obj;

system.debug('Test SO area '+Obj.Service_Offering_Ref__r.id);   ----------------> But still this is null :(

In my controller class i've a code like

   String SOID=Obj.ST_Ref__r.id; and i do pass this SOID to a query

Currently query doesn't give any result , because SOID is null
But i've assigned 
Obj.ST_Ref__c='a2Ne0000000JAUo';

Whats wrong with this??

Please help me, Thanks a lot

Hi all,

I've a custom controller and it has a code like this
I need to write a test class for this controller class but i'm stuck, please help me


public class myController{

...variables...

public myController(ApexPages.StandardController stdController) {

this.VR= (Vendor_Registration__c)stdController.getRecord();
this.section=getSection();

}

/*get section */

public String getSection(){

myObjectVR VRObj=My_CommonClass.getCurrentData(VR.id); --> which gives an error coz i don't know how to send a VR.id to My_CommonClass.getCurrentData method..


}
Hi all,

i've a compoent and i've used that like this

<c:Country_Only_Component countryLabel="Country of Incorporation" Country="{!Vendor_Registration__c.Country_of_Incorporation__c}" EditMode="true" CountryLabelStyle="color: #4a4a56;font-weight:bold;font-size:11px;margin-left:3%;margin-right:1%" StateLabelStyle="color: #4a4a56;font-weight:bold;font-size:11px;margin-right:20px;margin-left:280px;" CountryCMBStyle="width:152px;" StatesCMBStyle="width:152px;" ></c:Country_Only_Component>

Issue is it looks fine for 1366*768 but for big monitors it doesn't look fine.. Has some allignment issues.

Please, can anyone give me some tips?

I used margin-left : 10% (with percentage too) , but doesn't work for me
Hi All

I've VF page, where we can keep adding PCs records. There is a add another button where we can add another pc, I need to check whether user has fill all required data for previous PC record , before user goes for adding new PC.

What i've done is i've a VF page as below

<apex:variable value="1" var="num"/>
       <apex:repeat value="{!PC_List}" var="pcs" id="thePCList">
       <apex:pageBlockSection id="pcPageBlockSection" title="PC {!num}" columns="1" collapsible="false">
        <apex:variable var="num" value="{!VALUE(num) + 1}"/>
        <apex:inputField value="{!pcs.CPU__c}"/>
        
   
     </apex:pageBlockSection>
    </apex:repeat>

<apex:commandButton reRender="pageBlock1" styleClass="styled-button1" action="{!AddRow}" value="Add Another PC" "/>

Controller class AddRow function as below

public void AddRow()
        {
     
         integer previousPC=PC_List.size()-1;
      
        V_PC__c newPC=new V_PC__c();
 
     
        boolean isErrors=false;
        if(V_cpu__c==''){ // Even i made this always true
      
           ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please enter signatory telephone '));
           isErrors=true;
      
        }
      
        if(!isErrors)
        PC_List.add(newPC);
     
     
     
       }

I render pageBlock1 when addRow is clicked
i FEEL code is ok, but i don't get any error message


Thank a lott
hi all,

I have a check box and below that check bow i've a pageblock section with several input fields..  I need to make those input fields as required fields if i check the above mentioned check box..

How can i do that??

Thanks a lot 
Really appreicaite you responds..
Hi all .

I've used <apex:repeat> and following structure is iterated :
Please provide the the model of printer field and Please specify field

In below image when i select Other for 'Please provide the model of printer' only i should display please specific Text box.
But  since this block created dynamically i can not use javascript. How can i handle this situation??

note that i've used  pageblocksection between please specific Text box.


This image is not available because: You don’t have the privileges to see it, or it has been removed from the system


Please help me.


Hi All 

I have a list of Tasks which created in a apex class;
Task task1=new Task();
task1.subject;..
...

Task task2=new Task();
task2.subject....
....

etc

myTasklist.add(task1);
myTasklist.add(task2);
......
......

And finally i need to insert all the tasks ( List) ??

How can i do that????

Thanks a lot everyone...
 
Hi All,

I have already created 2 text fields in my custom object. 
I need to bind those two text fields to my visualforce and behave as country , state dependency.
[I've a different object for country and its state also]

I found this example which binds country and state to a property
https://developer.salesforce.com/forums/?id=906F0000000Ar9DIAS

But i need to bind to my two text fields. 

Can someone help me on this..

Thank you very much
 
Hi all,

I've a VF page and its controller, 
I've used page action as below 
<apex:page action="{!validateUser}" 


in my controller i've a method like this

public pageReference validateUser(){

if(someconditionTrue)

        PageReference errorPage = new PageReference('apex/ErrorPage');
        errorPage.setRedirect(true);
        return errorPage;


}

else{


//I need to stay in this page.


}


I'm not sure sure how to code for stay in this page, because this page is always recursively called. 
Hi, I've a trigger and a service class.
I need to check for a condition in service class and if that matches i need to terminate that event(terminate), not that just function but whole process

How can i do that?

Trigger--> Service Class Function 



Thanks
 
Hi All,

I've senario like this. 
Have some series of winzard type service classes 
Once page one submitted it goes to a page two, page two submitted then it goes to page 3. like wise it goes until wizard ends. 
each page has submitNext (under that save())  and submitBack (Under that SaveBack()) to go to the Next page and Back page. 

each save and saveback functions call a common class method to access database and consume 5-6 queries. 

Is it possible me write a one test class and cover the test coverage of all the controllers, without exceeding SQL 101 limitation. 


Please help me 
Best regards. 


 
Hi all,

I need to check the record type we selected when we create the case. As an example please check below screenshot. 
i need to capture which record type user has created (i need to capture that in Triger.Insert
User-added image

Thanks alot
Hi i need to compare new status and previous status in Task. I've a VF page and its controller.
How can i compare new(after user changed) and old staus(before user change) in apex controller class. Its pretty easy in Triggers, but when it comes to the controller class?

Thanks all my friends.. 
Hi all,

I've a Trigger and in that Trigger i've used addError method.
Everything is fine except i get two error statements like below, All i need is first line, i don't need second one..
Any suggestions?Please fill in Welcome Kit/ E-ID mailing address information
GT_taskCreation: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a2nf000000075GmAAI; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Please fill in Welcome Kit/ E-ID mailing address information: [] Trigger.GT_taskCreation: line 464, column 1 Trigger.GT_taskCreation: line 128, column 1
Thank you very much

User-added image
 Hi all ,

I'm writing a test class for a controller, And test class is like this.. 
Please note that hard coding values isn't good at all, but i'll change it later, this is just for the time being..

    myType__c  Obj= new myType__c();
          Obj.Name='Test  Object';
          Obj.ST_Ref__c='a2Ne0000000JAUo';
          Obj.A_Ref__c='001e000000HPgd1';
          insert Obj;

system.debug('Test SO area '+Obj.Service_Offering_Ref__r.id);   ----------------> But still this is null :(

In my controller class i've a code like

   String SOID=Obj.ST_Ref__r.id; and i do pass this SOID to a query

Currently query doesn't give any result , because SOID is null
But i've assigned 
Obj.ST_Ref__c='a2Ne0000000JAUo';

Whats wrong with this??

Please help me, Thanks a lot

Hi all,

I've a custom controller and it has a code like this
I need to write a test class for this controller class but i'm stuck, please help me


public class myController{

...variables...

public myController(ApexPages.StandardController stdController) {

this.VR= (Vendor_Registration__c)stdController.getRecord();
this.section=getSection();

}

/*get section */

public String getSection(){

myObjectVR VRObj=My_CommonClass.getCurrentData(VR.id); --> which gives an error coz i don't know how to send a VR.id to My_CommonClass.getCurrentData method..


}
Hi All

I've VF page, where we can keep adding PCs records. There is a add another button where we can add another pc, I need to check whether user has fill all required data for previous PC record , before user goes for adding new PC.

What i've done is i've a VF page as below

<apex:variable value="1" var="num"/>
       <apex:repeat value="{!PC_List}" var="pcs" id="thePCList">
       <apex:pageBlockSection id="pcPageBlockSection" title="PC {!num}" columns="1" collapsible="false">
        <apex:variable var="num" value="{!VALUE(num) + 1}"/>
        <apex:inputField value="{!pcs.CPU__c}"/>
        
   
     </apex:pageBlockSection>
    </apex:repeat>

<apex:commandButton reRender="pageBlock1" styleClass="styled-button1" action="{!AddRow}" value="Add Another PC" "/>

Controller class AddRow function as below

public void AddRow()
        {
     
         integer previousPC=PC_List.size()-1;
      
        V_PC__c newPC=new V_PC__c();
 
     
        boolean isErrors=false;
        if(V_cpu__c==''){ // Even i made this always true
      
           ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please enter signatory telephone '));
           isErrors=true;
      
        }
      
        if(!isErrors)
        PC_List.add(newPC);
     
     
     
       }

I render pageBlock1 when addRow is clicked
i FEEL code is ok, but i don't get any error message


Thank a lott
Hi all .

I've used <apex:repeat> and following structure is iterated :
Please provide the the model of printer field and Please specify field

In below image when i select Other for 'Please provide the model of printer' only i should display please specific Text box.
But  since this block created dynamically i can not use javascript. How can i handle this situation??

note that i've used  pageblocksection between please specific Text box.


This image is not available because: You don’t have the privileges to see it, or it has been removed from the system


Please help me.