Jaziar
asked on
Very Hard Question To Explain
On my form I have 3 fields
F-> means field name
History
User Date Action
F->Requester_Name F->Request_Date F->ECRFlowState (each field is computed off a hidden field)
HF->Requester_Name_2 HF->Request_Date_2 HF->ECRFlowState_2 (The way this should behave on the form is when some clicks the approve action button the fields reflect who and when they approved it in the form.
So if current user is Bob Sock and he clicks approve the history section says
Bob Sock 03/19/03 Approved. This part was working fine then I was asked to add two more fields
F->Requested_Approver and F->PME_Approver only the users in these two fields will ever see the approve action, but only after one person from each field approves it can the state change to approved. I had that working alright. Then came the part where the history would show when someone in the required field approved it. I can get the first approve to show up correctly but when the second one approves it does not record the action for that user - it continues with the action and puts the final approve in the history - which I want but I need to see the second approve as well. Here is the code.
ecr_flow_state := ECRFlowState + @NewLine + @Text("Approved");
ecr_requester_name := Requester_Name + @NewLine + @Name([CN]; @UserName);
ecr_status_date := Request_date+ @NewLine + @Text(@Now);
pme_text := ecr_requester_name + " - Acting As PME";
pme_approve := ecr_flow_state + " by PME";
de_text := ecr_requester_name + " - Acting As DE";
de_approve := ecr_flow_state + " by DE";
@If(@IsMember(@Name([CN]; @UserName); PME_Approver);
@If(PME_Approve_1 != ""; ""; @Do(@SetField("PME_Approve _1";"PME") ;
@If(ECRFlowState != ""; @SetField("ECRFlowState_2" ; pme_approve); "");
@If(Requester_Name != ""; @SetField("Requester_Name_ 2"; pme_text); "");
@If(Request_Date != ""; @SetField("Request_Date_2" ; ecr_status_date); "");"")); "");
@If(@IsMember(@Name([CN]; @UserName); Requested_Approver);
@If(Approve_Checks != ""; "";@Do(@SetField("Approve_ Checks";"D E");
@If(ECRFlowState != ""; @SetField("ECRFlowState_2" ; de_approve); "");
@If(Requester_Name != ""; @SetField("Requester_Name_ 2"; de_text); "");
@If(Request_Date != ""; @SetField("Request_Date_2" ; ecr_status_date); "");"")); "");
@SetField("total_check"; Approve_Checks:PME_Approve _1);
@If(@IsMember("DE":"PME"; total_check);""; @Return(@Command([FileClos eWindow])) );
@Command([FileSave]);
@Command([ViewRefreshField s]);
@SetField("ECRFlowState_2" ; "Approved");
@SetField( "Requester_Name_2"; @Name([CN]; @UserName));
@SetField("Request_Date_2" ; @Text(@Today));
@If(ECRFlowState != ""; @Do(@SetField("ECRFlowStat e_2"; ecr_flow_state); @SetField("ECRFlowState"; "")); "");
@If(Requester_Name != ""; @Do(@SetField("Requester_N ame_2"; ecr_requester_name); @SetField("Requester_Name" ; "")); "");
@If(Request_Date != ""; @Do(@SetField("Request_Dat e_2"; ecr_status_date); @SetField("Request_Date"; "")); "");
@SetField("ECRFlowState_3" ; "Approved");
@SetField( "Requester_Name_3";@Name([ CN]; @UserName));
@SetField("Request_Date_3" ; @Text(@Now));
@SetField("ECR_Approver_Na me"; ECRApprover);
F-> means field name
History
User Date Action
F->Requester_Name F->Request_Date F->ECRFlowState (each field is computed off a hidden field)
HF->Requester_Name_2 HF->Request_Date_2 HF->ECRFlowState_2 (The way this should behave on the form is when some clicks the approve action button the fields reflect who and when they approved it in the form.
So if current user is Bob Sock and he clicks approve the history section says
Bob Sock 03/19/03 Approved. This part was working fine then I was asked to add two more fields
F->Requested_Approver and F->PME_Approver only the users in these two fields will ever see the approve action, but only after one person from each field approves it can the state change to approved. I had that working alright. Then came the part where the history would show when someone in the required field approved it. I can get the first approve to show up correctly but when the second one approves it does not record the action for that user - it continues with the action and puts the final approve in the history - which I want but I need to see the second approve as well. Here is the code.
ecr_flow_state := ECRFlowState + @NewLine + @Text("Approved");
ecr_requester_name := Requester_Name + @NewLine + @Name([CN]; @UserName);
ecr_status_date := Request_date+ @NewLine + @Text(@Now);
pme_text := ecr_requester_name + " - Acting As PME";
pme_approve := ecr_flow_state + " by PME";
de_text := ecr_requester_name + " - Acting As DE";
de_approve := ecr_flow_state + " by DE";
@If(@IsMember(@Name([CN]; @UserName); PME_Approver);
@If(PME_Approve_1 != ""; ""; @Do(@SetField("PME_Approve
@If(ECRFlowState != ""; @SetField("ECRFlowState_2"
@If(Requester_Name != ""; @SetField("Requester_Name_
@If(Request_Date != ""; @SetField("Request_Date_2"
@If(@IsMember(@Name([CN]; @UserName); Requested_Approver);
@If(Approve_Checks != ""; "";@Do(@SetField("Approve_
@If(ECRFlowState != ""; @SetField("ECRFlowState_2"
@If(Requester_Name != ""; @SetField("Requester_Name_
@If(Request_Date != ""; @SetField("Request_Date_2"
@SetField("total_check"; Approve_Checks:PME_Approve
@If(@IsMember("DE":"PME"; total_check);""; @Return(@Command([FileClos
@Command([FileSave]);
@Command([ViewRefreshField
@SetField("ECRFlowState_2"
@SetField( "Requester_Name_2"; @Name([CN]; @UserName));
@SetField("Request_Date_2"
@If(ECRFlowState != ""; @Do(@SetField("ECRFlowStat
@If(Requester_Name != ""; @Do(@SetField("Requester_N
@If(Request_Date != ""; @Do(@SetField("Request_Dat
@SetField("ECRFlowState_3"
@SetField( "Requester_Name_3";@Name([
@SetField("Request_Date_3"
@SetField("ECR_Approver_Na
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I ended up rewriting the action and appending the information instead of having it seperate. It works better.
Thanks
Thanks
Yes it works better. I have been following this for years. Thanks for the points.
If you would like, you can send me the form (copy & paste into a new blank database if your current database design is very large and has many elements unrelated to this question), and I will take a look at it for you as soon as I can. My email address is in my profile. Thanks.
Regards,
Scott