Dynamic Foreign Key Column @ ShoppingCartItem -> to be used for AccProductParameter

If I add a Dynamic FK column in the schema extensions for table ShoppingCartItem, then I have a problem in the Shop.

  • The idea is to use the column in AccProductParameter of a AccProductParamCategory
  • In the object browser I can add any ObjectKey for any table, but I have to select the table first.
  • In the AccProductParamCategory I add a new AccProductParameter with the new column of the dynamic foreign key, there is no table selection.
  • In the Shop Portal there is no lookup button as it is at the normal foreign keys.
  • In the AccProductParamCategory I add a new AccProductParameter and the issue is, that there is only a where clause, but not the option to define the table.

Over the last years we defined a lot of additional columns in ShoppingCartItem and PersonWantsOrg to have them used in special product that have AccProductParameter.

We could reduce the number of foreign keys to different tables on different product, if we could reuse dynamic foreign key fields.

Parents
  • Hi René,

    There is no option on the AccProductParameter to define the table (there never was).

    Please try to define the set of valid tables for the dynamic FK reference. I think unrestricted dynamic FKs are not supported (and for most scenarios make no sense).

  • Hi Hanno

    Thank you for the answer, in the meantime I did some more tests in the .net Web Portal to figure out, why there is no blue lookup button.

    Hier a small correction to my first question:

    • In my test I have missed to give the right to lookup the column for all shop user.
    • Now I see at least a lookup button, if I specify some tables in the dynamic foreign key. The associated tables will now be presented as radio buttons to be selected first.

    But as you stated, there is no column in table AccProductParameter to specify the used table for this specific AccProductParameter.

    Customization to think about

    I think with a schema extension on the table and a small enhancement in the portal, this could be possible to use dynamic foreign key's.

    The idea is to have a generic reference on a PersonWantsOrg to another dynamic table, so that I don't need to specify each and any table.

    We have a made lot of such extension over the last years.

    Example:

    If I have a Column CCC_DynamicForeignKey01, then I could create special shop products with AccProductParameter and reuse the attribute for different tables, without having them each as separate foreign key in the PersonWantsOrg and ShoppingCartItem, examples of values in the CCC_DynamicForeignKey01 would be:

    <Key><T>FirmPartner</T><P>0d087692-13e3-4188-a918-f9b7d2920249</P></Key>

    <Key><T>TroubleTicket</T><P>6f80128f-f9d0-4408-9ba3-5e0caf6fd582</P></Key>

    etc..

    I could use the column universal for all other tables in the database...

    In the backend of the process, where the special shop products are processed, I could gather the value of the reference as follow:

    Dim DbAccountObject As ISingleDbObject = Nothing

    objKey = New DbObjectKey($CCC_DynamicForeignKey01$)

    DbAccountObject = objKey.GetObject(Connection)

  • Hi René,

    Have you considered using the new request parameters (based on the DialogParameter table) for this? They do not need schema extensions and you can reference values from any table.

    You can reference the parameters in scripts using the $PC(ParameterName)$ notation.

Reply Children
No Data