This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@istest(seealldata=true) | |
public class testLEXProfileForQuote { | |
@istest | |
public static void test() { | |
String quoteId = 'a0O9E000000WDDf'; | |
User myUser = [select id, name from user where ProfileId = '00e9E000000HlA4' and lastname = 'Brückner' and isactive=true limit 1]; | |
sf42_quotefx__Sf42_quote__c quote = null; | |
system.debug(myUser); | |
System.runAs(myUser){ | |
quote = [ Select | |
Id, | |
name, | |
Owner.name, | |
OwnerId, | |
sf42_quotefx__SF42_QuoOpportunity__r.sf42_quotefx__SF42_Primary_Quote__c, | |
sf42_quotefx__SF42_QuoPageheaderText__c, | |
sf42_quotefx__SF42_QuoPagefooterText__c, | |
sf42_quotefx__SF42_QuoUseCustomAddress__c, | |
sf42_quotefx__SF42_QuoCustomAddressHtml__c, | |
sf42_quotefx__SF42_QuoCustomAddress__c, | |
sf42_quotefx__SF42_QuoxColumn1Title__c, | |
sf42_quotefx__SF42_QuoxColumn2Title__c, | |
sf42_quotefx__SF42_ColumnLayout__c, | |
sf42_quotefx__SF42_QuoUseCustomSender__c, | |
sf42_quotefx__SF42_QuoCustomSenderHtml__c, | |
sf42_quotefx__SF42_QuoCustomSender__c, | |
sf42_quotefx__SF42_QuoValidThruDate__c, | |
sf42_quotefx__SF42_QuoSum_Netto__c, | |
sf42_quotefx__SF42_QuoSum_Brutto__c, | |
sf42_quotefx__SF42_QuoOpportunity__c, | |
sf42_quotefx__SF42_QuoHideAddress__c, | |
sf42_quotefx__SF42_QuoteStyle__c, | |
sf42_quotefx__SF42_FirstPageBackgroundID__c, | |
sf42_quotefx__SF42_QuoteStyle__r.sf42_quotefx__SF42_Custom_CSS__c, | |
sf42_quotefx__SF42_SecondPageBackgroundID__c, | |
sf42_quotefx__SF42_QuoOrderConfirmation__c, | |
sf42_quotefx__SF42_QuoOpportunity__r.Name, | |
sf42_quotefx__SF42_QuoOpportunity__r.StageName, | |
sf42_quotefx__SF42_QuoOpportunity__r.Pricebook2Id, | |
sf42_quotefx__SF42_QuoOpportunity__r.Id, | |
sf42_quotefx__SF42_QuoOpportunity__r.AccountId, | |
sf42_quotefx__SF42_QuoBusiness__c, | |
sf42_quotefx__SF42_QuoBusiness__r.sf42_quotefx__SF42_BFX_Status2__c, | |
sf42_quotefx__SF42_QuoBusiness__r.sf42_quotefx__SF42_BFX_Status1__c, | |
sf42_quotefx__SF42_QuoBusiness__r.sf42_quotefx__SF42_BFX_ProcessStatus__c, | |
sf42_quotefx__SF42_QuoBusiness__r.sf42_quotefx__SF42_BFX_Contact__c, | |
sf42_quotefx__SF42_QuoBusiness__r.sf42_quotefx__SF42_BFX_Account__c, | |
sf42_quotefx__SF42_QuoBusiness__r.CreatedDate, | |
sf42_quotefx__SF42_QuoBusiness__r.Name, | |
sf42_quotefx__SF42_QuoBusiness__r.Id, | |
sf42_quotefx__SF42_QuoSpecialDiscount__c, | |
sf42_quotefx__SF42_blank__c, | |
sf42_quotefx__SF42_QuoStatus1__c, | |
sf42_quotefx__SF42_QuoStatus2__c, | |
sf42_quotefx__SF42_QuoApproval__c, | |
sf42_quotefx__SF42_QuoRecipient__c, | |
sf42_quotefx__SF42_QuoPricebookID__c, | |
sf42_quotefx__SF42_QuoLandscape__c, | |
sf42_quotefx__SF42_QuoNumber__c, | |
sf42_quotefx__SF42_QuoNotes__c, | |
sf42_quotefx__SF42_QuoIsTemplate__c, | |
sf42_quotefx__SF42_QuoIsPrimary__c, | |
sf42_quotefx__SF42_QuoContact__c, | |
sf42_quotefx__SF42_QuoContact2__c, | |
sf42_quotefx__SF42_QuoContact3__c, | |
sf42_quotefx__SF42_QuoContact4__c, | |
sf42_quotefx__SF42_QuoContact__r.Name, | |
sf42_quotefx__SF42_QuoContact__r.sf42_quotefx__SF42_Additional_Info_1__c, | |
sf42_quotefx__SF42_QuoContact__r.sf42_quotefx__SF42_Additional_Info_2__c, | |
sf42_quotefx__SF42_QuoContact__r.sf42_quotefx__SF42_Additional_Info_3__c, | |
sf42_quotefx__SF42_QuoContact__r.sf42_quotefx__SF42_Letter_Salutation__c, | |
sf42_quotefx__SF42_QuoContact2__r.Name, | |
sf42_quotefx__SF42_QuoContact2__r.sf42_quotefx__SF42_Additional_Info_1__c, | |
sf42_quotefx__SF42_QuoContact2__r.sf42_quotefx__SF42_Additional_Info_2__c, | |
sf42_quotefx__SF42_QuoContact2__r.sf42_quotefx__SF42_Additional_Info_3__c, | |
sf42_quotefx__SF42_QuoContact2__r.sf42_quotefx__SF42_Letter_Salutation__c, | |
sf42_quotefx__SF42_QuoContact3__r.Name, | |
sf42_quotefx__SF42_QuoContact3__r.sf42_quotefx__SF42_Additional_Info_1__c, | |
sf42_quotefx__SF42_QuoContact3__r.sf42_quotefx__SF42_Additional_Info_2__c, | |
sf42_quotefx__SF42_QuoContact3__r.sf42_quotefx__SF42_Additional_Info_3__c, | |
sf42_quotefx__SF42_QuoContact3__r.sf42_quotefx__SF42_Letter_Salutation__c, | |
sf42_quotefx__SF42_QuoContact4__r.Name, | |
sf42_quotefx__SF42_QuoContact4__r.sf42_quotefx__SF42_Additional_Info_1__c, | |
sf42_quotefx__SF42_QuoContact4__r.sf42_quotefx__SF42_Additional_Info_2__c, | |
sf42_quotefx__SF42_QuoContact4__r.sf42_quotefx__SF42_Additional_Info_3__c, | |
sf42_quotefx__SF42_QuoContact4__r.sf42_quotefx__SF42_Letter_Salutation__c, | |
sf42_quotefx__SF42_QuoCompany__c, | |
sf42_quotefx__SF42_QuoStreet__c, | |
sf42_quotefx__SF42_QuoPLZ__c, | |
sf42_quotefx__SF42_QuoDate__c, | |
sf42_quotefx__SF42_QuoCity__c, | |
sf42_quotefx__SF42_QuoCountry__c, | |
sf42_quotefx__SF42_QuoApprove__c, | |
sf42_quotefx__SF42_QuoAccount__c, | |
sf42_quotefx__SF42_QuoAccount2__c, | |
sf42_quotefx__SF42_QuoAccount3__c, | |
sf42_quotefx__SF42_QuoAccount4__c, | |
sf42_quotefx__SF42_QuoAccount__r.Name, | |
sf42_quotefx__SF42_QuoAccount2__r.Name, | |
sf42_quotefx__SF42_QuoAccount3__r.Name, | |
sf42_quotefx__SF42_QuoAccount4__r.Name, | |
sf42_quotefx__SF42_QuoActiveAccount__c, | |
sf42_quotefx__SF42_PrimaryAccount__c, | |
(Select | |
Id, | |
Name, | |
sf42_quotefx__SF42_QuoLI_VK__c, | |
sf42_quotefx__SF42_QuoLI_Typ__c, | |
sf42_quotefx__SF42_QuoLI_SpecialDiscount__c, | |
sf42_quotefx__SF42_QuoLI_Product__c, | |
sf42_quotefx__SF42_QuoLI_Productcode__c, | |
sf42_quotefx__SF42_QuoLI_PriceBookEntryId__c, | |
sf42_quotefx__SF42_QuoLI_Position_Int__c, | |
sf42_quotefx__SF42_QuoLI_Position__c, | |
sf42_quotefx__SF42_QuoLI_Menge__c, | |
sf42_quotefx__SF42_QuoLI_VE__c, | |
sf42_quotefx__SF42_QuoLI_Lowsell__c, | |
sf42_quotefx__SF42_QuoLI_Lowsellprice__c, | |
sf42_quotefx__SF42_QuoLI_Listenpreis__c, | |
sf42_quotefx__SF42_QuoLI_Html_Code__c, | |
sf42_quotefx__SF42_QuoLI_Endpreis__c, | |
sf42_quotefx__SF42_QuoLI_Discount__c, | |
sf42_quotefx__SF42_QuoLI_Description__c, | |
sf42_quotefx__SF42_QuoLI_DescriptionLong__c, | |
sf42_quotefx__SF42_QuoLI_DescriptionDetail__c, | |
sf42_quotefx__SF42_QuoLI_xColumn1__c, | |
sf42_quotefx__SF42_QuoLI_xColumn2__c, | |
sf42_quotefx__SF42_QuoLI_Alternative__c, | |
sf42_quotefx__SF42_QuoLI_DiscountType__c, | |
sf42_quotefx__SF42_QuoLI_TotalDiscount__c, | |
sf42_quotefx__SF42_QuoLI_TotalDiscountPrice__c, | |
sf42_quotefx__SF42_QuoLI_Specification_Export__c, | |
sf42_quotefx__SF42_QuoLI_Specification__c, | |
sf42_quotefx__SF42_QuoLI_GroupID2__c, | |
sf42_quotefx__SF42_QuoLI_GroupID__c, | |
sf42_quotefx__SF42_QuoLI_GroupID3__c | |
From sf42_quotefx__Positionen__r order by sf42_quotefx__SF42_QuoLI_Position_Int__c asc) | |
From sf42_quotefx__SF42_Quote__c | |
Where Id = :quoteid]; | |
List<sf42_quotefx__SF42_QuoteSetup__c> myList = [select id,sf42_quotefx__SF42_Version__c, sf42_quotefx__SF42_QuoSetup_Title__c,sf42_quotefx__SF42_QuoSetup_Longtext__c, sf42_quotefx__SF42_QuoSetup_Category__c, sf42_quotefx__SF42_QuoSetup_Language__c, sf42_quotefx__SF42_QuoSetup_Typ__c, sf42_quotefx__SF42_QuoSetup_Version__c, sf42_quotefx__SF42_QuoSetup_Value__c from sf42_quotefx__SF42_QuoteSetup__c where sf42_quotefx__SF42_QuoSetup_Typ__c = 'Parameter' and (sf42_quotefx__SF42_QuoSetup_Category__c = 'Angebot' OR sf42_quotefx__SF42_QuoSetup_Category__c = 'Quote')]; | |
Folder f1 = [Select Id, name from Folder where Developername = 'Quoting_EmailTemplates' and Type = 'Email']; // deactivated on 11.05.16 -> and NamespacePrefix = :sf42_nsp_query]; | |
Folder f2 = [Select Id, name from Folder where Developername = 'Order_Confirmation_Email_Templates' and Type = 'Email']; // deactivated on 11.05.16 -> and NamespacePrefix = :sf42_nsp_query]; | |
system.assert(quote!=null, 'quote needs to be returned'); | |
system.assert(myList.size()>0,'setup texts loaded'); | |
system.assert(f1 != null, 'Folder needs to be found'); | |
system.assert(f2 != null, 'Folder needs to be found'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment