Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Overview

AdMagic receives orders from various channels, such as EDI and Shopify Store integration. All these orders are brought in by automatic routines. Once the order is in the Goldfinch system, users will need to manually allocate and create shipments for those orders. However, due to the volume of orders, manual allocation and creating warehouse shipments is not feasible for AdMagic. Therefore, an automatic/scheduled process need to be implemented.

Process

  • Step 1: the system will automatically allocate inventory to orders whose Document Status = ‘Open’ and Allocation Status != ‘Full’

    • Classes Reference: GF_SalesOrderAllocationBatch

  • Step 2: The system will automatically create warehouse shipments for orders with Document Status = ‘Open’ and Allocation Status = ‘Full’

    • Classes Reference: GF_CreateWhseShipmentBatch

  • The above processes are scheduled to run hourly and are controlled by the scheduler class GF_SOAllocationAndWhseShiptCreationSched

    • Schedule the routine to run hourly, run this:

      String cron = '0 0 0/1 1/1 * ? *'; //hourly 
      GF_SOAllocationAndWhseShiptCreationSched sched = new_GF_SOAllocationAndWhseShiptCreationSched(); 
      String jobId = System.schedule('Sales Order Allocation and Whse. Shipt. Creation Job', cron, sched); 
      

Sales Order Allocations Challenge

Issue:

AdMaigc claims that they will have more than 50,000 order lines with the same item in the same warehouse open at any given time, especially for those Kickstarter items. This will cause the out-of-box GF allocation routine to fail because the routine calculates the item quantity available by taking the item Quantity on Hand minus the quantity allocated, system doing it by looping through all allocation lines, which will cause too many query rows error, rules imposed by Salesforce governor limit, you can only query upto 50000 rows per transaction.

Solution:

  • A new object "GF Item Allocation Summary" is created to store summarized item allocation by warehouse, by item, and by unit of measure.

  • Trigger "GF_ItemAllocationTrigger" is added to detect Insert, Update, and Delete operations against the GFERP's Item Allocation object. The system will increase or decrease the quantity count in the summarized table based on the operation type/or the quantity change detected by the trigger.

  • A nightly job routine is scheduled to recalculate the allocated quantity in the summarized table. The night job will run the batches in the following order:

  1. Empty the summarized table - GF_DeleteSummarizedItemAllocationBatch

  2. Prepare the item allocation table - GF_UpdateItemAllocationBatch

  3. Generate summarized item allocation records - GF_SummarizeItemAllocationBatch

Two fields were created to record errors. (The system will write the error msg to all records if one record fails in the batch) 

  • Allocation_Processing_Error__c 

  • Whse_Shipt_Processing_Error__c 

  • No labels