Hi Experts,
I have two report designs for packing slip which prints one after the other after packing slip is posted
I want Note Type to display on Report design of Packing slip and Cert to display on CERT Report design
Here is what i hvae done so far
- Declared boolean isCert in SalesPackingSlipDP class decleration
- In process report method
if(objContract.parmDocumentTitle() == literalStr("@SYS11549"))
{
isCert = false;
}
else
{
isCert = True;
}
- In SetSalesPackingSlipDetailsTmp method
if ((custFormletterDocument.DocuOnPackingSlip == DocuOnFormular::Line)
|| (custFormletterDocument.DocuOnPackingSlip == DocuOnFormular::All))
{
If(isCert)
{
docuRefSearch = DocuRefSearch::newTypeIdAndRestriction(custPackingSlipTrans,“CERT”,DocuRestriction::External);
salesPackingSlipTmp.Notes = Docu::concatDocuRefNotes(docuRefSearch);
}
else
{
docuRefSearch = DocuRefSearch::newTypeIdAndRestriction(custPackingSlipTrans,custFormletterDocument.DocuTypePackingSlip,DocuRestriction::External);
salesPackingSlipTmp.Notes = Docu::concatDocuRefNotes(docuRefSearch);
}
}
The issue is output displays certification type notes in both reports and unable to switch between designs in code
Debugged few times but was unable to get an idea where the designs are switching
Kindly advice
Can you please share what you found during debugging?
For example, maybe your code doesn’t work as expected. Maybe it sets Notes but the field is than overwritten by some other code. Maybe the value in the form doesn’t come from Notes. Or something else. You must identify the problem before you can fix it.
Hi Martin,
Thank you for your reply
Here is what I found during my debugging:
First I select the original preview
So by default Original Preview should be @SYS11549 i.e. “packing Slip” and isCert boolean is true
First of all the objcontract.parmDocumentTitle gives a recid that never changes if I go to my next break point
Now in SetSalesPackingSlipDetailsTmp method, if iscert is true, I want to print certification/Cert Type notes in CERT design and Report design I need the system to print Note type notes but for some reason iscert boolean variable remains true for Report design too why I am not sure
Secondly the recId 5637151332 also remains the same for both the designs
So in a nutshell, I am not able to find a differentiating factor that will enable me to switch between Cert and Report designs of SalesPackingSlip ssrs report
Kindly advice
If the assignment of isCert doesn’t work as expected, it must mean that the problem lies in the condition if(objContract.parmDocumentTitle() == literalStr("@SYS11549")). This is where your debugging should continue.
Your claim that “objcontract.parmDocumentTitle gives a recid” sounds wrong - the title is a string, not a RecId, isn’t it. If it was a RecId (int64), the condition above (where you’re comparing the value with a string) wouldn’t compile at all.
The value 5637151332 seems to be a RecId of CustPackingSlipVersion. The fact that the data in database is still the same (regardless of which report design you use to visualize them) should make sense.