Hello,

I want to add custom button to add new record of case. I added custom button to contact edit page, made onClick event handler and using this function to open add record page of case:

 

_contactObject.openCardInChain({
	"schemaName": "CasePage",
	"operation": "add",
	"defaultValues": [{
		"name": "Contact",
		"value": _contactObject.get("Id"),
		"displayValue": _contactObject.get("Name")
	}]});

It works only when I am on Contact edit page, reload page and clicked my button. or if I entered directly on Contact edit page using url.

 

But if I entered from Contact list page, this function is not working. It shows infinite loader and never stops. If I reload page while loader, it loads add record page of case, exactly what I want.

 

Unfortunately, it doesn't shows any error in console. I tried to debug this function and trace how it works, but at the and, it fires event and I can't understand why its handler not handling it.

 

We are using Bpm Online 7.14.1.935

Like 0

Like

3 comments

Dear Luka,

 

Looks like the issue is related to combined mode Please, try this approach of adding logic to the section and to the page - https://academy.creatio.com/documents/technic-sdk/7-16/how-add-button-edit-page-combined-mode.

 

Best regards,

Angela

Angela Reyes,

we had that problem, but now we added button on ContactPage, so its button and onClick handler works fine. also that function openCardInChain is executed, but there is no result. 

Resolved:

I added property in config param which is passing to openCardInChain function. param is moduleId.

Show all comments