Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Enterprise Portal - cannot insert a record only update in my control using axform

$
0
0

I am new to Enterprise portal development and running into an issue using a control where I need to either insert or update a record using AXForm.

My problem is in the insert.

This is a simple form (no grid) with two fields (job number and user) and two buttons (ok / cancel). In code I am setting a job number and a user selects a user (worker) for a job from a dropdown. In my example when there is already a related record in my table the update completes when I hit OK or is ignored when I click cancel. When I try to insert nothing happens when I click ok or cancel (record not inserted and no error message). The enterprise portal axform is in edit mode. I cannot figure out what my problem is. A work around is to insert the record before the user make their selection and then the form always does an update but there must be a better way to do this? (more so if the user clicks cancel I would a dummy record using this work around)

If I add the following to the code behind (testing from page load) it will insert the record before the update.

var dsv = JobTableDataSource.GetDataSet().DataSetViews["JobTable"];
var JobNumber = dsv.GetCurrent().GetFieldValue("JobNumber").ToString();
var dsvr = dsv.GetCurrent();
dsvr.BeginEdit();
dsvr.SetFieldValue("JobNumber", JobNumber);
dsvr.EndEdit();

 

Any help is greatly appreciated. This occurs on another control I am working on too so it is repeatable.


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>