Relations are not being saved after form submit

Hey,

we are having few data models and form models. Contract-DM, Configuartion-DM, relationship between them - Configuartion-Contract–RM. Additionally we have Person-DM and DocumentTemplate-DM, which have relations to configurations - Configuration-Person-RM and Configuration-DocumentTemplate-RM.

We need a form model to edit configuration - there are two simple string fields, which works ok, but also we have two Dual Panel Selections (bindings) for person and document template. After clicking on the save button only the string fields are being sent to api and saved, relations are simply ignored. What can be missing? There are no errors in the dev console, I’ve also checked redux actions and everything looks correct for me.

Hi @k.szwej,

Can I confirm a few things to help us look into your issue?

  1. Does the Form Model reference a normal Document Model or a Composed Document Model?
  2. Can you confirm which release you are using? Are you using the base release of 2023.06 or an ext version?
  3. I imagine you’re working on your own productive / test build of A12 and not using the Preview App Control. Is this correct?

Thanks, Malcolm

Update: I’ve tested this in the Preview App Control and cannot reproduce this issue using 2023.06-ext5

Hey,

  1. We use normal Document Models
  2. 2023.06.ext-4
  3. We don’t use Preview App Control

I assumed that you can select in the DualPaneSelection, so please check the network tab in browser that your RPC request includes ADD_LINK Operation.

There is no such RPC call after save and I am aware of this. The question is why :smile:

I’ve tested this locally in my app and cannot reproduce the issue using 2023.06-ext4.

I’d like to confirm a few details with you:

  • Is this form using CRUDViews.FormEngineView?
  • In the appsetup.ts file, are these configurations already set up for Relationship:
    • RelationshipFactories.createRelationshipDataProvider()
    • …DeepLinkingFactories.createSagas()
  • Have you made any customizations to the Form component or written new sagas to handle any events before the Form Save event?"

Thanks!

We are not using CRUDViews.FormEngineView, we use FormEngineViews.FormEngine so we can work with custom screen elements. (Solution taken from here).

We use RelationshipFactories.createRelationshipDataProvider(). We don’t use DeepLinkingFactories.createSagas(), I’ve added it for testing and it does not change anything.

To make sure our sagas and middlewares don’t break anything I disabled all of them. Also didn’t help.

Could you provide your custom form component ?

For this particular form we are not using any customizations

In our project, we have same problem.
It just save a root document. (image below)

[Note]
We are using a12 2023.06-ext5
This is a appsetup:

export function setup(): {
	config: ApplicationSetup;
	initialStoreActions(): Promise<void>;
	attachmentHandler: AttachmentHandler;
} {
	const dataHandlers: DataHandlers = {
		dataEditors: [],
		dataLoaders: platformServerConnectors.loaders.dataLoaders,
		dataProviders: [
			// 1. Add needed data providers
			cddDataProvider,
			RelationshipFactories.createRelationshipDataProvider(),
			// --
			taskOverviewDataProvider,
			createEmptyDocumentDataProvider()
		]
	};

	config = ApplicationFactories.createApplicationSetup({
		model: appModel,
		modelLoaders: [], // migrate 2023.06-ext5
		newModelLoader: platformServerConnectors.loaders.newModelLoader,
		applicationBusyTriggers: {
			start: [UaaActions.loggingInLDAP],
			end: [UaaActions.loggedIn, UaaActions.loginFailed]
		},
		applicationResetTriggers: {
			resetRequested: [UaaActions.logoutRequested],
			resetConfirmed: UaaActions.loggingOut(),
			reset: [UaaActions.loggedOut]
		},
		dataHandlers,
		overridePlatformSagas: [...DirtyHandlingFactories.createSagas(), ...workflowsSagas],
		customSagas: [
			// 2. Add cdm saga
			...cdmSagas,
			...RelationshipFactories.createSagas({ dataHandlers }),
			// --
			...CRUDFactories.createSagas(),
			...formEngineSagas,
			setLanguageSelectedInLoginForm,
			...deveeSagas,
			...DeepLinkingFactories.createSagas({ applyTriggers: [ModelActions.setModelGraph] })
		],
		preComputeNewDocuments: true,
		composeEnhancer: isProduction ? undefined : enableReduxDevTools(),
		additionalMiddlewares: [
			...UaaMiddlewares(),
			...CandidateFormMiddlewaresOnBeforeFormEngine,
			// ...createFormEngineMiddlewares(),
			// 3. Replace createFormEngineMiddlewares() with createCdmMiddlewares()
			...createCdmMiddlewares(),
			// --
			CRUDFactories.createCRUDMiddleware(),
			...workflowsMiddlewares(undefined, {
				includeAdaptAppModelMiddleware: false,
				includeAddFormKeyToPushAction: false,
				includeAddFormKeyToReplacementAction: false,
				includeReloadTaskOverviewAfterCompleteTaskMiddleware: false,
				includeReloadTaskOverviewAfterSendMessageMiddleware: false,
				includeReloadTaskOverviewAfterStartProcessMiddleware: false,
				includeReloadTaskOverviewAfterAssignTaskMiddleware: false
			}),
			registerModulesOnLoginMiddleware,
			unregisterModulesOnLogoutMiddleware,
			...DeepLink,
			...platformServerConnectors.middlewares,
			devToolMiddleware()
		],
		dataReducers: [
			// 4. Add needed data reducers
			...RelationshipReducers.dataReducers,
			...dgReducerFactory(cddDataHolderReducerExtension),
			...cddReducers,
			// --
			...formEngineDataReducers
		],
		reducerMap: {
			uaa: UaaReducer,
			modal: ModalReducers.modalReducer,
			common: CommonReducer
		}
	});

	DocumentRtCustomExtensionService.registerCustomConditions(new CustomConditionFactory(config.store));

	const clientConfiguration: UaaClientConfiguration = {
		serverURL: `/api`,
		automaticallyLogin: true,
		store: config.store
	};

	return {
		config,
		initialStoreActions: async () => {
			await uaaIntegration(clientConfiguration);
		},
		attachmentHandler: platformServerConnectors.attachmentHandler
	};
}

I cannot upload zip of Model files.

Thank you.

Hi, Could you upload your models for reproducing the bug?

For your question:
Please upgrade to 202306-ext6 to fix this bug.

Thank you. I will do it and recheck again.

Btw, when will a12 release ext6? I have just checked in https://geta12.com/#/releases/releases-overview but just see ext5 released.

Thank you.

Hi,
Please check the link after May 2.
Thank you!

Hi, I upgrade only @com.mgmtp.a12.client/client-core to 14.6.0 and it works now.

Hi @k.szwej,

did upgrading to 2023.06-ext6 (specifically Client version 14.6.0) also solve the problem for you?
If it is solved, please use the checkbox to mark @long-narrow-bloom’s reply regarding upgrading to that version as the solution so that other users also know what helped.
Otherwise, let us know if we can provide you with further support.

Thank you in advance,
Denise from the Discourse team

Upgrade didn’t help. What’s more, after update other issues appeared (Relations dualpane after upgrade to 2023.06ext6 stopped working - #4 by m.stepniewski).

Hi there,

Could you please upload your models here so we can reproduce the bug? If you’re unable to, feel free to create a support portal ticket and share the models there.

Hey @k.szwej , since you referred to Relations dualpane after upgrade to 2023.06ext6 stopped working - #4 by m.stepniewski ) that came with the update, but has already been solved:
is this issue still valid or has it been solved for yours as well?