Start a new topic

Auto Populate Ship information in ASN

Hello,

When creating a new ASN, can we have the Ship To fields auto populate with a default address when a certain LOB is selected?

Hi Adam,


Nice suggestion.  This isn't possible today but I've added it to our product development backlog under ticket IPWMS-9279. 


Matt

Adam,


One way I think you could accomplish this would be to setup a Trigger to run on the ASN table, for any time after a new ASN is saved, and that trigger can be setup to run a Script in Infoplus, which should be able to set the ship-to address on the record.  Here's an example of what a script like this could look like:

if(record.shipToName)
{
    utils.log("ASN already has a ship-to (name=" + record.shipToName + "), so exiting without updating it.");
    return;   
}

if(asn.lobId == 10008)
{
    utils.log("Updating ASN ship-to for LOB: " + asn.lobId);
    record.shipToName = "Kingsrook";
    record.shipToStreet1 = "1160 Research Blvd.";
    record.shipToStreet2 = "Suite A";
    record.shipToCity = "St. Louis";
    record.shipToState = "MO";
    record.shipToZipCode = "63132";
    record.shipToPhone = "800-555-1234";
    infoplusApi.update("ASN", record);
}
else if(asn.lobId == 10009)
{
    utils.log("Updating ASN ship-to for LOB: " + asn.lobId);
    record.shipToName = "Queens Pawn";
    record.shipToStreet1 = "1160 Research Blvd.";
    record.shipToStreet2 = "Suite B";
    record.shipToCity = "St. Louis";
    record.shipToState = "MO";
    record.shipToZipCode = "63132";
    record.shipToPhone = "800-555-1234";
    infoplusApi.update("ASN", record);
}
else
{
    utils.log("Unrecognized lobId: " + asn.lobId + " - not updating asn.");
}


Of course, you'd need your LOB Id's (instead of the sample value 10008 that I used -- our support team should be able to get them to you), and you'd need an else-if block for each of those LOB's (assuming they have different ship-to addresses needed).


Let me know if this approach makes sense, or if we can give you any more assistance.  I'm not sure of your level of comfort with Scripts in general, or with setting up a trigger like this - but I'm sure the support team could help get you through that as needed also.


Thanks!

Login or Signup to post a comment