• DevSF
  • NEWBIE
  • 15 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 5
    Likes Received
  • 0
    Likes Given
  • 57
    Questions
  • 40
    Replies
Hi friends,

My requirement is to redirect my page to a visualforce page when i select a particular record type. and it should autopopulate some fields from its parent object.


Tried using below code and i have overridden the standard new button, but it is redirecting to same visualforce page for all record types, even i have specified the record typeId in my controller.
My requirement is to redirect it to visualforce page for 1 record type && for others it should stick with standard layout.

Below is the code, Please update if anything wrong.

VF PAGE:


<apex:page standardcontroller="Contact" extensions="Redirect"  action="{!getredir}">>
</apex:page>



CONTROLLER:

public class Redirect {

    public Redirect(ApexPages.StandardController controller) {
   //this.c = (Contact)myController.getRecord();

    }
public PageReference getRedir() {

     PageReference newPage;

        if (ApexPages.currentPage().getParameters().get('RecordType') == '012280000015D4W') {
            newPage = Page.Contact_New;
            return newPage.setRedirect(true);
        } else {
            return null;
        }

    }

    private final ApexPages.StandardController controller;
}


Thanks,
Dev.
 
  • December 04, 2016
  • Like
  • 0
Hi friends,

My requirement is to redirect my page to a visualforce page when i select a particular record type. and it should autopopulate some fields from its parent object.

Example: My visualforce page is on Contact object and after i choose a record type it should redirect to a new visualforce page with address fields on contact object auto populated from Account object.

I have tried working on this with the help of some Blog's.. But it didn't worked the way i want.

So can anyone suggest the exact way to get this requirement done (Or) any sample code would be really helpful/ appriciated.


Thanks,
​Dev.
  • December 03, 2016
  • Like
  • 0
Hi friends,

My requirement is to redirect my page to a visualforce page when i select a particular record type. and it should autopopulate some fields from its parent object.

Example: My visualforce page is on Contact object and after i choose a record type it should redirect to a new visualforce page with address fields on contact object auto populated from Account object.

I have tried working on this with the help of some Blog's.. But it didn't worked the way i want.

So can anyone suggest the exact way to get this requirement done (Or) any sample code would be really helpful/ appriciated.


Thanks,
Dev.
  • December 03, 2016
  • Like
  • 0
Hi Friends,

I am writing a trigger on order object which updates a checkbox field on order based on the serial number.
I need to query all the orders related to an account and if the inserted order's serial number is the highest, then i have to update a checkbox__c on the order. If the latest order's serial number is lower than the existing one then it should be null.

This trigger should be fired while inserting or updating  an order.


This is my code. Please do make any changes and help me out.


trigger Updatelatestorder on Order (before insert,before update) {
    List<Order> orderlist = new List<Order>();
    List<Account> acclist = new List<Account>();
    set<Id> accountid = new Set<Id>();
    //orderlist = [select id, Status, checkbox_c, Accountid from Order Order by Serial_Number_c ASC];
    for(Order o : trigger.new){
      if(o.AccountId!= null){
             accountid.add(o.AccountId);
            }    
    }
 orderlist = [select id, Status, checkbox_c, Accountid from Order where Accountid In: accountid Order by Serial_Number_c ASC limit 1];
            for(Order oo :trigger.new){
                if(oo.Serial_Number_c!= null){
                    oo.checkbox_c = true;
                    orderlist.add(oo);
             }    
                if(orderlist.size()> 0){
                update orderlist;
            }
                }     




​Any Help would be appriciated....!
  • October 04, 2016
  • Like
  • 0
Hi Friends,

I am writing a trigger on order object which updates a checkbox field on order based on the serial number.
I need to query all the orders related to an account and if the inserted order's serial number is the highest, then i have to update a checkbox__c on the order. If the latest order's serial number is lower than the existing one then it should be null.

This trigger should be fired while inserting or updating  an order.


This is my code. Please do make any changes and help me out.


trigger Updatelatestorder on Order (before insert,before update) {
    List<Order> orderlist = new List<Order>();
    List<Account> acclist = new List<Account>();
    set<Id> accountid = new Set<Id>();
    //orderlist = [select id, Status, checkbox_c, Accountid from Order Order by Serial_Number_c ASC];
    for(Order o : trigger.new){
      if(o.AccountId!= null){
             accountid.add(o.AccountId);
            }    
    }
 orderlist = [select id, Status, checkbox_c, Accountid from Order where Accountid In: accountid Order by Serial_Number_c ASC limit 1];
            for(Order oo :trigger.new){
                if(oo.Serial_Number_c!= null){
                    oo.checkbox_c = true;
                    orderlist.add(oo);
             }    
                if(orderlist.size()> 0){
                update orderlist;
            }
                }     




Any Help would be appriciated....!
  • October 04, 2016
  • Like
  • 0
Hi Friends,

I am Updating a  record using Visualforce page. When I enter all the data into  visualforce page, Here i need to perform 2 actions.

1) Save the record
2) Open a link


I tried it using page reference(), but struck at some point.


<apex:commandButton value="Save" action="{!Save}" /> 


Controller ::

public class rerender {
        public Account acc {get;set;}
    public rerender(ApexPages.StandardController controller) {
 
    }
    public PageReference save(){
       
        PageReference reRend = new PageReference('/apex/ThankYou');
        reRend.setRedirect(false);
        return reRend; 
    }

}


In this, i was unable to save the record, but was able to open the link.


How to achieve this...!
 
  • June 02, 2016
  • Like
  • 0
Hello everyone,

I have 1 custom object (Dimensions__c) which has a lookup relationship with Account standard object (Dimensions__c is Child).

There is a chechbox on Dimension__c (Repayment_Enabled__c).

Now wehenever i create a dimension this check box is made true automatically.

What my need is that, there should be only one check box true on for a record related to account.
Even though there may be 5 dimension records which are related to 1 account but checkbox should be true for only 1 dimension record. 

I have tried this one, But struck.
As i am new to development Please help me.


trigger paymentcheck on Account (before insert,before update,after insert) {
List<Account> acct = new List<Account>();
    List<Dimensions__c> vwo = new List<Dimensions__c>();   // my custom object
    for(Account a : trigger.new){
       if(Repayment_Enabled__c[0] == 'true'){   // this is the check box field which needs to be true for only one record related account
            Repayment_Enabled__c[1] = false;
        }
            }

}
How to solve this one.
 
  • June 01, 2016
  • Like
  • 0
Hi Friends,

My scenario is :

When a product is added to opportunity, then in activity field history Product & User details should be displayed (User who added the product).
User who have added the product should be shown in the activity field history.

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

How can we achieve this....?

Regards,
Devender
  • May 16, 2016
  • Like
  • 0
Hi Friends,

My scenario is :

When a product is added to opportunity, then in activity field history Product & User details should be displayed (User who added the product).
User who have added the product should be shown in the activity field history.

User-added image

How can we achieve this....?

Regards, 
Devender (Dev)
  • May 16, 2016
  • Like
  • 0
Hi friends,

My Scenario is  :

When a user submitts a record for approval. The the owner of the record should be changed.

It means that "AB" is the  current record owner and he submits for approval for "CD". Then the Owner field on the record should be
changed to "CD".

I need the record owner fields to updated by the approver who approves the record.

I tried using workflow field update which changes the owner name. But i need to specify the user in field update.
If it is assigned to approval for a different user then how to update then....?

Attached is the screenshot of field update.



User-added image



How can i achieve this friends.

Will i need to code or can this be achieved using standard functionalities

Any help friends..!

 
  • May 11, 2016
  • Like
  • 0
Hi friends,

My Scenario is  :

When a user submitts a record for approval. The the owner of the record should be changed.

It means that "AB" is the  current record owner and he submits for approval for "CD". Then the Owner field on the record should be
changed to "CD".

I need the record owner fields to updated by the approver who approves the record.

I tried using workflow field update which changes the owner name. But i need to specify the user in field update.
If it is assigned to approval for a different user then how to update then....?

Attached is the screenshot of field update.

WorkFlow Field Update ScreenShot




How can i achieve this friends.

Will i need to code or can this be achieved using standard functionalities

Any help friends..!
  • May 11, 2016
  • Like
  • 0
Hi friends, 

How to make comments in approval process mandatory. Because i need the reason for record Approve / Reject.

Is there any standard functionality to achieve this....?


Thanks 
Dev
  • May 10, 2016
  • Like
  • 0
Hi friends,

My Scenario is :

When a user submitts a record for approval. The the owner of the record should be changed.

It means that "AB" is the  current record owner and he submits for approval for "CD". Then the Owner field on the record should be
changed to "CD".

I need the Owner Field to be updated aautomatically with the user to whom the record was assigned for approval.

How can i achieve this friends.

Will i need to code or can this be achieved using standard functionalities

Any help friends..!
  • May 10, 2016
  • Like
  • 0
Hi friends,

My Scenario is  :

When a user submitts a record for approval. The the owner of the record should be changed.

It means that "AB" is the  current record owner and he submits for approval for "CD". Then the Owner field on the record should be
changed to "CD".

I need the record owner fields to updated by the approver who approves the record.


How can i achieve this friends.

Will i need to code or can this be achieved using standard functionalities

Any help friends..!
  • May 10, 2016
  • Like
  • 0
Hi Friends,

My scenario is When the owner of the record is changed.
Then for the new owner, there are some mandatory fields that the user has to be filled before saving the record.

How do i make the fields required only before saving the records.

How could i achieve this.....?
  • May 09, 2016
  • Like
  • 0
Hi friends,

My Scenario is :

When a user submitts a record for approval. The the owner of the record should be changed.

It means that "AB" is the  current record owner and he submits for approval for "CD". Then the Owner field on the record should be
changed to "CD".


How can i achieve this friends.

Will i need to code or can this be achieved using standard functionalities

Any help friends..!
  • May 09, 2016
  • Like
  • 0
Hi friends,

My Scenario is :

When a user submitts a record for approval. The the owner of the record should be changed.

It means that "AB" is the  current record owner and he submits for approval for "CD". Then the Owner field on the record should be
changed to "CD".


How can i achieve this.!
Will i need to code or can this be achieved using standard functionalities

Any help friends..!
  • May 09, 2016
  • Like
  • 0
Hi friends,

My scenario i to send the Account record URL, when the user clicks on submit for approval button.
Then the Approver should be notified along with the record (Account) URL.

How can we achieve this....!
 
  • May 05, 2016
  • Like
  • 0
Hi all,

My scenario is to change the record owner when the record is submitted for approval.

The new owner should be the approver to whom the record is assigned to approve.
Is it possible to achieve this.
How do i achieve this....!
  • May 05, 2016
  • Like
  • 0
I am creating an invoice PDF.
I have two custom objects 
1)  Invoice__c
2) Invoice_Product__c

These 2 objects have master detail relationship between them.
Now in my PDF i am adding multiple products to invoice, It is displaying 2 products in different tables. As shown.
User-added image


I need these 2 products should be displayed in one table.
This is my code (Table).
Kindly make any changes which displays 2 products in one table.

This is my Code:

<table cellpadding="2" cellspacing="0" style="width:100%;">
                    <tr style="font-size:16px;height:32px;Font-family:Verdana,Arial;" >  

                        <td style="width:7%;background-color:#707070;border-left:1px solid;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Quantity</td>
                        <td style="width:15%;background-color:#707070;border-left:1px solid;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Item</td>                        
                        <td style="width:27%;background-color:#707070;border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Description</td> 
                        <td style="width:12%;background-color:#707070;border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Unit Price</td>
                        <td style="width:12%;;background-color:#707070;border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Total</td>   

                    </tr> 
                    <apex:repeat value="{!Invoice__c.Invoice_Products__r}" var="inv" id="theRepeat">
                    <apex:repeat value="{!Invoice__c}" var="iv" id="theRepeat">
                
                    <tr style="font-size:16px;height:300px;vertical-align:text-top;Font-family:Verdana,Arial;"> 
                        <td style="border-left:1px solid;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="{!inv.Quantity__c}"/></td>
                        <td style="border-left:1px solid;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="{!inv.Name}"/></td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="{!inv.VWO_Product_Code__c}" /></td>           
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="${!inv.Unit_Price__c}" rendered="{!IF(inv.Unit_Price__c==NUll || inv.Unit_Price__c==0,false,true)}"/></td>
                        <td style="border-left:0.1px solid;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="${!inv.Line_Item_Total__c}" rendered="{!IF(inv.Line_Item_Total__c==NUll || inv.Line_Item_Total__c==0,false,true)}"/></td> 
                    </tr> 
                        
                    <tr style="font-size:16px;height:18px;Font-family:Verdana,Arial;">
                        <td style="border-left:none;border-top:1px solid;border-right:none;border-bottom:none"></td>                        
                        <td style="border-left:none;border-top:1px solid;border-right:none;border-bottom:none"> </td> 
                        <td style="border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:none"> </td>           
                        <td style="border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:right;" >Subtotal</td> 
                        <td style="border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;"><apex:outputText value="${!iv.Subtotal_Amount__c}" rendered="{!IF(iv.Subtotal_Amount__c==NUll || iv.Subtotal_Amount__c==0,false,true)}"/></td> 
                    </tr>
                
                    <tr style="font-size:14px;height:14px;Font-family:Verdana,Arial;">
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"></td>                         
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"> </td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none"></td>             
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:right;"><b>Total Amount</b></td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:center;"><apex:outputText value="${!iv.Total_Amount__c}" rendered="{!IF(iv.Total_Amount__c==NUll || iv.Total_Amount__c==0,false,true)}"/></td> 
                    </tr>  
                    </apex:repeat> 
                   </apex:repeat>
                </table>

Any help would be appriciated..!

Thanks.
                
             
  • May 04, 2016
  • Like
  • 0

when a Product is added to Opportunity, Check for previous Orders related to Opportunity account and
and if no orders exists then update a picklist field on Opportunity as (New).

if any Orders exists then check for the latest orders price and compare it with our new product price that we are adding.

if it is greater than new product's price then update  picklist on opportunity as Loss
if less then update as WOn.

I have Written a trigger to achieve this and was stuck at this point. Needed help to proceed further..!



trigger triggeronopportunity on Opportunity (before insert,before update) {
    List<opportunity> oppo = new List<opportunity>();
    List<Account> acc = new List<Account>();
    List<OpportunityLineItem> oppl = new List<OpportunityLineItem>();
    List<PricebookEntry> pb = new List<PricebookEntry>();
   Set<ID> OppIds = new Set<ID>();
    Set<ID> accIds = new Set<ID>();
    for(Opportunity opp : trigger.new){
        if(oppl.size() == 0){
            opp.Revenue_Type__c = 'New ';
            }
        for(Account a : [Select Id, Order_Product__c FROM Account Where Id in :OppIds ]){
            
========== Struck Here ==============
       
        }   
    }
}



 
  • April 12, 2016
  • Like
  • 1
Hi friends, My Task is to write a Trigger

when a Product is added to Opportunity, Check for previous Orders related to Opportunity account and
and if no orders exists then update a picklist field on Opportunity as (New).

if any Orders exists then check for the latest orders price and compare it with our new product price that we are adding.

if it is greater than new product's price then update  picklist on opportunity as Loss
if less then update as WOn.

I have Written a trigger to achieve this and was stuck at this point. Needed help to proceed further..!


trigger triggeronopportunity on Opportunity (before insert,before update) {
    List<opportunity> oppo = new List<opportunity>();
    List<Account> acc = new List<Account>();
    List<OpportunityLineItem> oppl = new List<OpportunityLineItem>();
   Set<ID> OppIds = new Set<ID>();
    Set<ID> accIds = new Set<ID>();
    for(Opportunity opp : trigger.new){
        if(oppl.size() == 0){
            opp.Revenue_Type__c = 'New';
            }
   for(Order o : [SELECT Id FROM Order WHERE id in :accIds]){
         //======== Strucked Here =============
        }   
    }
    
}

How to Proceed further....! (Or) any other way to do this...!
  • April 11, 2016
  • Like
  • 1
Hi,

We are integrating salesforce with external website which runs on PHP Script.
The developer at the external end will push the data into salesforce and he uses sesssion ID for this scenario.

My question is that how do use that data in salesforce,  will i be able to use it directly or do i need to write a rest webservice.
How do i proceed...!

Any Help will be appriciated..!
  • March 31, 2016
  • Like
  • 1
Hi,

My task is to integrate salesforce with externl website using REST. & they have given me JSON Response code for fields in external website.

I am able to hit the External system URL. I was Struct here...!  and how we can get data from external website & how to code for that...?
Like whenever a user enter their account details in external website, those data should also get into salesforce accounts.

How we can achieve this...?
can anyone help for this scenario...!

 
  • March 22, 2016
  • Like
  • 2
Hi friends,

My requirement is to redirect my page to a visualforce page when i select a particular record type. and it should autopopulate some fields from its parent object.

Example: My visualforce page is on Contact object and after i choose a record type it should redirect to a new visualforce page with address fields on contact object auto populated from Account object.

I have tried working on this with the help of some Blog's.. But it didn't worked the way i want.

So can anyone suggest the exact way to get this requirement done (Or) any sample code would be really helpful/ appriciated.


Thanks,
Dev.
  • December 03, 2016
  • Like
  • 0
Hi Friends,

I am writing a trigger on order object which updates a checkbox field on order based on the serial number.
I need to query all the orders related to an account and if the inserted order's serial number is the highest, then i have to update a checkbox__c on the order. If the latest order's serial number is lower than the existing one then it should be null.

This trigger should be fired while inserting or updating  an order.


This is my code. Please do make any changes and help me out.


trigger Updatelatestorder on Order (before insert,before update) {
    List<Order> orderlist = new List<Order>();
    List<Account> acclist = new List<Account>();
    set<Id> accountid = new Set<Id>();
    //orderlist = [select id, Status, checkbox_c, Accountid from Order Order by Serial_Number_c ASC];
    for(Order o : trigger.new){
      if(o.AccountId!= null){
             accountid.add(o.AccountId);
            }    
    }
 orderlist = [select id, Status, checkbox_c, Accountid from Order where Accountid In: accountid Order by Serial_Number_c ASC limit 1];
            for(Order oo :trigger.new){
                if(oo.Serial_Number_c!= null){
                    oo.checkbox_c = true;
                    orderlist.add(oo);
             }    
                if(orderlist.size()> 0){
                update orderlist;
            }
                }     




Any Help would be appriciated....!
  • October 04, 2016
  • Like
  • 0
Hello everyone,

I have 1 custom object (Dimensions__c) which has a lookup relationship with Account standard object (Dimensions__c is Child).

There is a chechbox on Dimension__c (Repayment_Enabled__c).

Now wehenever i create a dimension this check box is made true automatically.

What my need is that, there should be only one check box true on for a record related to account.
Even though there may be 5 dimension records which are related to 1 account but checkbox should be true for only 1 dimension record. 

I have tried this one, But struck.
As i am new to development Please help me.


trigger paymentcheck on Account (before insert,before update,after insert) {
List<Account> acct = new List<Account>();
    List<Dimensions__c> vwo = new List<Dimensions__c>();   // my custom object
    for(Account a : trigger.new){
       if(Repayment_Enabled__c[0] == 'true'){   // this is the check box field which needs to be true for only one record related account
            Repayment_Enabled__c[1] = false;
        }
            }

}
How to solve this one.
 
  • June 01, 2016
  • Like
  • 0
Hi friends,

My Scenario is  :

When a user submitts a record for approval. The the owner of the record should be changed.

It means that "AB" is the  current record owner and he submits for approval for "CD". Then the Owner field on the record should be
changed to "CD".

I need the record owner fields to updated by the approver who approves the record.

I tried using workflow field update which changes the owner name. But i need to specify the user in field update.
If it is assigned to approval for a different user then how to update then....?

Attached is the screenshot of field update.



User-added image



How can i achieve this friends.

Will i need to code or can this be achieved using standard functionalities

Any help friends..!

 
  • May 11, 2016
  • Like
  • 0
Hi friends,

My Scenario is :

When a user submitts a record for approval. The the owner of the record should be changed.

It means that "AB" is the  current record owner and he submits for approval for "CD". Then the Owner field on the record should be
changed to "CD".

I need the Owner Field to be updated aautomatically with the user to whom the record was assigned for approval.

How can i achieve this friends.

Will i need to code or can this be achieved using standard functionalities

Any help friends..!
  • May 10, 2016
  • Like
  • 0
Hi friends,

My Scenario is :

When a user submitts a record for approval. The the owner of the record should be changed.

It means that "AB" is the  current record owner and he submits for approval for "CD". Then the Owner field on the record should be
changed to "CD".


How can i achieve this friends.

Will i need to code or can this be achieved using standard functionalities

Any help friends..!
  • May 09, 2016
  • Like
  • 0
I am creating an invoice PDF.
I have two custom objects 
1)  Invoice__c
2) Invoice_Product__c

These 2 objects have master detail relationship between them.
Now in my PDF i am adding multiple products to invoice, It is displaying 2 products in different tables. As shown.
User-added image


I need these 2 products should be displayed in one table.
This is my code (Table).
Kindly make any changes which displays 2 products in one table.

This is my Code:

<table cellpadding="2" cellspacing="0" style="width:100%;">
                    <tr style="font-size:16px;height:32px;Font-family:Verdana,Arial;" >  

                        <td style="width:7%;background-color:#707070;border-left:1px solid;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Quantity</td>
                        <td style="width:15%;background-color:#707070;border-left:1px solid;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Item</td>                        
                        <td style="width:27%;background-color:#707070;border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Description</td> 
                        <td style="width:12%;background-color:#707070;border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Unit Price</td>
                        <td style="width:12%;;background-color:#707070;border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Total</td>   

                    </tr> 
                    <apex:repeat value="{!Invoice__c.Invoice_Products__r}" var="inv" id="theRepeat">
                    <apex:repeat value="{!Invoice__c}" var="iv" id="theRepeat">
                
                    <tr style="font-size:16px;height:300px;vertical-align:text-top;Font-family:Verdana,Arial;"> 
                        <td style="border-left:1px solid;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="{!inv.Quantity__c}"/></td>
                        <td style="border-left:1px solid;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="{!inv.Name}"/></td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="{!inv.VWO_Product_Code__c}" /></td>           
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="${!inv.Unit_Price__c}" rendered="{!IF(inv.Unit_Price__c==NUll || inv.Unit_Price__c==0,false,true)}"/></td>
                        <td style="border-left:0.1px solid;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="${!inv.Line_Item_Total__c}" rendered="{!IF(inv.Line_Item_Total__c==NUll || inv.Line_Item_Total__c==0,false,true)}"/></td> 
                    </tr> 
                        
                    <tr style="font-size:16px;height:18px;Font-family:Verdana,Arial;">
                        <td style="border-left:none;border-top:1px solid;border-right:none;border-bottom:none"></td>                        
                        <td style="border-left:none;border-top:1px solid;border-right:none;border-bottom:none"> </td> 
                        <td style="border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:none"> </td>           
                        <td style="border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:right;" >Subtotal</td> 
                        <td style="border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;"><apex:outputText value="${!iv.Subtotal_Amount__c}" rendered="{!IF(iv.Subtotal_Amount__c==NUll || iv.Subtotal_Amount__c==0,false,true)}"/></td> 
                    </tr>
                
                    <tr style="font-size:14px;height:14px;Font-family:Verdana,Arial;">
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"></td>                         
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"> </td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none"></td>             
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:right;"><b>Total Amount</b></td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:center;"><apex:outputText value="${!iv.Total_Amount__c}" rendered="{!IF(iv.Total_Amount__c==NUll || iv.Total_Amount__c==0,false,true)}"/></td> 
                    </tr>  
                    </apex:repeat> 
                   </apex:repeat>
                </table>

Any help would be appriciated..!

Thanks.
                
             
  • May 04, 2016
  • Like
  • 0
Hi 
I am creating a pdf of Invoice Page. Now I want to hide some fields on table on pdf depending on picklist value (Rating__c).

I have created a table which denotes the Quantity,Name,Price,Total On the PDF Page.
This is My Table. :


 <table cellpadding="2" cellspacing="0" style="width:100%;">
                    <tr style="font-size:16px;height:32px;Font-family:Verdana,Arial;" >  

                        <td style="width:7%;background-color:#707070;border-left:1px solid;border-top:1px solid;border-right:none;border-bottom:1px solid;text-align:center;">Quantity</td>
                        <td style="width:15%;background-color:#707070;border-left:1px solid;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Item</td>                        
                        <td style="width:27%;background-color:#707070;border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Description</td> 
                        <td style="width:12%;background-color:#707070;border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Unit Price</td>
                        <td style="width:12%;;background-color:#707070;border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;">Total</td>   

                    </tr> 
                    <apex:repeat value="{!retriveInvoiceInfo}" var="inv" id="theRepeat"> 
                
                    <tr style="font-size:16px;height:300px;vertical-align:text-top;Font-family:Verdana,Arial;"> 
                        <td style="border-left:1px solid;border-top:none;border-right:none;border-bottom:none;text-align:center;"><apex:outputText value="{!invoiceData.Quantity__c}"/></td>
                        <td style="border-left:1px solid;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="${!unitprice}" rendered="{!IF(unitprice==NUll || unitprice==0,false,true)}"/></td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="{!inv.Product_Name_del__c}"/></td>           
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="{!orderDiscount}" /></td> 
                        <td style="border-left:0.1px solid;border-top:none;border-right:1px solid;border-bottom:none;text-align:center;"><apex:outputText value="${!inv.Total_Amount_In_INR__c}" rendered="{!IF(inv.Total_Amount_In_INR__c==NUll || inv.Total_Amount_In_INR__c==0,false,true)}"/></td> 
                    </tr> 
                        
                    <tr style="font-size:16px;height:18px;Font-family:Verdana,Arial;">
                        <td style="border-left:none;border-top:1px solid;border-right:none;border-bottom:none"></td>                        
                        <td style="border-left:none;border-top:1px solid;border-right:none;border-bottom:none"> </td> 
                        <td style="border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:none"> </td>           
                        <td style="border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:right;" >Subtotal</td> 
                        <td style="border-left:none;border-top:1px solid;border-right:1px solid;border-bottom:1px solid;text-align:center;"><apex:outputText value="${!inv.Subtotal_in_INR__c}" rendered="{!IF(inv.Subtotal_in_INR__c==NUll || inv.Subtotal_in_INR__c==0,false,true)}"/></td> 
                    </tr>
                   
                   <tr style="font-size:14px;height:14px;Font-family:Verdana,Arial;">
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"></td>                         
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"></td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none"></td>             
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:right;">ServiceTax </td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:center;"><apex:outputText value="${!inv.Indian_Service_Tax_Amount__c}" rendered="{!IF(inv.Currency__c=='INR' || inv.Indian_Service_Tax_Amount__c==0,false,true)}"/></td> 
                    
                    </tr>
                        
                        <tr style="font-size:14px;height:14px;Font-family:Verdana,Arial;">
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"></td>                         
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"></td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none"></td>             
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:right;">Excise tax</td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:center;"><apex:outputText value="${!inv.Swachh_Bharat_Cess__c}" rendered="{!IF(inv.Swachh_Bharat_Cess__c==NUll || inv.Swachh_Bharat_Cess__c==0,false,true)}"/></td> 
                    </tr>
                        
                    <tr style="font-size:14px;height:14px;Font-family:Verdana,Arial;">
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"></td>                         
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"> </td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none"></td>             
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:right;"><b>Total Amount</b></td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:center;"><apex:outputText value="${!inv.Total_Amount_In_INR__c}" rendered="{!IF(inv.Total_Amount_In_USD__c==NUll || inv.Total_Amount_In_USD__c==0,false,true)}"/></td> 
                    </tr>
                        
                    <tr style="font-size:14px;height:14px;Font-family:Verdana,Arial;">
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"></td>                         
                        <td style="border-left:none;border-top:none;border-right:none;border-bottom:none"> </td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:none"></td>             
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:right;"><b>Paid</b></td> 
                        <td style="border-left:none;border-top:none;border-right:1px solid;border-bottom:1px solid;text-align:center;"><apex:outputText value="${!inv.Total_Amount_In_INR__c}" rendered="{!IF(inv.Total_Amount_In_USD__c==NUll || inv.Total_Amount_In_USD__c==0,false,true)}"/></td> 
                    </tr>
                    
                    </apex:repeat> 
                   
                </table>
                
             
        </td>


In the above code i have highlighted the two fields that i want to hide when picklist value is changed.

How to achieve this...?

Can anyone help me out of this....!
  • May 03, 2016
  • Like
  • 0
Hi all,

My task is to make a callout to a website which returns rank of the website. I am using Http Get method.

So I need to make a callout when a lead is created in salesforce and use the website field which the user enters while creating a lead.
we make callout using this website.

 It is working if I enter the website name manually and check for rank. But how to do this when a lead is created, and use that website field in callout.

How to achieve this.!
 
  • April 28, 2016
  • Like
  • 0
Hello Everyone,

 I Have a scenario :

I am creating a visualforce page on Invoice custom object, and a custom button which generates the PDF of the detail page.
and I have a Picklist field called Currency of values (USD,RIAL).

Now there is a change in taxes for these two currencies. and Tax will be calculated on the detail  page itself.

So, My task is when the picklist field is changed to USD then the tax fields related to USD should be displayed on the VF page.
and the same with the RIAL when picklist is changed to RIAL then the taxes related to RIAL should be displayed on the VF page.
and  There should be only one button on the detail page to achieve this.

Do anyone has an Idea how to achieve this scenario.

Any help would be appreciated....!
  • April 27, 2016
  • Like
  • 0