I am writing a basic project management database, where when a solution is added to a project it updates a solution list which is comprised of 4 fields (as we have to look at 4 possible solutions for a project!), these fields are solution1 to solution4 for example.
I want it so that when a solution is saved it checks the fields to see if they contain data then check the next field and so on until it finds an empty field to add data to. Then once it has added the data to stop. Also when updating information in the solution, it would need to check if its name exists in one of the fields to stop it going through the above again and entering its name twice.
This probably does not sound very clear, but here is my formula so far, bear with me as my experience is very minimal!!
The checking and adding its name initially works, but when updating a solution, if 4 are not in the list it will enter its name a second time!!
Your help is appreciated.
@If ( @IsValid ; @Success ; @Return ( “” ) ) ;
@Command([FileSave]);
@If(@GetDocField(pdocunid;“prsolution1”)=“”;@SetDocField(pdocunid;“prsolution1”;solname);
@GetDocField(pdocunid;“prsolution2”)=“”;@SetDocField(pdocunid;“prsolution2”;solname);
@GetDocField(pdocunid;“prsolution3”)=“”;@SetDocField(pdocunid;“prsolution3”;solname);
@GetDocField(pdocunid;“prsolution4”)=“”;@SetDocField(pdocunid;“prsolution4”;solname);“”);
@SetDocField(pdocunid;“prstatus”;"Solution Updated: "+@Text(solname)+ " Date: "+ @Text(@Today) );
@PostedCommand([FileSave])