0

I have a Bids list with a lookup column Title pointing to Auctions list.

when people create a new bid for a specific Auction, I would like to retrieve the max bid and increment by 10 for that Auction and enter as new Amount. When Auction title is changed the Amount should change automatically.

enter image description here

I would like to achieve this by using JavaScript on the NewForm in Bids list.

I haven't used JavaScript in NewForm before. Detailed instructions would be much appreciated.

I have used the javascript code from this link but I could not get it to work.

https://stackoverflow.com/questions/516073/max-query-using-caml/1265240#1265240

  • Will you please share your code. – Niranjan Kulkarni Oct 12 '16 at 13:39
  • There is no code to share at the moment... – Aslan Oct 12 '16 at 13:42
  • We can achieve it by implementing PreSaveAction method in newform. – Niranjan Kulkarni Oct 12 '16 at 13:43
  • can you send me a sample code where I can start? – Aslan Oct 12 '16 at 13:45
  • So you have "max bid" in the Auctions List? You want to take the "max bid" from Auctions List based on the choice that you selected on lookup? – Thales Chemenian Oct 20 '16 at 17:57
0

Just add the PreSaveAction method in the new form code. Dont forget to make the copy of the NewForm. Make customisations in the new form copy.

If you’re customizing SharePoint listforms or SharePoint forms you have normally a save or cancel button. If you want to have a pre-action for the save button, that means there should something happen before the item will be saved if the user clicks on the save button, you can use the javascript function PreSaveAction(). This function takes place before saving the item.

For more information see below links,

https://social.technet.microsoft.com/Forums/office/en-US/a06d354d-446d-45c1-95f7-c09d2fb5260f/presaveaction-in-sharepoint?forum=sharepointgeneralprevious

https://social.technet.microsoft.com/Forums/office/en-US/86fe14fc-f353-4521-bf88-fd7fcabaa768/using-presaveaction-in-newformaspx-in-sharepoint-list?forum=sharepointgeneralprevious

http://social.technet.microsoft.com/wiki/contents/articles/31330.sharepoint-using-presaveaction-function-on-custom-list-forms.aspx

  • Thank you for your answer but it does not cover the section that I need to display the max bid for the auction. – Aslan Oct 12 '16 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.