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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Number Sequence while through Clicked method

(1) ShareShare
ReportReport
Posted on by 2
Hi Friends 
 
I want to create a number sequence through clicked method 
 
[Form]
 
public class TokenMaster extends FormRun
 
{
 
 
 
  [DataSource]
   class TokenMaster
   {
       /// <summary>
       ///
       /// </summary>
       /// <param name = /_append/></param>
       public void create(boolean _append = false)
       {
           NumSeqTknId NumSeqTknIdant;
           NumberSequenceReference numberSequenceReference;
 
           super(_append);
 
           numberSequenceReference = NumberSeqReference::findReference(extendedTypeNum(NumSeqTknId));
           if (numberSequenceReference)
           {
               NumSeqTknIdant = NumberSeq::newGetNum(numberSequenceReference).num();
               TokenMaster.Token = NumSeqTknIdant;
           }
       }
 
   }
 
   [Control(/Button/)]
   class Enter
   {
       /// </summary>
 
       public void clicked()
 
       {
 
           super();
 
           TokenMaster      TokenMasterEnter;
 
           EmployeeDetails  EmployeeDetailsEnter;
 
           PositionDetails  PositionDetailsEnter;
 
           select * from EmployeeDetailsEnter join tmpphoneno where tmpphoneno.PhoneNo == EmployeeDetailsEnter.MobNo1 && EmployeeDetailsEnter.EmpStatus==EmployeeStatus::Active
               join   PositionDetailsEnter where   PositionDetailsEnter.Position == EmployeeDetailsEnter.Position &&   PositionDetailsEnter.PositionStatus == NoYes::Yes;
 
               
 
           if(EmployeeDetailsEnter)
 
           {
 
                   ttsbegin;
 
                   TokenMasterEnter.clear();
 
                   TokenMasterEnter.EmployeeId = EmployeeDetailsEnter.EmpId;
 
                   TokenMasterEnter.Name       = EmployeeDetailsEnter.EmpName;
 
                   TokenMasterEnter.TknMobNo   = EmployeeDetailsEnter.MobNo1;                  
 
                   TokenMasterEnter.NoOfToken  = PositionDetailsEnter.NoOfTkn;
 
                   TokenMasterEnter.insert();
 
                   ttscommit;
 
           }
 
               else
 
               {
 
                   Info(/there is no Active data/);
 
               }
           
           
       
 
           TokenMaster_ds.refresh();
 
           TokenMaster_ds.reread();
 
           TokenMaster_ds.research(true);
 
       }
 
   }
 
}
 
 
In this, I have written the create method, but I want this in the clicked method. Can you guys help me out?
  • André Arnaud de Calavon Profile Picture
    307,289 Super User 2026 Season 2 on at
    Hi,
     
    Can you tell us what issue you have if you move the generation of the number sequence to the clicked method? 
  • Suggested answer
    MuthukumaranAX Profile Picture
    2,903 on at
    You can create a new class object and move the logic under the class. create a new action menu item and attach to the form design this way you can make the logic executed in class not in form
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    You can copy paste same code from create and paste it here. Is there any specific difficulty in doing so?
  • Suggested answer
    Waed Ayyad Profile Picture
    9,218 Super User 2026 Season 2 on at
    Hi,
     
    Did you try to move the code from the create to the clicked method of the button?
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Antony Profile Picture
    2 on at
    I tried, but it didn't help, guys.
  • Suggested answer
    Nisha Soni 2709 Profile Picture
    on at
  • Waed Ayyad Profile Picture
    9,218 Super User 2026 Season 2 on at
    Hello Antony,
     
    What is the issue that you got when you moved the code to the clicked method?
     
     
    Thanks,
    Waed Ayyad
     
     
     
  • Waed Ayyad Profile Picture
    9,218 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved? If yes, mark the answers that helped you as verified.


    Thanks
    Waed Ayyad

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 523 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 408 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 354

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans