0

Copy record Id failing

I have the following script on a button. Everything copies over except the record Id. Any ideas on why?  The target newInventory.(PurchaseItem := me.Id);, is a number. No errors are apparent.

let me := this;
let newInventory := (create Inventory);
newInventory.(Item := me.Item);
newInventory.('Timestamp IN' := now());
newInventory.(Unit := me.'Pkg Type');
newInventory.(Condition := 2);
newInventory.(Quality := 2);
newInventory.(Price := me.Subtotal);
newInventory.('Sales Tax' := me.'Item Sales Tax');
newInventory.('Shipping Cost' := me.'Item Shipping');
newInventory.(PurchaseItem := me.Id);
me.(Inventoried := true)

 

Thanks - Mike

4 replies

null
    • Fred
    • 1 mth ago
    • Reported - view

    you can try just using me instead of me.Id.

    • Global Information Technologist
    • Miken
    • 1 mth ago
    • Reported - view

    Changed - 
    newInventory.(PurchaseItem := me.Id);
    to
    newInventory.(PurchaseItem := me);

    Still did not copy record Id to PurchaseItem.

      • szormpas
      • 1 mth ago
      • Reported - view

        Hi, what kind of field is the PurchaseItem text or number?

      if it is number try the following:

      newInventory.PurchaseItem := number(me.Id);
      
    • Global Information Technologist
    • Miken
    • 1 mth ago
    • Reported - view

    Changed to - newInventory.(PurchaseItem := number(me.Id));

    This resolved the issue. Thank you.

Content aside

  • Status Answered
  • 1 mth agoLast active
  • 4Replies
  • 30Views
  • 3 Following