Developer forum

Forum » CMS - Standard features » Trying to use "Data Lists & Forms for Data Lists" to edit Ecom ProductShortDescription and ProductLongDescription

Trying to use "Data Lists & Forms for Data Lists" to edit Ecom ProductShortDescription and ProductLongDescription

Thomas Jensen
Reply
Hi

ver 9.4.11

I made a "data list" that givs me from EcomProducts:

ProductDefaultShopId ProductId ProductLanguageId ProductVariantId ProductName ProductNumber ProductShortDescription ProductLongDescription   

then i made a form for the same fields build from EcomProducts

 

The list works fine (The Default layouts is missing RowId in link to details)

Details custom have no template value for VIEW_ID that the default layouts is using (so I needed to hard copy the value in the link to the edit page)

The edit page, looks correct, when it get alle the value it needs

 

but now I'm stuck, when I try to save

I get this error:


An error occurred while attaching module (Dynamicweb.Frontend.Content)
 

System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.DataManagement.FieldCollection.Remove(Field value)
   at Dynamicweb.DataManagement.DefaultFormSaveProvider.Save(FormSetting formSettings, Dictionary`2 keysAndValues, String settings)
   at Dynamicweb.DataManagement.FormSaveManager.Save(FormSetting form, Dictionary`2 keysAndValues, FormProperties properties)
   at Dynamicweb.DataManagement.FormSave.CatchForm(FormSetting form, String typeName, FormProperties properties)
   at Dynamicweb.DataManagement.FormFrontend.GetContent()
   at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)

 

What am I missing ??


Replies

 
Nicolai Pedersen
Reply

Well, hard to tell without a link to the solution and some code...

>>Details custom have no template value for VIEW_ID that the default layouts is using (so I needed to hard copy the value in the link to the edit page)

I cannot understand what that means?

I think that the big problem is that EcomProducts table has a combined primary key (Productid, variantid, languageid) and the forms for datalists cannot handle more than one key field.

That said, it will probably not work decently anyways when updating not using the API since yould run into caching issues etc. So I would go for a combination of custom coding and maybe forms for editors.

BR Nicolai

 
Thomas Jensen
Reply

Hi Nicolai

If I use the "Default layout"
From the list I get a link http://www.holseogwibroe.dk/list?mode=detail&RowId=&ViewPID=943 (that is missing the RowId)
Here with fixed RowId http://www.holseogwibroe.dk/list?mode=detail&RowId=1&ViewPID=943
in the there is a link for "Edit this row" http://www.holseogwibroe.dk/edit?FORM_ROW_ID=1&VIEW_ID=17 (there it permisson limits on this page)

So if i need to build my own (because of the missing RowId), i need to add the VIEW_ID=17, but i guess that the "17" is the ID of the list, and will not always be "17"

But if that APP can not handel the "combined primary key", then the above dos not matter

Custom coding, will proprely not be a small build,
So the idea properly need to be scraped.
(The idea was to have a simple page where one could translate the descriptions)

 
Nicolai Pedersen
Reply

You can use PIM: https://doc.dynamicweb.com/documentation-9/pim/pim/working-with-pim#6178

BR Nicolai

 

You must be logged in to post in the forum