Hi all,

I have a customer need when opening a case the user has to choose which is the next status for going on.

I followed this article: https://customerfx.com/article/opening-a-record-for-edit-in-a-specific-…

 

I implemented successfuly on case record opening the popup for choosing the next status when status is new or reopened, .... 

 

It is working fine for opening first record but when closing the record and opening an other record then having an issue on opening the record the variable are not set. 

 

When doing a full refresh in the browser then the record is opening correctly. Do I need to invoke any destroy method after the popup ?

Here is the code of the handler:

          {
          request: "crt.HandleViewModelResumeRequest",
            handler: async (request, next) => {
              const handlerChain = sdk.HandlerChainService.instance;
              const recId = await request.$context.Id;
              const statusStr = await request.$context.PDS_Status_47jug57;
              
              const dspStatus = statusStr.displayValue;
                
                if(dspStatus=="New" || dspStatus=="Reopened"||dspStatus=="In progress" || dspStatus=="Waiting for response"){
                 await handlerChain.process({
                      type: "crt.OpenPageRequest",
                      $context: request.$context,
                      scopes: [...request.scopes],
                      schemaName: "s4aCaseStatus_ModalPage",
                        modelInitConfigs: [
                            {
                                action: "edit",
                                recordId: recId
                            }
                        ]
                    }
              );
             }
              
              return next?.handle(request);
            }
           }

 

Thanks in advance

Like 2

Like

2 comments

There are currently issues with reading/setting values in the HandleViewModelResumeRequest. For a workaround, try wrapping things in a setTimeout to delay it slightly. 

setTimeout(async () => {
	// do stuff here
	const statusStr = await request.$context.PDS_Status_47jug57;
	// etc
}, 300);

Hopefully we see this fixed/changed soon, it's a horrible hack :) See more here: https://community.creatio.com/questions/813-or-812-breaks-page-param-se…

Ryan

Thanks Ryan the fix workied. Hoping this bug is getting corrected soon.

Show all comments

Hi Community,

Using the below example from academy on how to create custom configuration service. I can get the contact id as a result.

https://academy.bpmonline.com/documents/technic-sdk/7-13/how-create-cus…

Now what I want to achieve, after getting the result I want to open that specific record on Contact Page. How can I possibly do this?

Thanks

Like 0

Like

1 comments

Hello,

The task that you want to achieve theoretically can be achieved using a business process that is triggered upon adding record to the contacts section and you need to specify "open edit page" element that will open created record. Also on contact's page you need to add a checkbox which should be checked and it should be defined in conditions which fit created record. For example create a checkbox that is called "Created bia webservice" and when creating a record via webservice you need to transfer the parameter "true" for this checkbox so the record is created with checked checkbox and triggers business process execution that will open edit page of this record.

Best regards,

Oscar

Show all comments