• Mark Kh09
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
I am not satisfied with how the printable view comes up for Order records.  I'm trying to create a somewhat customer-presentable PDF of an Order along with the Order Products (OrderItem).

I have gone to the Appexchange to look for free products to see if there's a solution that will enable me to configure the output but have had no luck.

Visualforce seems like the only option.  To my dismay, the "relatedList" does not work since the relationship between Order and Order Product is a lookup and not a master-detail.

How can I get Order and Order Products to render on 1 page and be able to configure the output (doesn't have to be a work of art) so I can have it presentable to customers?
This is my first trigger in the development environment and I wanted to practice getting it test coverage.  I know there is a very basic oversight on my part and would like for anyone to comment back on what I'm doing wrong.  Rating and Number of Employees is not getting code coverage even though I do an assert for both values.

Here is my trigger:
//-----------------------------------------------------------------------------------
trigger TEST on Account (before insert,before update) {
    for (Account accountInLoop : Trigger.new) {
        // if the account name is Yippie, then change rating to hot and num emps to 8
        if (accountInLoop.Name=='Yippie'){
            accountInLoop.Rating = 'Hot';
            accountInLoop.NumberofEmployees = 8;
        }
      
    }
}

//--------------------------------------------------------
Here is my test:
//---------------------------------------------------------
@isTest
public class TestAccountYippieTrigger {
    public static void insertNewAccount(){
        Account acctToCreate = new Account();
        
        //start adding fields for new accounts
        acctToCreate.Name = 'Yippie';
        
        //insert first new account
        insert acctToCreate;
        
        //query inserted account and validate results
        Account acctToAssert = [select Id,NumberOfEmployees,Rating from Account where Id=:acctToCreate.Id];      
         // validate results
        System.assertEquals(8, acctToAssert.NumberOfEmployees);
        System.assertEquals('Hot', acctToAssert.Rating);
   }
}
I am not satisfied with how the printable view comes up for Order records.  I'm trying to create a somewhat customer-presentable PDF of an Order along with the Order Products (OrderItem).

I have gone to the Appexchange to look for free products to see if there's a solution that will enable me to configure the output but have had no luck.

Visualforce seems like the only option.  To my dismay, the "relatedList" does not work since the relationship between Order and Order Product is a lookup and not a master-detail.

How can I get Order and Order Products to render on 1 page and be able to configure the output (doesn't have to be a work of art) so I can have it presentable to customers?
I want to initiate a Flow from a button on a Custom Object.  How do I capture the ID of that Custom Object record and be able to use it in the Flow?
This is my first trigger in the development environment and I wanted to practice getting it test coverage.  I know there is a very basic oversight on my part and would like for anyone to comment back on what I'm doing wrong.  Rating and Number of Employees is not getting code coverage even though I do an assert for both values.

Here is my trigger:
//-----------------------------------------------------------------------------------
trigger TEST on Account (before insert,before update) {
    for (Account accountInLoop : Trigger.new) {
        // if the account name is Yippie, then change rating to hot and num emps to 8
        if (accountInLoop.Name=='Yippie'){
            accountInLoop.Rating = 'Hot';
            accountInLoop.NumberofEmployees = 8;
        }
      
    }
}

//--------------------------------------------------------
Here is my test:
//---------------------------------------------------------
@isTest
public class TestAccountYippieTrigger {
    public static void insertNewAccount(){
        Account acctToCreate = new Account();
        
        //start adding fields for new accounts
        acctToCreate.Name = 'Yippie';
        
        //insert first new account
        insert acctToCreate;
        
        //query inserted account and validate results
        Account acctToAssert = [select Id,NumberOfEmployees,Rating from Account where Id=:acctToCreate.Id];      
         // validate results
        System.assertEquals(8, acctToAssert.NumberOfEmployees);
        System.assertEquals('Hot', acctToAssert.Rating);
   }
}