Happy Business Starts Here

Re: setting zqu__CommunicationProfile__c & zqu__InvoiceTemplate__c in default plugin not working

Highlighted
Zuora Alumni

setting zqu__CommunicationProfile__c & zqu__InvoiceTemplate__c in default plugin not working

CommunicationProfile and InvoiceTemplate in Component Registration do not work.
 

I am setting zqu__CommunicationProfile__c and zqu__InvoiceTemplate__c in a custom extension of                         zqu.CreateQuoteController.PopulateDefaultFieldValuePlugin.When I create a quote these 2 fields are empty on the display. 

Following code was used:

 

global class ComunicationProfile extends zqu.CreateQuoteController.PopulateDefaultFieldValuePlugin{
global override void populateDefaultFieldValue
(SObject record, zqu.PropertyComponentController.ParentController pcc)
{

super.populateDefaultFieldValue(record, pcc);

record.put('zqu__CommunicationProfile__c', 'a0Lj0000001oLIHEA2');
}
}

 

 






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Zuora Alumni

Re: setting zqu__CommunicationProfile__c & zqu__InvoiceTemplate__c in default plugin not working

The following code was used to make it work:

 

 global class DefaultValuesTwo extends zqu.CreateQuoteController.PopulateDefaultFieldValuePlugin{
global override void populateDefaultFieldValue
(SObject record, zqu.PropertyComponentController.ParentController pcc)
{
super.populateDefaultFieldValue(record, pcc);
super.setLookupOptions(pcc);

.........................

...........................

..............................


record.put('zqu__CommunicationProfile__c','a0L61000001KXSr');
zqu.LookupComponentOptions CommunicationProfileOptions = super.getLookupOption('zqu__CommunicationProfile__c');
CommunicationProfileOptions.targetId = 'a0L61000001KXSr';
CommunicationProfileOptions.targetName = 'test profile1';

record.put('zqu__InvoiceTemplate__c','a0V61000004oxpg');
zqu.LookupComponentOptions InvoiceTemplateOptions = super.getLookupOption('zqu__InvoiceTemplate__c');
InvoiceTemplateOptions.targetId = 'a0V61000004oxpg';
InvoiceTemplateOptions.targetName = 'testdraytemplate';

 

}

}






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post

1 REPLY 1
Highlighted
Zuora Alumni

Re: setting zqu__CommunicationProfile__c & zqu__InvoiceTemplate__c in default plugin not working

The following code was used to make it work:

 

 global class DefaultValuesTwo extends zqu.CreateQuoteController.PopulateDefaultFieldValuePlugin{
global override void populateDefaultFieldValue
(SObject record, zqu.PropertyComponentController.ParentController pcc)
{
super.populateDefaultFieldValue(record, pcc);
super.setLookupOptions(pcc);

.........................

...........................

..............................


record.put('zqu__CommunicationProfile__c','a0L61000001KXSr');
zqu.LookupComponentOptions CommunicationProfileOptions = super.getLookupOption('zqu__CommunicationProfile__c');
CommunicationProfileOptions.targetId = 'a0L61000001KXSr';
CommunicationProfileOptions.targetName = 'test profile1';

record.put('zqu__InvoiceTemplate__c','a0V61000004oxpg');
zqu.LookupComponentOptions InvoiceTemplateOptions = super.getLookupOption('zqu__InvoiceTemplate__c');
InvoiceTemplateOptions.targetId = 'a0V61000004oxpg';
InvoiceTemplateOptions.targetName = 'testdraytemplate';

 

}

}






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post