• andrywang
  • NEWBIE
  • 0 Points
  • Member since 2009

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

Hello

 

can anyone please throw some ideas on how to solve the below issue.... many thanks in advance.

 

Right now I want to add custom field into the list price.

 

Existed field on list price: product, pricebook, list price, and active field.

  

I want to add a custom field called "description".

This field will be filled when the user filling the price value, so "description" of a product will be different on each price. 

 

 

Hello

 

can anyone please throw some ideas..on how to solve the below issue ....many thanks in advance


Right now I have problems in writing test case when I want to deploy this class to the production. could you help me with writing the test case or example for the test case for the class below.

  

public class UpdateItemQuoteCurrency {

 

    // Constructor - this only really matters if the autoRun function doesn't work right

    private final Quotation__c q;

    public UpdateItemQuoteCurrency(ApexPages.StandardController stdController) {

        this.q = (Quotation__c)stdController.getRecord();

    }

   

    // Code we will invoke on page load.

    public PageReference autoRun() {

 

        String theId = ApexPages.currentPage().getParameters().get('id');

 

                Quotation__c Quote = [select CurrencyIsoCode from Quotation__c where Id= :theId];

 

        if (theId == null) {

            // Display the Visualforce page's content if no Id is passed over

            return null;

        }

 

        List<Item__c> itemsToUpdate = new List<Item__c>();

       

        List<Item__c> items = new List<Item__c>([SELECT Id FROM Item__c WHERE Quotation_No__c = :theId]);

        for (Item__c item :  items) {

             item.CurrencyIsoCode = Quote.CurrencyIsoCode;

             itemsToUpdate.add(item);            

        }

        update(itemsToUpdate);

        return null;

    } 

}

Hello

 

can anyone please throw some ideas..on how to solve the below issue ....many thanks in advance


Right now I have problems in writing test case when I want to deploy this class to the production. could you help me with writing the test case or example for the test case for the class below.

  

public class UpdateItemQuoteCurrency {

 

    // Constructor - this only really matters if the autoRun function doesn't work right

    private final Quotation__c q;

    public UpdateItemQuoteCurrency(ApexPages.StandardController stdController) {

        this.q = (Quotation__c)stdController.getRecord();

    }

   

    // Code we will invoke on page load.

    public PageReference autoRun() {

 

        String theId = ApexPages.currentPage().getParameters().get('id');

 

                Quotation__c Quote = [select CurrencyIsoCode from Quotation__c where Id= :theId];

 

        if (theId == null) {

            // Display the Visualforce page's content if no Id is passed over

            return null;

        }

 

        List<Item__c> itemsToUpdate = new List<Item__c>();

       

        List<Item__c> items = new List<Item__c>([SELECT Id FROM Item__c WHERE Quotation_No__c = :theId]);

        for (Item__c item :  items) {

             item.CurrencyIsoCode = Quote.CurrencyIsoCode;

             itemsToUpdate.add(item);            

        }

        update(itemsToUpdate);

        return null;

    } 

}