Hello,
Could you please point me to the right direction?
I have added a field to the form "ProdJournalTransRoute"
I need to make this field inactive or active based on the field value "ToDate" from the view called "ProdRouteSchedulingView"
Values to this view are entered on the form called "ProdRoute":
I have 2 questions:
1) Why I can't enter "ToDate" values in the form "ProdRoute"? I have highlighted it in the screenshot above. This leades the needed view "ProdRouteSchedulingView" doesn't have "ToDate" values as well.
2) The second question. To make my new field active or inactive based on the values of the "ToDate" from view "ProdRouteSchedulingView" I write the following code in the 'Active" method in the datasource ProdJournalRoute of the form "ProdJournalTransRoute"
int active() { int ret; ProdRouteSchedulingView prodRouteSchedulingView; ret = super(); journalFormTrans.datasourceActivePost(); if (prodJournalRoute.isProjMethodConsumed()) { skipWrite = true; prodJournalRouteProjHour_ds.executeQuery(); prodJournalRouteProjQuantity_ds.executeQuery(); skipWrite = false; } element.enableFieldsActive(); dimensionDefaultingController.activated(); select firstOnly * from prodRouteSchedulingView join ProdJournalRoute where ProdJournalRoute.ProdId == prodRouteSchedulingView.ProdId && ProdJournalRoute.OprId == prodRouteSchedulingView.OprId && ProdJournalRoute.OprNum == prodRouteSchedulingView.OprNum; if (ProdJournalRoute.TransDate >= prodRouteSchedulingView.ToDate) { ProdJournalRoute_ds.object(fieldNum(ProdJournalRoute,BreakdownReasonId_ICL)).allowEdit(false); } return ret; }
The needed record is found and there is "ToDate" value empty but the client is crashing on the "return ret" string. Tell me please what I'm doing wrong? Maybe that's because "ToDate" value is empty? But I can't enter it as I described above.
Thank you.
*This post is locked for comments