Back to Blog

VuGen: Dynamic Transactions Created From A Parameter File

From Michael Hendershot

Based on the search item I choose, I want a different transaction. This pulls the transaction name from parameter file and generates the transaction name off the “SearchFieldTransaction” column in my parameter file. Be careful. Tree view will take the “tmptransactionname” out of the lr_start and lr_end transaction.

Code:

Action()
{
    char tmptransactionname[25];

    sprintf(tmptransactionname,"%s",lr_eval_string("{SearchFieldTransaction}"));

    lr_start_transaction(tmptransactionname);

    lr_end_transaction(tmptransactionname, LR_AUTO);

    return 0;
}

Paramater File:

SearchFieldValue,SearchFieldType,TransactionName
All,All,S01_T01_Search_By_ALL
R000,Open,S01_T01_Search_By_OPEN
R001,In Progress,S01_T01_Search_By_INPROGRESS
R002,Complete,S01_T01_Search_By_COMPLETE
R003,Approved,S01_T01_Search_By_APPROVED
M999,Manual,S01_T01_Search_By_MANUAL
Back to Blog