Dbcolumn question!

i have a form with a field(workstationlocation2) that dbcolumn another field(workstationlocation1) from another database. However, when the document in workstationlocation1 is edited to another value and saved, the document in workstationlocation2 is not updated with the new value, yet retains the old value which should not have existed. How do i solve it??

Subject: dbcolumn question!!

Computed fields only compute when the document is edited (it’s not automatic). You would need to create a scheduled agent to keep the values (more-or-less) up to date.

Subject: RE: dbcolumn question!!

hi can u explain more clearly? what kind of agent to create? becouse im newbie at DD…

Subject: dbcolumn question!!

You could put in code that anytime the value of workstation1 is changed, you blank out the value of workstation2 so the user knows they need to fill it in, in particular if it’s required. Something like this…

Your code doesn’t need to be this complex

FieldName := “Field1”;

Srv := “Server”;

Path := “Path\filename.nsf”

OrgVal := @GetField(FieldName);

Key := OrgVal;

ViewName := “ViewName”;

Values := 2;

PromptTitle := “Select (whatever)”;

PromptMsg := “Select from the following:”;

ErrMsg := (Key + " not found on the “):(ViewName + " view.”):(OrgVal);

List := @DbLookup( “”:“NoCache” ; (Srv: Path) ; ViewName ; Key ; Values );

cList := @If( @IsError(List);

			ErrMsg;

			@Unique(@Trim(List))

	);

Ans := @Prompt([OkCancelList]:[NoSort]; PromptTitle; PromptMsg; OrgVal; List);

test := @If( @IsError(Ans);

			"";

		Ans != OrgVal;

			@SetField("Field2";"");

			""

	);

@SetField(FieldName;@If(@IsError(Ans) ; “”;Ans));

@Command([ViewRefreshFields])

Subject: RE: dbcolumn question!!

hi, where do i add this code??