web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Lookup field on DocuView form, form goes blank after lookup

(0) ShareShare
ReportReport
Posted on by 180

I have added a new string field to the DocuView form with a lookup (as below). When I open the form I see all the existing data on the form. When I do the lookup it works as expected, however when the lookup returns the DocuView form is wiped of all data. When I exit and return into the DocuView I see the selection made on the lookup. I know I need to do something to "capture" and then return the DocuView but not sure what that is or how to accomplish it. Thanks for any help.


public void lookup()
{
sysTableLookup sysTableLookup;
Query Artquery = new Query();
QueryBuildDataSource qbds;
FormRun callerForm;


//super();
callerForm = element.args().caller();

// Instantiate sysTableLookup object using table which will provide the visible fields
sysTableLookup = SysTableLookup::newParameters(tableNum(ArtCustomerAdvocateV1), this);


// Create the query.
qbds= Artquery.addDataSource(tableNum(ArtCustomerAdvocateV1));

sysTableLookup.parmQuery(Artquery);

// Specify the fields to show in the form.
sysTableLookup.addLookupfield(fieldNum(ArtCustomerAdvocateV1, Name));

// Perform the lookup
sysTableLookup.performFormLookup();

}

I have the same question (0)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Please use Insert > Code (in the rich formatting view) to paste source code. Let me re-post (and simplify) your code:

    public void lookup()
    {
    	Query artQuery = new Query();
    	QueryBuildDataSource qbds = artQuery.addDataSource(tableNum(ArtCustomerAdvocateV1));
    
    	// Instantiate sysTableLookup object using table which will provide the visible fields
    	SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(ArtCustomerAdvocateV1), this);
    
    	sysTableLookup.parmQuery(artQuery);
    
    	// Specify the fields to show in the form.
    	sysTableLookup.addLookupField(fieldNum(ArtCustomerAdvocateV1, Name));
    
    	// Perform the lookup
    	sysTableLookup.performFormLookup();
    }

    Nevertheless I don't see anything that could cause such behavior. Are you sure that it's about lookup()? Can't it be caused by some other code, e.g. in modified()?

  • LBP Profile Picture
    180 on at

    I have added another field which is a simple string entry field. I have tested by changing every other field on the form and the functionality appears fine. As soon as I access and return from the lookup field the DocuView form wipes all data and shows as completely blank. I can exit and reopen the form, then it shows as it should with my lookup selection also updated.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 499 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans