I am trying to streamline some C# code. I have code for cash management that works fine allowing the code to parse the grid on either the bank transaction screen or the bank inquiry screen.
CmDistributionTempTable CMDistTable;
if (WhichWindowOpen == "CmTransactionEntryForm")
{
CMDistTable = Dynamics.Forms.CmTransactionEntry.Tables.CmDistributionTemp; /* This points to the form table buffer for Cash Transaction Entry */
}
else
{
CMDistTable = Dynamics.Forms.CmTransactionZoom.Tables.CmDistributionTemp; /* This points to the form table buffer for Cash Transaction Zoom(Inquiry) */
}
However, if I attempt to do the same thing with the GL transaction screen and the journal entry inquiry screen it does not work.
GlDistributionTempTable GLDistTable;
if (WhichWindowOpen == "GlTransactionEntryForm")
{
GLDistTable = Dynamics.Forms.GlTransactionEntry.Tables.GlTrxLineWork; /* This points to the form table buffer for Transaction Entry */
}
else
{
GLDistTable = Dynamics.Forms.GlJournalEntryInquiry.Tables.GlTrxLineWork; /* This points to the form table buffer for Transaction Zoom(Inquiry) */
}
I get a message about not being able to implicitly convert to the GlDistributionTempTable table. I think it has to do with the fact that there is no GLDistribution temp table. I have searched for other temp tables but the only one that exists does not work either. Is there a way to get this technique to work?
*This post is locked for comments