jbonfardeci / ShockoutForms

SharePoint + Knockout MVVM forms - an InfoPath killer
32 stars 8 forks source link

Error in SPForm.initFormAsync(): ; ReferenceError: QuoteNumber is not defined #6

Closed leolorenzoluis closed 8 years ago

leolorenzoluis commented 8 years ago

I'm getting an error when trying to load ShockoutForms.js

Error in SPForm.initFormAsync(): ; ReferenceError: QuoteNumber is not defined

bnsc commented 8 years ago

That looks like a problem with a field name. Is 'QuoteNumber' a field name in the list?

If you have trouble finding the problem, send me a screenshot of the list settings (with the field names) and your form source.

Thanks, Bill

leolorenzoluis commented 8 years ago

bah

http://sp2010dev1:83/SitePages/PurchaseRequisition.aspx

I just used the example stp file.

bnsc commented 8 years ago

It looks like the list template is missing a couple fields. You can create these fields to get the page working. Add the following fields to the list:

QuoteNumber (single line of text) DeliveryAddress (muliple lines of text) Comments (muliple lines of text) DateRequired (date)

I'll see what I can do to get the template corrected so it will work smoothly in the future. Thanks for trying the example and giving us feedback!

Thank you, Bill

leolorenzoluis commented 8 years ago

What are the steps to modify the form to point to the new page, so that when I click an item in the list it opens that one? Does it do http get from the service? like

http://sp2010dev1:83/SitePages/PurchaseRequisition.aspx?Id=1?

Also does it support managed metadata?

bnsc commented 8 years ago

You edit the list pages (EditForm.aspx, NewForm.aspx, and DispForm.aspx).

To do this, I use SharePoint Designer (SD) and open 'all files', then 'lists', then in the lower left side of the SD window, open the + next to lists and then the + next to the list name. check out the files and 'edit file in advanced mode'. edit the files (see below) and then check them back in.

you need to add the following javascript (modified for your form path) just after <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">

<script type="text/javascript">
/* REDIRECT TO NEW FORM */
location.replace("/formsFolderNameIfUsed/FormName.aspx" + (location.search).replace(/\?ID\=/, "?formid="));
</script>

Let me know how it goes.

Thank you, Bill

leolorenzoluis commented 8 years ago

Awesome it works! It looks like managed metadata is not supported?

bnsc commented 8 years ago

I'm glad it's working for you now. I really appreciate you working on setting this up and giving us a new perspective in the process.

I'm not sure about managed meta data. I'll check and post back here what I find.

Thank you, Bill

leolorenzoluis commented 8 years ago

Yeah no problem, thank you for creating this framework and get away from infopath forms. :)