Hi,
I've created a module(Course Management System) and added Parameter Table as well Parameter Form. I've also created a two EDTs(studentId,courseId) and added the module to map. I can see the Number Sequence on the Number Sequence form as well as references as StudentId and CourseId.
In the Parameter form I've the DataSource as Parameter and NumberSequenceReference and in the grid added (referenceLabel,NumberSequenceId). But, on running the form, I'm getting one entry as shown below.
Instead the expected entries are
ReferenceLabel | SequenceCode |
student id | <CMS ...> |
courseid | <CMS ...> |
Can anyone suggest any solution?
*This post is locked for comments
Have used NumberSeqReference::buildQueryRunMulti() in executeQuery() of NumberSequenceReference datasource? You can find examples in (almost) any parameters form (and on internet).
Hi André,
I've already gone through that blog. And I can see the Reference in number sequence configuration. Also my number sequence is creating StudentId and Course ID on running 'info(NumberSeq::newGetNum(CMSParameters::numRefCMSCourseId()).num());' .I'm not able to display the reference in the number sequence tab.
Hi Olister,
Did the reply from Martin help you? Or do you still have the open question. If so, please read the next blog for more help: community.dynamics.com/.../microsoft-dynamics-365-for-operations-number-sequence
I've implemented the class as follows:
class NumberSeqModuleCMS extends NumberSeqApplicationModule
{
public void initializeReference(NumberSequenceReference _reference, NumberSeqDatatype _datatype, NumberSeqScope _scope)
{
super(_reference, _datatype, _scope);
switch (_datatype.parmDatatypeId())
{
case extendedTypeNum(CMSStudentId):
case extendedTypeNum(CMSCourseId):
}
}
public void loadModule()
{
NumberSeqDatatype datatype = NumberSeqDatatype::construct();
datatype.parmDatatypeId(extendedTypeNum(CMSStudentId));
datatype.parmReferenceHelp(literalStr('Student ID'));
datatype.parmWizardIsContinuous(false);
datatype.parmWizardIsManual(NoYes::No);
datatype.parmWizardIsChangeDownAllowed(NoYes::No);
datatype.parmWizardIsChangeUpAllowed(NoYes::No);
datatype.parmSortField(1);
datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
this.create(datatype);
// NumberSeqDatatype datatype = NumberSeqDatatype::construct();
datatype.parmDatatypeId(extendedTypeNum(CMSCourseId));
datatype.parmReferenceHelp(literalStr('Course ID'));
datatype.parmWizardIsContinuous(false);
datatype.parmWizardIsManual(NoYes::No);
datatype.parmWizardIsChangeDownAllowed(NoYes::No);
datatype.parmWizardIsChangeUpAllowed(NoYes::No);
datatype.parmSortField(2);
datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
this.create(datatype);
}
public NumberSeqModule numberSeqModule()
{
return NumberSeqModule::CMS;
}
[SubscribesTo(classStr(NumberSeqGlobal), delegateStr(NumberSeqGlobal, buildModulesMapDelegate))]
public static void NumberSeqGlobal_buildModulesMapDelegate(Map numberSeqModuleNamesMap)
{
NumberSeqGlobal::addModuleToMap(classNum(NumberSeqModuleCMS),numberSeqModuleNamesMap);
}
}
Also I've referenced this class in the form init() calling the via numberSeqPreInit() which contains the following code
void numberSeqPreInit()
{
runExecuteDirect = false;
numberSequenceModules = [NumberSeqModule::CMS];
numberSeqApplicationModule = new NumberSeqModuleCMS();
scope = NumberSeqScopeFactory::createDataAreaScope();
NumberSeqApplicationModule::createReferencesMulti(numberSequenceModules, scope);
}
You must implement a class extending NumberSeqApplicationModule for your module. Look at existing NumberSeqModule* classes for examples.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156