We are trying to update a BO with data from an external table (Estimate) but keep getting an error 'Value for primary key vot_num is not defined'.
Steps used:
Create a BO to an external database table 'Estimate' and set the Primary key to:
est_yer, lgr_acc, vot_num
Added an 'Operation invoked from the form' that will run the Process 'BudgetLoadFromDatabase'
The Process has 2 Rules, the first to find all row in Budget where IsBudget level = 'Yes' and Status='Draft'. The second rule finds that data in the external table and then using this adds up the values in 'Estimate' and set the Budget.InitalValue:
- BudgetFindBudgetLevelItems = Action 1 :FIND Budget WHERE Budget.BudgetLevel.IsBudgetLevel='Yes' AND Budget.Status='Draft' IN BATCHES OF 1
- GetInitialBudget = Action 1 :FIND Estimate WHERE Estimate.lgr_acc=Budget.LedgerAccountBudgetValue AND Estimate.est_yer=Budget.BudgetYear AND Estimate.vot_num=Budget.VoteNumber AND Estimate.app_flg='P'
Action 2: Budget.InitialBudget=Estimate.est_v01+Estimate.est_v02+Estimate.est_v03+Estimate.est_v04+Estimate.est_v05+Estimate.est_v06+Estimate.est_v07+Estimate.est_v08+Estimate.est_v09+Estimate.est_v10+Estimate.est_v11+Estimate.est_v12+Estimate.est_o01+Estimate.est_o02+Estimate.est_o03+Estimate.est_o04+Estimate.est_o05+Estimate.est_o06+Estimate.est_o07+Estimate.est_o08+Estimate.est_o09+Estimate.est_o10+Estimate.est_o11+Estimate.est_o12
When this is run the error 'Value for primary key vot_num is not defined' is displayed. We have no idea what this means as we have set the value in the Find action 1 'GetInitialBudget' to the value in Budget.VoteNumber which has a value of zero '0'
Below is what is ouput in the test.log
2009-05-31 15:29:13,737 GENERIC is#admin -17
2009-05-31 15:29:13,737 GENERIC is#admin -17
2009-05-31 15:29:13,737 GENERIC is#admin -20 Executing process BudgetLoadFromDatabase with parameters: Budget:170954
2009-05-31 15:29:13,737 RULE_EVALUATION is#admin -29 Started evaluation of rules
2009-05-31 15:29:13,737 RULE_EVALUATION is#admin -22 Evaluating rule 'BudgetFindBudgetLevelItems' FIND Budget WHERE Budget.BudgetLevel.IsBudgetLevel='Yes' AND Budget.Status='Draft' IN Batches of 1
2009-05-31 15:29:13,737 RULE_EVALUATION is#admin -2 Adding action FIND Budget WHERE Budget.BudgetLevel.IsBudgetLevel='Yes' AND Budget.Status='Draft' IN BATCHES OF 1 to the agenda
2009-05-31 15:29:13,737 RULE_EVALUATION is#admin -16 Finished rule evaluation
2009-05-31 15:29:13,737 RULE_EVALUATION is#admin -16 Finished evaluation of rules
2009-05-31 15:29:13,737 ACTION_EXECUTION is#admin -15 Executing action FIND Budget WHERE Budget.BudgetLevel.IsBudgetLevel='Yes' AND Budget.Status='Draft' IN BATCHES OF 1
2009-05-31 15:29:13,753 ACTION_EXECUTION is#admin -33 Found 8 objects
2009-05-31 15:29:13,753 ACTION_EXECUTION is#admin -Processing first 1 objects
2009-05-31 15:29:13,753 ACTION_EXECUTION is#admin -16 Finished executing action FIND Budget WHERE Budget.BudgetLevel.IsBudgetLevel='Yes' AND Budget.Status='Draft' IN BATCHES OF 1
2009-05-31 15:29:13,784 RULE_EVALUATION is#admin -29 Started evaluation of rules
2009-05-31 15:29:13,784 RULE_EVALUATION is#admin -22 Evaluating rule 'GetInitialBudget' DISPLAY MESSAGE '>>'+Budget.LedgerAccountBudgetValue+'<<'+Budget.BudgetYear+'<>' FIND Estimate WHERE Estimate.lgr_acc=Budget.LedgerAccountBudgetValue AND Estimate.est_yer=Budget.BudgetYear AND Estimate.vot_num=Budget.VoteNumber AND Estimate.app_flg='P' Budget.InitialBudget=Estimate.est_v01+Estimate.est_v02+Estimate.est_v03+Estimate.est_v04+Estimate.est_v05+Estimate.est_v06+Estimate.est_v07+Estimate.est_v08+Estimate.est_v09+Estimate.est_v10+Estimate.est_v11+Estimate.est_v12+Estimate.est_o01+Estimate.est_o02+Estimate.est_o03+Estimate.est_o04+Estimate.est_o05+Estimate.est_o06+Estimate.est_o07+Estimate.est_o08+Estimate.est_o09+Estimate.est_o10+Estimate.est_o11+Estimate.est_o12
2009-05-31 15:29:13,784 RULE_EVALUATION is#admin -2 Adding action DISPLAY MESSAGE '>>'+Budget.LedgerAccountBudgetValue+'<<'+Budget.BudgetYear+'<>' to the agenda
2009-05-31 15:29:13,784 RULE_EVALUATION is#admin -2 Adding action FIND Estimate WHERE Estimate.lgr_acc=Budget.LedgerAccountBudgetValue AND Estimate.est_yer=Budget.BudgetYear AND Estimate.vot_num=Budget.VoteNumber AND Estimate.app_flg='P' to the agenda
2009-05-31 15:29:13,784 RULE_EVALUATION is#admin -2 Adding action Budget.InitialBudget=Estimate.est_v01+Estimate.est_v02+Estimate.est_v03+Estimate.est_v04+Estimate.est_v05+Estimate.est_v06+Estimate.est_v07+Estimate.est_v08+Estimate.est_v09+Estimate.est_v10+Estimate.est_v11+Estimate.est_v12+Estimate.est_o01+Estimate.est_o02+Estimate.est_o03+Estimate.est_o04+Estimate.est_o05+Estimate.est_o06+Estimate.est_o07+Estimate.est_o08+Estimate.est_o09+Estimate.est_o10+Estimate.est_o11+Estimate.est_o12 to the agenda
2009-05-31 15:29:13,784 RULE_EVALUATION is#admin -16 Finished rule evaluation
2009-05-31 15:29:13,784 RULE_EVALUATION is#admin -16 Finished evaluation of rules
2009-05-31 15:29:13,784 ACTION_EXECUTION is#admin -15 Executing action DISPLAY MESSAGE '>>'+Budget.LedgerAccountBudgetValue+'<<'+Budget.BudgetYear+'<>'
2009-05-31 15:29:13,784 ACTION_EXECUTION is#admin -16 Finished executing action DISPLAY MESSAGE '>>'+Budget.LedgerAccountBudgetValue+'<<'+Budget.BudgetYear+'<>'
2009-05-31 15:29:13,894 GENERIC is#admin -21 Process BudgetLoadFromDatabase is suspended. Its id is 501
2009-05-31 15:29:13,894 GENERIC is#admin -17
2009-05-31 15:29:13,894 GENERIC is#admin -17
2009-05-31 15:29:13,925 GENERIC Reply#501 -17
2009-05-31 15:29:13,925 GENERIC Reply#501 -17
2009-05-31 15:29:13,925 GENERIC Reply#501 -19 Resuming process 501
2009-05-31 15:29:13,941 ACTION_EXECUTION Reply#501 -Processing next 1 objects
2009-05-31 15:29:13,941 ACTION_EXECUTION Reply#501 -15 Executing action FIND Estimate WHERE Estimate.lgr_acc=Budget.LedgerAccountBudgetValue AND Estimate.est_yer=Budget.BudgetYear AND Estimate.vot_num=Budget.VoteNumber AND Estimate.app_flg='P'
2009-05-31 15:29:14,097 ACTION_EXECUTION Reply#501 -16 Finished executing action FIND Estimate WHERE Estimate.lgr_acc=Budget.LedgerAccountBudgetValue AND Estimate.est_yer=Budget.BudgetYear AND Estimate.vot_num=Budget.VoteNumber AND Estimate.app_flg='P'
2009-05-31 15:29:14,128 GENERIC Reply#501 -16 Finished resuming process 501
2009-05-31 15:29:14,128 GENERIC Reply#501 -17
2009-05-31 15:29:14,128 GENERIC Reply#501 -17