Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

Help me rewrite this formula

I have two fields on a form that is populated from a view.  The fields contain a list of names example:

Requested_Approver -> Bob Socks;Jimmy Johnson
PME_Approver -> Bud Wiser;Chuck Roast

I have a action button called approve - someone from each list has to approve the form.  I set up a hidden field called Approve_Checks - so if Bob its the approve button a DE is placed in the field, then the action should stop because someone from the PME_Approver list needs to approve.  So now when Bud checks approve - the hidden field will append PME - so the field look like DE;PME

Then if both are there the action should continue on through the rest of the program.  Here is what I have thus far:

@If(@IsMember(@Name([CN]; @UserName); Requested_Approver); @SetField("Approve_Checks";Approve_Checks:"DE"); "");

@If(@IsMember(@Name([CN]; @UserName); PME_Approver); @SetField("Approve_Checks"; Approve_Checks:"PME"); "");

@If(@IsMember("DE":"PME"; Approve_Checks);""; @Return(@Command([FileCloseWindow])));

REST OF ACTION ->


<- END of ACTION

Any suggestions welcome.

A quick def. of problem.  I have two fields of names, someone from each field has to approve the document for the document to change states.  After the first person approves the action still must wait for the second one to approve, after the second approves the action should complete itself and change states of the action.

Thanks For All your time and help
0
Jaziar
Asked:
Jaziar
  • 3
  • 3
1 Solution
 
scottrmaCommented:
Hi Jaziar,

Are you actually getting an error with the above formula, or are you just asking us to proof-read it? I don't see anything wrong with it off the top of my head.

Regards,

Scott
0
 
JaziarAuthor Commented:
Its never continuing with the action - even though both fields are filled in - it always closes the window.
0
 
JaziarAuthor Commented:
also is there a cleaner way to put the @Ifs together
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
SandraECommented:
If the document is open when this code runs, you need to save it before you close it.
0
 
scottrmaCommented:
Try this:

FIELD Approve_Checks := Approve_Checks;

@If(@IsMember(@Name([CN]; @UserName); Requested_Approver); @SetField("Approve_Checks";Approve_Checks:"DE"); "");

@If(@IsMember(@Name([CN]; @UserName); PME_Approver); @SetField("Approve_Checks"; Approve_Checks:"PME"); "");

@If(@IsMember("DE":"PME"; Approve_Checks);""; @Return(@Command([FileCloseWindow])));

Let us know if this works or not. Thanks.

Regards,

Scott
0
 
scottrmaCommented:
Also check the document properties box for your Approve_Checks field. Make sure its datatype is TEXT LIST and not just TEXT and that the SUMMARY field flag is present.

Regards,

Scott
0
 
JaziarAuthor Commented:
I got it working - thanks - I wish someone would look at my other question that is open as well.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now