Page 1 of 1

How to update/refresh many lookup-based fields in an order template?

Posted: Wed Apr 11, 2018 3:27 pm
by toddsou
Hi-

I have an order template which has several fields, each of which corresponds to a particular lookup table. Each of those fields are set to a particular code from its corresponding lookup table, and the corresponding description (and possibly others) fields were captured correctly when the template order was originally saved.

Now we want to update some of the entries in various lookup tables via SP Admin. However, the template orders would still be referencing the old values.

Is there some stand-alone API code I can write which would:
1) open the template order
2) iterate through a known list of fields we know have been updated via the spadmin lookup editor
3) For each field in that list within the template order, refresh its values from the corresponding lookup table again.
4) Save the template order

Thanks!

Re: How to update/refresh many lookup-based fields in an order template?

Posted: Wed Apr 11, 2018 4:41 pm
by BobRichards
We do not have a tool to do this. We would do it the same way you would - there is no magic and it will take a long time if you have a lot of templates that need updating.
  • Open the order
  • Grab the lookup code field value from the order and write it back to the same field. This should bring in all the current loop table row values.
  • Save the order.