Wednesday, May 3, 2023

MassUpdateofRequestedShipDateforallTypesPOLines

Hi, Readers

Requirment:-Need to develop functionality to update the below date fields on all the selected PO lines.


o here’s what you need to develop.

 

On the Purchase order form, create a drop down form, and add the columns we need to update (highlighted fields from the above screenshot) on that drop dialog.

 

So, once the user selects a few PO lines and assign values to our drop dialog fields and click update button, the respective date fields should be updated on all the selected PO lines.

1.PurchTable_Extension --Clicked Method extension

[ExtensionOf(formcontrolstr(PurchTable,MassUpadte))]

internal final class ValleyForge_Extension

{

   /// <summary>

   /// update button clicked method.

   /// </summary>

   public void clicked()

   {

       next clicked();

       PurchLine       purchline;

       FormRun formrun;

       Args args = new Args();

       args.name(formstr(DropDilogForm));

       args.record(purchline);    

       args.object(element);

       formrun=  classFactory.formRunClass(args);

       formrun.init();

       formrun.run();

       formrun.wait();

   }

2.Drop dilog form ==Clicked method

  /// <summary>

       ///clicked method on update button.

       /// </summary>

       public void clicked()

       {

           super();

           formrun = element.args().caller();

           FormDataSource fds = formrun.dataSource('purchline');

           PurchLine               purchlineloca;

           //str value2 = formrun.args().parm() ;

         //  con = str2con(value2,";");

           MultiSelectionHelper helper = MultiSelectionHelper::construct();

           helper.parmDatasource(fds);

           purchlineloca = helper.getFirst();

           while (purchlineloca)

               {

               select forupdate purchline where purchline.InventTransId == purchlineloca.InventTransId;

               ttsbegin;

               purchline.DeliveryDate = DeliveryDate.dateValue();

               purchline.ConfirmedDlv = ConfirmedDeliveryDate.dateValue();

               purchline.update();

               ttscommit;

               purchlineloca = helper.getNext();

               }

 

           element.closeOk();

           

       }

 

    


No comments:

Post a Comment

My Requirement is Delete option in Vendor Master for all roles except System Administrator

   [FormControlEventHandler(formControlStr(VendParameters, VendParameters_YNV_VendorMasterDeletionOption), FormControlEventType::Modified)] ...