Advertisement
Advertisement
| 07.21.2008 at 05:12AM PDT, ID: 23581483 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: |
REM {Data options};
targetFieldName := "Studio";
sourceViewName := "Groups";
sourceGroup :="Acc-Managers";
sourceField := "Members";
sourceServer := "server";
sourceDatabase := "Names.nsf";
REM {Prompt options};
promptTitle := "Studio Select";
promptMessage := "Assign studio staff from the list:";
promptError := "No choices are available.";
promptError1 := "Your choice returned no result.";
promptMultiple := @False;
REM {Get the choices.};
viewLookup := @DbLookup("":"NoCache"; sourceServer : sourceDatabase; sourceViewName; sourceGroup;sourceField );
@If(@IsError(viewLookup); @Return(@Prompt([Ok]; "Lookup Error"; promptError)); "");
choiceList := @Name([CN];viewLookup);
@If(choiceList = ""; @Return(@Prompt ([Ok]; "No Choices"; promptError)); "");
REM {Display the prompt};
noSelection := 1;
selection := @Prompt(@If(promptMultiple; [OkCancelListMult]; [OkCancelList]); promptTitle; promptMessage; @GetField(targetFieldName); choiceList);
@If(selection = noSelection; @Return(""); "");
REM {Lookup value from the return column};
selection := @DbLookup("":"NoCache"; sourceServer : sourceDatabase; sourceViewName;sourceGroup; sourceField);
@If (@IsError(selection); @Return(@Prompt([Ok]; "Lookup Error"; promptError1)); "Y");
REM {Update the target field};
@SetField(targetFieldName; selection);
@Command([ViewRefreshFields])
|