Variable Property Bags are a way to store values and text and then utilize that information later for any number of different reasons. This article will cover 1 specific case where a particular customer was interested in capturing some notes each time an employee edited an order, changed a specific quantity variable and clicked Add. Upon change of that quantity variable the user wanted a text entry written to a variable that would serve as an edit log for the line item.

To accomplish this “edit log” we'll create a couple variables and modify the pricing form to include them as a checkbox and a designer memo.

Warning: You will be changing your live system, it is recommended you make a backup before proceeding with any changes to minimize the impact should your changes result in an inadvertent issue arising.

  1. Create a Yes/No variable named AddToEditLog
  2. Put this formula in the Actions when value changes box.
// We create a local variable and set it equal the value of a property bag variable named "Result" 
declare CurrentValue := GETVARIABLEPROPERTYTEXT(EditLog, "Result", "");
// We create a second local variable and set it equal to the a custom string of the Employee Full Name 
// + the current date/time + some custom text + the value of the Rejected Qty variable. + the current value.
// This will allow us to create an ongoing list of entries in the log by appending the new value to the previous value. 
declare NewValue :=  User.Employee.FullName +  " " + DISPLAYDATETIME( Today) + " Qty Rejected: " + ToString(RejectedQuantity) + " " + currentvalue;
// After we have establish the new value we then update the property bag for the EditLog variable which will be responsible for displaying the actual logs in our memo description pricing form component.
SetVariableProperty(EditLog, "Result", NewValue);
  1. Create a Text variable named EditLog
  2. Set the variable to use a Formula for it's default value then use the formula below.
// We reference an invalid object reference to force Control to always recalculate/refresh. 
// Since property bags aren't monitored for changes by Control this is needed else the memo description 
// pricing form component won't update on the screen during order entry.
// We then set the default value equal to the text that was inserted into the Result variable of the property bag. 
GETVARIABLEPROPERTYTEXT(EditLog, "Result", "(blank)");
  1. Add a memo to your pricing form and link it to the EditLog variable.
  2. Add a checkbox to your pricing form and link it to the AddToEditLog.
  3. Change the background color, caption, font, etc. to style the checkbox accordingly. If you want the checkbox to resemble a button, then you can place the checkbox on top of a panel and turn on the option to UseCustomGlyphs which will remove the checkbox itself.
  4. Create a new order then toggle the checkbox on/off and you should have text populate the memo field you added to the pricing form.
Sample Pricing Form

In the screenshot example below I clicked the Add to Log button, then changed the rejected qty, click it again, then did that another time.

Contributor: Brandon Readlinger, Cyrious

Date: 1/28/2016

You could leave a comment if you were logged in.