
Hi,
Per the title. I've overridden the modified method on a StringEdit that references a CustAccount field to something like this
public boolean modified()
{
boolean ret;
ret = super();
if ( ?????????? != this.valuestr())
{
ds_ProjectLine.CustAccountName = CustTable::find(this.valueStr()).Name;
ds_ProjectLine.ContactPersonId = '';
ds_ProjectLine.ContactPersonName = '';
}
return ret;
}
I didn't have the if statement originally, but in testing if I clicked to change the CustAccount from 113875 and I selected 113875 (so no change) then it still fired and wiped out the ContactPerson values. So I just want to test against the original value. But how do I reference it???
I've read in forums that if I had this at the Table level and used the modifiedfield method then I could reference this.orig() but it feels more like I want to do this at the form level.
Any suggestions???
*This post is locked for comments
I have the same question (0)I figured it out. Just cause I'm not in the table doesn't mean I can't use the orig() method.
This works how I want:
public boolean modified()
{
boolean ret;
ret = super();
if (ds_ProjectLine.orig().CustAccount != ds_ProjectLine.CustAccount)
{
ds_ProjectLine.CustAccountName = CustTable::find(ds_ProjectLine.CustAccount).Name;
ds_ProjectLine.ContactPersonId = '';
ds_ProjectLine.ContactPersonName = '';
}
return ret;
}