/// <summary> /// /// </summary> /// <param name=/sender/></param> /// <param name=/e/></param> [FormControlEventHandler(formControlStr(ProdJournalTransBOM, PostJournal), FormControlEventType::Clicked)] public static void PostJournal_OnClicked(FormControl sender, FormControlEventArgs e) { ProdJournalBOM prodJournalBOM; FormControl formButtonControl = any2Object(sender) as FormControl; FormDataSource formDatasource = formButtonControl.formRun().dataSource(tableStr(ProdJournalTable)); ProdJournalTable prodJournalTable = formDatasource.cursor(); while select prodJournalBOM while select prodJournalBOM where prodJournalBOM.JournalId == prodJournalTable.JournalId && ProdJournalType::Picklist == prodJournalTable.JournalType { DimensionAttributeValueSetItemView dimensionAttributeValueSetItemView; DimensionAttribute dimensionAttribute; select dimensionAttributeValueSetItemView join dimensionAttribute where dimensionAttributeValueSetItemView.DimensionAttribute == dimensionAttribute.RecId && dimensionAttribute.Name == 'CostCenter' && dimensionAttributeValueSetItemView.DimensionAttributeValueSet == prodJournalBOM.DefaultDimension; if(dimensionAttributeValueSetItemView.DisplayValue == '000') { Error('CostCenter 000 dont alowed'); throw Exception::Error; } } } |