Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Suggested answer

Sales order custom field mandatory only working when we edit Sales order form

(1) ShareShare
ReportReport
Posted on by 1,915
Hi Experts,
 
I have created two customer fields with mandatory. Customer Mobile Number and Address. When we edit Sales order then mandatory is working. In our business scenario Sales order is created from Sales agreement. Once Sales order created, user print sales order confirmation without editing sales order. I want to validate Customer Mobile Number and Address fields whenever user click on sales order confirmation to force them to enter information in Customer Mobile Number and Address fields.
 
Please help me how to do it.
 
 
Without Edit
 
With Edit
 
 
Thanks,
Faiz
  • faiz7049 Profile Picture
    faiz7049 1,915 on at
    Sales order custom field mandatory only working when we edit Sales order form
    Hi Amine,
     
    On form datasource because I do not want to interrupt old Sales Order. I try click method it throw error but sales confirmation still got open.
     
    Also this thread Only store numeric values in field . I tried many time check box verified by still not updating.
     
        [FormControlEventHandler(formControlStr(SalesTable, buttonUpdateConfirmation), FormControlEventType::Clicked)]
        public static void buttonUpdateConfirmation_OnClicked(FormControl sender, FormControlEventArgs e)
        {
            FormRun formRun = sender.formRun();
            FormDataSource salesTableDS = formRun.dataSource(tableStr(SalesTable));
          
            SalesTable salesTable = salesTableDS.cursor() as SalesTable;
            
            if (salesTable.SFACustAddress == '' || salesTable.SFAMobileNumber == '')
            {
                throw error("Both Customer Mobile Number and Address fields must be filled before confirmation.");
               
            }
            
    
        }
     
     
    Thank you
    Faiz
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,169 Super User 2024 Season 2 on at
    Sales order custom field mandatory only working when we edit Sales order form
     
    I'd like to know if you make it mandatory for the table or the form datasource ?
     
    BR
    Mohamed Amine MAHMOUDI

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans