Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Suggested answer

Is it possible to pass in an itemID to the FulfillmentLineView as a parameter to retrieve the data for

Posted on by 1,433

I need to add a custom app bar button on the InventoryLookupView. That button should call FulfillmentLineView and pass in the itemId of the line the user was on in the InventoryLookupview and only show records in the FulfillmentLineView for that specific itemID.

When I look in PosApi/Extend/Views/FulfillmentLineView I see only the following options available to me and I do not see anything that looks like it accepts a parameter in retrieving the data:

pastedimage1586445215374v1.png

I can create a totally new view that needs to pull the same data as the FulfillmentLineview but then  how do I tell it what its datasource is and I still won't know how to pass in a parameter. 

Any idea or examples are much appreciated.

  • Retha Profile Picture
    Retha 1,433 on at
    RE: Is it possible to pass in an itemID to the FulfillmentLineView as a parameter to retrieve the data for

    No. FulfillmentLineView doesn't have the hookups to accomplish this. I contacted Microsoft and I have to write everything from scratch.

  • Guanghui Profile Picture
    Guanghui on at
    RE: Is it possible to pass in an itemID to the FulfillmentLineView as a parameter to retrieve the data for

    Have you resolved this issue?

  • Retha Profile Picture
    Retha 1,433 on at
    RE: Is it possible to pass in an itemID to the FulfillmentLineView as a parameter to retrieve the data for

    I'm stuck on this one.  Going from the App Bar button to the fulfillment form doesn't look  like I can use the WarrantyEnabledProductsView model example.

    The only code that I can see that is exposed for extension is the FulFillemntLineSearchCriteria and it doesn't have ItemId as a search criteria. So I have to add it as an extension property. Don't know how slow that will make the fulfillmentLinesView page then. It is already slow.

    If I want to create a new view but it must be a copy of the standard FulFillmentLinesView, how do I go about it? It needs to have the same functionality with the filters and sort buttons. Is it possible to use the same built-in triggers and framework ?

    Or do I need to write everything from scratch?

  • Suggested answer
    Guanghui Profile Picture
    Guanghui on at
    RE: Is it possible to pass in an itemID to the FulfillmentLineView as a parameter to retrieve the data for

    I suggest that you can check the examples in RetailSDK, for this case, please check the

     export abstract class InventoryLookupExtensionCommandBase extends ExtensionCommandBase<IInventoryLookupToExtensionCommandMessageTypeMap> {

           protected readonly context: IInventoryLookupExtensionCommandContext;

           /**

            * The handler for the product changed message.

            * @remarks Derived classes should set the handler to execute functionality when a "ProductChanged" message is received.

            */

           protected productChangedHandler: (data: InventoryLookupProductChangedData) => void;

           /**

            * The handler for the location selected message.

            * @remarks Derived classes should set the handler to execute functionality when a "LocationSelected" message is received.

            */

           protected locationSelectionHandler: (data: InventoryLookupLocationSelectedData) => void;

           /**

            * The handler for the location selection cleared message.

            * @remarks Derived classes should set the handler to execute functionality when a "LocationSelectionCleared" message is received.

            */

           protected locationSelectionClearedHandler: () => void;

           /**

            * Creates a new instance of the InventoryLookupExtensionCommandBase class.

            * @param {IInventoryLookupExtensionCommandContext} context The command context.

            * @remarks All commands added to the inventory lookup page should derive from this class.

            */

           constructor(context: IInventoryLookupExtensionCommandContext);

       }

       /**

    I think the  protected productChangedHandler: (data: InventoryLookupProductChangedData)  , the interface is :

    type InventoryLookupProductChangedData = {

           product: Proxy.Entities.SimpleProduct;

           locationAvailabilities: Proxy.Entities.OrgUnitAvailability[];

       };

    It contains the product information

    And then I suggest that you can check the  WarrantAndReturn Sample, you can pass this product through click the AppBar Command such as  this code:

    protected execute(): void {

           this.isProcessing = true;

           this.context.navigator.navigate("WarrantyEnabledProductsView", <IWarrantyEnabledProductsViewModelOptions>{

               customer: this._customer,

               products: this._products,

               salesOrder: this._selectedSalesOrder

           });

           this.isProcessing = false;

       }

    And then receive the product in the ViewModel(such as WarrantyEnabledProductsViewModel) of the new view see below:

    constructor(context: IExtensionViewControllerContext, options?: IWarrantyEnabledProductsViewModelOptions) {

           this._context = context;

           this._options = options || { customer: undefined, products: [], salesOrder: undefined };

           this._options.products = this._options.products || [];

           this.title = ko.observable(StringExtensions.format(

               this._context.resources.getString("WarrantyEnabledProductsTitleFormat"), this._options.salesOrder.ReceiptId));

           this.isBusy = ko.observable(false);

           this.warrantyEnabledProducts = ko.observableArray(this.getProductsWithWarranty());

       }

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans